Compiling for Mac OS X is not hard; someone else has already gone through the pain of compiling all dependencies and utilities. Compiling requires an Intel Mac.
- Download the Source
- Download a build of FB pre-1.06 [1]. This is a branch of the official version not yet merged in. The sources for this WIP Mac port of FB are here. (The obsolete sources for that old 20160505 build are here). This branch is not yet merged upstream, but hopefully will be soon.
- Either make sure that the fbc executable is in your PATH, or pass the fbc argument to scons (or set FBC environment variable) to point to it.
- Install the SDL 1.2 and SDL_mixer 1.2 and/or SDL 2.0 and SDL_mixer 2.0 frameworks, depending on whether you want to compile gfx_sdl/music_sdl (soon to be obsolete) or gfx_sdl2/music_sdl2 (future default) backends.
- scons looks for the frameworks both in /Library/Frameworks and ~/Library/Frameworks, or calls sdl-config.
- There may be other ways to install scons, but what worked for me was to install MacPorts and then run sudo port install scons, or install Homebrew and run brew install scons.
- In the main 'wip' directory, run 'scons' as usual, or 'scons .', etc. All targets should work (hspeak requires Euphoria)
- Run ./bundle-apps.sh to produce OHRRPGCE-Custom.app and OHRRPGCE-Game.app. This is optional; you can just run ohrrpgce-custom and ohrrpgce-game directly
- You can run ./distrib-mac.sh to package a distribution.
Jun 28, 2015 Download GCC D Compiler for Mac OS X for free. GCC D Compiler (GDC) for Mac OS X (10.2-10.4) See for new GDC development. Apr 16, 2019 Brief Overview of Intel C Compiler Professional Edition for Mac OS X for Mac OS X. Intel C Compiler Professional Edition for Mac OS X is an impressive code compiler that relies on a very powerful optimization techniques that enables the programmers to increase the execution speed as well as improve the performance of the application.
Gcc compiler for mac free download. Pgweb Pgweb is a web-based, cross-platform PostgreSQL database browser written in Go. Go was used in backe. A 32/64/16-bit Pascal compiler for Win32/64/CE, Linux, Mac OS X/iOS, FreeBSD, OS/2, Game Boy Advance, Nintendo NDS and DOS.
- 3FB 0.22 Mac port
C/C++/Objective-C compiler[edit]
You need clang or an Apple gcc compiler to compile objective-C code (mac/SDLMain.m) because the system headers use blocks, which aren't supported by FSF GCC without Apple's patch for blocks added. For example GCC from macports doesn't work. clang does support blocks. XCode 4.2/GCC 4.2.1 is tested and confirmed working.
Versions Gorgonzola and earlier required gcc to compile FB code translated to C (clang masquerading as gcc did not work), but the next release can be compiled with clang. gcc is still used instead of clang if it is in the PATH. Run scons compiler=clang to prefer clang. (This is a WIP feature)
(Note for old versions: It is actually possible to use one compiler ('GCC') for FB code translated to C, and a different compiler ('CC') for the C/C++/Objective-C code (any version of Apple gcc or clang or gcc-clang) like so:
XCode 4.2/Apple GCC 4.2.1, and GCC 4.9.3 from MacPorts are both known to work.)
Things you don't need to compile[edit]
mac/utilities.tar.gz and mac/utilities-x86_64.tar.gz also includes x86 and x86_64 builds (not fat binaries) of madplay and oggenc.
wip/mac/Frameworks.tar.gz contains x86-only builds of SDL and SDL_mixer; SDL.Framework is also missing headers to reduce its size. SDL_mixer has had a patch applied (see below) to fix Midi looping, though more recent SDL_mixer released have this fixed. Good luck trying to configure the Xcode projects to compile for Intel only.
This article (or part thereof) is obsolete. It may have made sense in the past, but it does not make sense now. It is kept here only for historic curiosity and/or posterity.
This information about the original port of FB 0.22 to OSX is preserved here for the moment.
Build of unofficial Mac port of FreeBASIC 0.22: [2]
Lately only compiling on OS 10.7 with XCode 4.2/GCC 4.2 has been tested, though all other versions of Mac OS should work too (only with a recent GCC?). OS 10.6 and 10.5 have previously been used; 10.4 has never been tested. 10.3 and older are PPC-only.
Compiling with support for older versions of Mac OS[edit]
(This section is out of date or incorrect)
By default compiling C code on OS 10.6+ will produce binaries that won't run on OS 10.4 and 10.5. To rectify this, you need a compatible build of FB, a compatible build of Euphoria, and have the OS 10.4 (recommended) or 10.5 SDK installed. Sadly you can't install these SDKs via more recent XCode versions; officially they are no longer supported, though they still seem to work.
- FB for OS 10.4+: fixme
- Euphoria 4.0.5 for OS 10.4+: [3]
- (Note: the euc in this Euphoria build assumes that the OS 10.4 SDK is installed at /Developer/SDKs/MacOSX10.4u.sdk. If you want to compile on an actual 10.4/5 system without the SDK, get euc to generate a makefile and remove the -isysroot flag in it.
Compile with scons macsdk=10.4 or other Mac OSX SDK.
Actually you can use this FB build on all Intel Macs, but it produces annoying warning messages if not used in combination with with macsdk argument, and might not link correctly?
GPL Compliance[edit]
- FreeBASIC port source/patch
It might be nice to package games for Mac as .pkg Installers instead of .tar.gz files. These can be created on other OSes using a few simple programs (cpio, xar, gzip, bomutils):
Out of the box, OS X Lion doesn’t have the command line C compilers. Plus, Apple has once again changed the way you install those compilers in /usr/bin. Here’s how to do it with the latest Xcode and Lion.
Back in August, right after OS X 10.7, Lion, shipped, I wrote about how a new installation does not have the C compilers in the expected place, /usr/bin. This article, “OS X Lion for UNIX Geeks: Installing the C Compilers,” provided all the background.
Recently, professor Ulf von Barth of Lund University in Sweden alerted me to the fact that the mechanism has changed yet again. In the article linked above, I explained that all you had to do was download and install Apple’s Xcode IDE, and everything would be as expected. Now, you have to do a little more. But before I proceed, you should go back and read that article for reference on the C compilers, gcc, llvm, and all that jazz.
Motivation
There may be good reasons not to have a C compiler sitting around an average user’s Mac, ready to stir up trouble if accessed by malware. Thats why it’s not in the Mac by default. On the other hand, you may be taking a C class and want to use a C compiler (gcc now points to llvm) from the command line. Or you may be an administrator, and you want the C compiler to be available in a lab setting. Or you’re a researcher, and you don’t use Xcode for scientific computing. Or it may just be for show. Some day, an IT admin will come up to you and question you about the Mac, and you proudly announce that it’s based on (BSD) UNIX. This Linux guru will open the command line, type “cd /usr/bin; ./gcc -v” and then snort. “Aha. Nothing there. It’s not real UNIX! ” Not good.
Uh-oh. Not there.
For whatever reason you may have, here’s what you need to do nowadays. Note that, unlike before, when everything was free, you will need to be a registered Mac developer.
Procedure
1. Download Xcode, now at version 4.3.2, just as before, from the Mac App Store. Finder -> Apple -> App Store… It’s always been free and still is.
2. Launch the Xcode.app that was downloaded to /Applications.
3. If you stop there, you’ll find that, unlike before, the command line compilers are not installed by default. You can go hunting for them, and you’ll it all in:
Oops. gcc/llvm now buried /Applications for use by Xcode
Phew! That won’t do you any good unless you intend to use Xcode exclusively. Very likely, all your conventional Make scripts won’t know where to find the C compilers (and linker and assembler) now, and you wouldn’t want to modify them anyway. So setting up links to the new location would be messy and likely will not work, creating new headaches. What you need is everything back in /usr/bin like before.
Mac Os Gcc
4. After launching Xcode, go to Preferences and select the Downloads pane, then Components. There, in the list of candidate items will be the Command line tools. Click “Install.”
Xcode’s downloads
5. You’ll be prompted for your developer credentials…
…then you’ll see the classic progress bar. When that’s done, the C compilers will all be in /usr/bin, as desired. To prove that all’s well, open a terminal window, cd to /usr bin, and take a look. Voila.
All is well again in /usr/bin
It’s a shame we have to go through all that these days, but I can see how Apple feels that the majority of users don’t need these tools, and those who do will find out how to get them. I suppose you could call that a subordinate claws.
Download Gcc Compiler For Mac Os X
_________
My thanks to Dr. Ulf von Barth of Lund University in Sweden and Dr. Gaurav Khanna, Physics Dept., the University of Massachussetts for their assistance with this article.