Compile BlueZ for iOS7? - c++

I am currently trying to create a PAN on a jailbroken iOS device (iPad, in this case). On my Raspberry Pi I can achieve this using the bluez bluetooth stack and the pan daemon that comes with it. I thought if it could be possible to port bluez to the iOS device, unfortunately I don't really know enough about compiling - besides compiling stuff using a makefile I didn't do much in that regard.
I was able to get a gcc compiler onto the iPad using BigBoss's "installsdk3", but if I try to run configure on bluez it gives me Compiler cannot create executables.
Does anybody know if this is possible, how or can give me directions how this could be achieved? I know that xcode on the mac comes with a c++ compiler for iOS, but I couldn't really find out how to get the makefile to make use of it.

Bluez is specifically a Linux bluetooth stack. OS X and iOS are based on BSD which though similar to Linux is not the same. I very much doubt you can run bluez on iOS.
Instead look into Apple's own bluetooth stack.
https://developer.apple.com/library/ios/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/AboutCoreBluetooth/Introduction.html

BlueZ is the user mode part of the Bluetooth stack. It depends on a kernel mode component, which exists in the Linux kernel but not BSD (as mentioned in other answers, what Mac OS is based on). Hence BlueZ cannot work with a Mac OS kernel.
AFAIK, there is no way to run Mac OS with a Linux kernel.

Related

Do I have to be on a specific OS to compile for a specific OS when using Qt?

When I was using pyqt it was necessary to compile for mac on a mac, instead of being able to export a build for mac from linux (or windows, or whatever)
Now that I'm using straight c++ development, does this fact change at all? Or must I still compile for a given OS on the given OS?
Ideally I'd love to be able to just pick a platform and compile for it. Unity3d does this, but I imagine I'm comparing apples and oranges at this point.
Is this possible? Or do I got to find a friend with a mac? Cuz I don't have no friends... ;)
Typically yes, you have to. In some cases you can cross-compile, for example, this is available stock for android apps, as there is no Qt SDK that can run on android cross-compilation is the only option. You can also build a custom Qt to cross-compile to another OS. This is not available by default, it requires a custom build.
However, when it comes to ios or macos cross-compilation is not an option, as far as I know there is no way around but to compile under macos.

Build iOS apps, Windows 7/10 & Jailbroken device

I have an jailbroken iOS device and Windows 7/10. I would like to be able to easily build and compile (C++/Cocos2Dx) iOS games and directly test them on my device. I would also like to be able to share my code to OS X users so that they can also compile it using XCode (probably not a problem).
What is the best way to do so?
What I know (but may be partly wrong) :
I could use virtual machines to simulate OS X but it seems to be slow and therefore not the best long-term solution.
There are tools to compile iOS code with jailbroken iOS devices using some toolchain available on Cydia but I'm not really sure if and how it would work using the latest versions of iOS and using external libraries like Cocos2Dx. Plus it does not seem to be ultra convenient to compile then install and test your app on the device.
I could use Marmalade but I'm not sure about including Cocos2Dx in it, it's not entirely free and I don't know if the code can easily be compiled in someone's else XCode.
You can rent a macOS machine though a service such as http://www.macincloud.com.
You could also buy a Mac Mini.

GPIO/Analog programming for BeagleBone Black on Angstrom Linux, what compiler for cross development on Windows?

I'm working on a BeagleBone Black (BBB from now on) with its stock Angstrom Linux.
I'm able to do GPIO/Analog programming using JavaScript, but I want to do it in C/C++.
I know the sysfs thing and /dev/mem, I want to know how to configure the GPIO and analog pins.
I can write C/C++ code for GPIO/analog reading writing, but have no clue what to do for initialization.
One way is the Device Tree Overlay, but I don't want to go for two different things for one purpose, since I can understand that it can be done in C/C++ but how??
It'll be helpful if I could alongside get some example related to both sysfs and /dev/mem for configuring+r/w of gpio &/or analog pins of the BBB (on Angstrom Linux, if this matters)
Derek Molloy has a great series of videos describing exactly how to do this, and more. His BeagleBone site has this address: http://derekmolloy.ie/beaglebone/
For C/C++ cross-development, the recommended path is to use Eclipse in Linux on your desktop computer. I personally run Ubuntu in VirtualBox under Windows. Derek Molloy describes this in full detail: http://derekmolloy.ie/beaglebone/setting-up-eclipse-on-the-beaglebone-for-c-development/
With the Beaglebone Black kernel (3.8), configuration can be done using Devicetree. It is shown in great detail in this video: http://derekmolloy.ie/beaglebone/beaglebone-gpio-programming-on-arm-embedded-linux/
OK, so Linux is the only way?
I've tried cross-compiling for other processors (bare-metal) using code::blocks, em::blocks & eclipse/ by using the respective cross-gcc toolchain for windows. Ex: arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) with Eclipse CDT was great and easy.
Isn't there any toolchain that would let me cross-compile for BBB/Angstrom-Linux on my windows laptop. I tried the linaro toolchain but even that didn't work
Thanks for those links, the Device tree seems good way, I want to try /dev/mem also, it looks more straightforward and is similar to bare-metal C/C++ programming once mmap is done.

Compiling a Qt application for Mac OS X on Linux

I'm developing a Qt application and I need to support Linux, Windows and Mac OS X. The only problem however is that I do not own a Mac. Is it possible to compile my application for Mac OS X on Linux and package it in a .dmg file?
I'm also worried with the fact that my application depends on OpenSSL, can I compile OpenSSL for Mac OS X on my Linux machine?
Thank you.
How do you want to support Mac if you can't even test if your software works?
Cross-compilation for OS X: I doubt there is any solution out there (I'd love to learn about it if it is), you'd need the whole SDK and toolchain for that.
For the .dmg file creation part, there is another question here:
How to build a dmg Mac OS X file (on a non-Mac platform)?
There should be no need to bundle openssl, as it's part of every OS X installation.
If you want to support Mac you need to Mac, access to one (remote, rented etc.), or someone who does it for you. I don't think you have another choice.
As the accepted answer in
How to Compile for OS X in Linux or Windows?
suggests, you can go for Macports in case you develop free software. It does the compiling on the user's machine (think FreeBSD ports or Gentoo's emerge). Still, that will require testing.

How to Compile for OS X in Linux or Windows?

I would like to port my C/C++ apps to OS X.
I don't have a Mac, but I have Linux and Windows. Is there any tool for this?
For Linux, there is a prebuilt GCC cross-compiler (from publicly available Apple's modified GCC sources).
https://launchpad.net/~flosoft/+archive/cross-apple
Update for 2015
After so many years, the industry-standard IDE now supports OSX/iOS/Android.
http://channel9.msdn.com/Events/Visual-Studio/Connect-event-2014/311
Embarcadero's RadStudio also supports building OSX/iOS/Android apps on Windows.
This answer by Thomas also provides a cross-compilation tool.
For all these options you still need a real mac/i-device to test the application.
I have created a project called OSXCross which aims to target OS X (10.4-10.9) from Linux.
It currently supports clang 3.2 up to 3.8 (trunk) (you can use your dist's clang).
In addition you can build an up-to-date vanilla GCC as well (4.6+).
LTO works as well, for both, clang and GCC.
Currently using cctools-870 with ld64-242.
https://github.com/tpoechtrager/osxcross
There appears to be some scripts that have been written to help get you set up cross compiling for the Mac; I can't say how good they are, or how applicable to your project. In the documentation, they refer to these instructions for cross-compiling for 10.4, and these ones for cross compiling for 10.5; those instructions may be more helpful than the script, depending on how well the script fits your needs.
If your program is free or open source software, then you may wish instead to create a MacPorts portfile (documentation here), and allow your users to build your program using MacPorts; that is generally the preferred way to install portable free or open source software on Mac OS X. MacPorts has been known to run on Linux in the past, so it may be possible to develop and test your Portfile on Linux (though it will obviously need to be tested on a Mac).
Get "VMware Player"
Get "Mac OS X vm image"
Compile/Debug/Integrate-and-test your code on the new OS to make sure everything works
When you are trying to get something working on multiple platforms you absolutely must compile/run/integrate/test on the intended platform. You can not just compile/run on one platform and then say "oh it should work the same on the other platform".
Even with the a really good cross-platform language like Java you will run into problems where it won't work exactly the same on the other platform.
The only way I have found that respects my time/productivity/ability-to-rapidly iterate on multiple platforms is to use a VM of the other platforms.
There are other solutions like dual-boot and ones that I haven't mentioned but I find that they don't respect my productivity/time.
Take dual-booting as an example:
I make a change on OS 1
reboot into OS 2
forget something on OS 1
reboot into OS 1
make a change on OS 1
reboot into OS 2 ... AGAIN...
BAM there goes 30 minutes of my time and I haven't done anything productive.
You would need a toolchain to cross compile for mach-o, but even if you had that, you won't have the Apple libraries around to develop with. I'm not sure how you would be able to port without them, unfortunately.
Apple development is a strange beast unto itself. OS X uses a port of GCC with some modifications to make it 'appley'. In theory, it's possible to the the sources to the Apple GCC and toolchain as well as the Apple kernel and library headers and build a cross compiler on your Windows machine.
Why you'd want to go down this path is beyond me. You can have a cheap Mac mini from $600. The time you invest getting a cross compiler working right (particularly with a Windows host for Unix tools) will probably cost more than the $600 anyway.
If you're really keen to make your app cross platform look into Qt, wxWidgets or FLTK. All provide cross-platform support with minimal changes to the base code. At least that way all you need to do is find a Mac to compile your app on, and that's not too hard to do if you have some technically minded friends who don't mind giving you SSH access to their Mac.
You will definitely need OS X somehow. Even if you don't own a Mac, you can still try some alternatives.
I found this small documentation on the net:
http://devs.openttd.org/~truebrain/compile-farm/apple-darwin9.txt
This describes exactly what you want. I am interested in it myself, haven't tested it yet though (found it 10 minutes ago). The documentation seems good, though.
You can hire a mac in the cloud from this website. You can hire them from $1, which should be enough (unless you need root access, then you are looking at $49+).
There are a few cross-compiler setups, but nearly all of them are meant for distcc-style distributed compiling. To my knowledge there is no way to directly target the Mac platform without actually having a Mac. The closest you can get without resorting to QT or wxWidgets is OpenStep with GNUStep or similar, but that's not a true Cocoa platform, just very close.
I know this question isn’t very active but answering anyways. Why don’t you try using TransMac, then download the XCode image and do it that way? Or you can use a VM, or Sosumi. You’ll find a video on youtube about sosumi, definitely.
The short answer is kind of. You will need to use a cross-platform library like QT. There are IDE's like QT Creator that will let you develop on one OS and generate Makefiles for others. For more information on cross platform development, check out the cross-platform episodes of this podcast (note that the series isn't over and new episodes appear to come out weekly).
As other answers explain you can probably compile for a Mac on Windows or Linux but you won't be able to test your applications so you should probably spend the $600 for a Mac if you’re doing professional programming, or if you’re working on open-source software find a developer with a Mac who will help you.