Using Mac OS X (Xcode 4.1) for FreeBSD development - xcode

Hi stackoverflow community!
I am about to start developing patches for FreeBSD Ports Collection (pkgng utility) using C programming language.
The problem is that I am using Mac OS X and I am really do not want to switch to another operating system. I have installed Freebsd 9.0 on Parallels Desktop VM. Xcode 4.1 seems to be rather nice development tool for C.
Is it possible to implement development for FreeBSD via Xcode 4.1? How to set up project environment for such form of development and compile source for FreeBSD?
I am also opened for any other suggestions concerning cross-platform development using MacOS X to develop patches for FreeBSD. Which is the best way to organize all necessary stuff?

Since you want to develop patches for pkgng, I would strongly suggest that you compile and test the code on FreeBSD, because it is the only system that uses the ports and packages system that pkgng interfaces with. So unless it can cross-compile for FreeBSD, using any OS X IDE is probably not a good idea.
I'm not familiar with Parallels, but there is probably a file-sharing mechanism that you can set up between OS X and the FreeBSD running in the VM. That way you can edit your files on OS X and use them under FreeBSD.

X Code is really nice, and I would lean toward using it but then doing regular builds on a system actually running FreeBSD. If you have source for everything you're using (except standard libraries whose interfaces match), there is no reason not to work on OS X with Xcode. You can build your own libraries if need be. One thing writing cross platform does (provided you regularly build on the other platform) is make your code more portable. It's easier to avoid using platform specific "extensions".

Related

Mac compiler on windows

Is it possible to develop cross-platform application on Windows and can also compile for Mac OS X from Windows? I have checked Qt but that requires one to compile from Mac using Xcode.
If this is your priority then one option would be Java as at least a jar file built on one platform can be run on another.
If however you're talking about C or C++...
If you are creating a small command line tool then you might be able to make this work with gcc and a cross compiler, but I think it would be a lot of work.
If however you are wanting to create a GUI application I would urge you to give up now. There are so many issues - you'd have to use Carbon or Cocoa APIs which you can't build for on any other platform, you'd have to link against frameworks which won't exist on your compilation host, you won't be able to easily generate .plist files. Qt won't help as you need to be able to build it, which relies on these same frameworks.
In short, there's no alternative to building on an actual mac.
Furthermore, when it comes to fixing bugs, you will absolutely have to do this on a mac (either physical or virtual).
From what I know , in general you do need a mac to make the executable , even for a simple ansi c program you need gcc for mac.
You can create MacPorts Portfile.(If your application is open source)
A MacPorts port is a set of specifications contained in a Portfile
that defines an application, its characteristics, and any files or
special instructions required to install it. This allows you to use a
single command to tell MacPorts to automatically download, compile,
and install applications and libraries.
Take a look at IMCROSS.
IMCROSS is a simple, scripted method of installing cross-compilers and
cross-compiled libraries on a Linux (or possibly other *nix) system,
so that you can develop programs targeted to run on Microsoft Windows
and Mac OS X at the same time and in the same environment as you
develop Linux versions of those programs.
You can certainly do this using Real Studio. It can create Mac OS X applications on Windows without any trouble.
It cross-compiles for Windows, OS X and Linux. And it does it from any platform. It also can create web apps.
Sounds like you should check it out.

Will Ruby extensions built in OS X work on Linux?

I want to make a Ruby extension for a C (with C++ libraries) program that will run on a CentOS server, but it would be more convenient for me to work on a Mac (especially without having to reinstall all the 3rd party libraries).
Since they're both UNIX-based, would creating the library in OS X throw it off once I put it on CentOS, or should I just man up, install CentOS, and do it all there?
Thanks!
You don't even have 100% source compatibility between them, although you can easily stick to what will work on both.
There is no binary compatibility between Linux and OS X; even the basic object file formats differ (Linux uses ELF, OS X uses Mach-O).

PRC-Tools For MS-DOS

I'm emulating MS-DOS 6.22 with PocketDOS, but I want to develop for Palm OS on it, then I want to know if I can run prc-tools or any other compiler for Palm OS on it.
I never saw a port of prc-tools to run in a strict DOS environment. The Windows versions of them were built on top of the cygwin framework. It's possible that you could build it using DJGPP, but I suspect that much of the code, libraries, and utilities rely on having more than 8.3 characters in filenames.
The other key tools were all Windows, Mac, or Linux based. By the time Palm OS development really started, DOS just wasn't an environment professional programmers were using for programming.
You could try running Mini vMac from http://jpdefault.altervista.org/?p=software&id=minivmac and then using an old version of CodeWarrior for Palm OS. Version 6 still had support for 68K hosts, IIRC.

Mutliplatform application: (Automated) Testing for Mac OSX howto?

I have a firefox based application(ff extension) that is supposedly/allegedly working on Mac OSX too. I wish to make the application formally supported in Mac OSX. For that, I need to incorporate automated tests in the build process specific to Mac OSX.
With ubiquitous availability of Windows and Linux as cloud offering, executing automated tests for these platforms is easy. Not so with Mac OSX.
Any suggestions on how to go about the (light) automated testing for Mac OSX?
[PS:I have come across MediaTemple's OSX cloud in private beta. No luck for me in getting an invite.]
I don't know what kind of testing you'd like to perform, but why don't you install OS X on VMWare and test within the virtual machine? See this SO question if that is an option for you:
https://stackoverflow.com/questions/39159/is-it-possible-to-run-osx-in-a-virtual-machine
Maybe a combination of Selenium(www.seleniumhq.org) and Sikuli (http://sikuli.org/) would work for you?
Selenium to drive anything web based in FireFox and Sikuli to do all the rest. The tools work all fine together with Java API support. Both tools platform independent.
Cheers,
Stefan
I don't know what test you are trying to automate, but if it is command line based (as the comments seem to suggest it is php code under test), then you can install a VM with darwin on it and perform your tests there. Mac OS X being based on darwin should give you similar results. However as I don't know what the test entails there is no guarantee.
You can find the darwin release for Snow Leopard here, 10.5 is here, and 10.4 is here
If it were me, I'd look at Selenium Grid. It should be possible to create a set of Selenium RC tests initially then use Grid to run the tests on your various platforms, including OS X as well as Windows and Linux. I haven't tried it with running tests in the cloud, but that might even be a possibility.

Is there something like Microsoft's TechNet or MSDN subcriptions for Apple?

I would like to test software designed to run on a Mac and would need a couple of OS versions (old ones, too) and maybe other Mac software to set up my (virtual) test machines.
For the same scenario on Windows, I can use the licenses available via TechNet or MSDN subscriptions. At the ADC Mac Dev Center, I couldn't find any specific information as to what is available. Does an ADC membership get me downloads of software / OS's to test against? If not, what is available?
Bear in mind that I don't believe any version of Mac OS (barring OS X Server) is licensed for use in a VM. In theory, if you want to test different versions of the OS you'll need to do either multiple installs on a single system (My first iMac came with OS 9 and OS X installed this way, not sure you could get multiple OS X versions installed on a single box) or have lots of boxes.
Yes it does. You can download the operating systems as well as betas (although not as early as "proper" beta testers).

Resources