Difference between revisions of "Target Darwin"

From Lazarus wiki
Jump to navigationJump to search
m (Tweak warning note)
 
(29 intermediate revisions by 5 users not shown)
Line 1: Line 1:
= Introduction =
+
{{Platform only|macOS}}
 +
{{Platform only|iOS}}
 +
{{LanguageBar}}
  
Darwin is the target for Mac OS X, both powerpc and i386. Programs may also be run on a machine with only Darwin installed.
+
{{Warning2|In Lazarus 2.2.0/FPC 3.2.2 and later, the target for building iOS applications was changed from Darwin to iOS due to the advent of the Apple Silicon M1 (ARM64) processor in Mac computers.}}
  
= Installation =
+
== Introduction ==
  
There are two possibilities:
+
Darwin is the target for macOS and iOS, both PowerPC, ARM and ARM64, i386 and X86_64. Programs may also be run on a machine with only Darwin installed.
  
1) Download the image file at ftp://ftp.freepascal.org/pub/fpc/dist/
+
== Installation ==
  
Version 2.0.4: ftp://ftp.freepascal.org/pub/fpc/dist/powerpc-macosx-2.0.4/fpc-2.0.4.powerpc-macosx.dmg.
+
See [[Installing Lazarus on macOS]].
  
Version 2.2.0 (PowerPC): ftp://ftp.freepascal.org/pub/fpc/dist/powerpc-macosx-2.2.0/fpc-2.2.0.powerpc-macosx.dmg.
+
== Usage ==
  
Version 2.2.0 (Intel): ftp://ftp.freepascal.org/pub/fpc/dist/i386-macosx-2.2.0/fpc-2.2.0.intel-macosx.dmg.
+
1) [http://forum.lazarus.freepascal.org Lazarus IDE]
  
2) Use fink (http://fink.sourceforge.net)
+
Lazarus is a Delphi-style RAD environment
  
 +
2) [http://www.ragnemalm.se/lightweight/ Lightweight IDE]
  
In addition, daily snapshots of the development powerpc and i386 versions of fpc 2.3.1 and lazarus are available at (usage at own risk):
+
A free IDE in the classic Mac style
  
http://ftp.de.freepascal.org/pub/lazarus/
+
3) Any Editor (AlphaX, BBedit, ...) and command line (fpc your_pascal_program.pas)
  
http://ftp.hu.freepascal.org/pub/lazarus/
+
== Universal binaries ==
  
http://ftp.ca.freepascal.org/pub/lazarus/
+
Normally for each processor - operating system combination there is one executable, but in macOS you can combine an aarch64 (ARM64) binary and an x86_64 binary into a so-called "universal binary" or "multi-architecture binary" that will run on both Apple ARM64 processors and Intel 64 bit processors. To do this the ARM64 and x86_64 executables have to be compiled separately and then combined using the <code>lipo</code> command line utility.
  
http://michael-ep3.physik.uni-halle.de/Lazarus/
+
It is also possible to combine a PowerPC binaries and an x86 binaries into a single combined binary using the <code>lipo</code> command line tool. You would need to first [https://sourceforge.net/projects/freepascal/files/Mac%20OS%20X/ download the PowerPC cross-compiler] so you only need to use <code>ppcppc</code> instead of <code>fpc</code> to build your project to generate the PowerPC binary. If you have a PowerPC computer, then the simplest solution is to build the x86 binary on a different computer with x86 architecture.
  
= Usage =
+
== See also ==
  
1) Editor (AlphaX, BBedit, ...) and commandline (fpc your_pascal_program.pas)
+
* [[Portal:Mac|Mac Portal]].
 +
* [[macOS_Big_Sur_changes_for_developers#Creating_a_universal_binary_for_aarch64_and_x86_64| Creating a universal binary for aarch64 and x86_64]].
 +
* [[Target MacOS]] for PowerPC processors.  
  
2) XCode
+
[[Category:iOS]]
 
+
[[Category:macOS]]
Recommended: Pascal extensions for XCode: http://www.freepascal.org/xcode.html
 
 
 
XCode 2.2.1 needs a newer revision of the integration kit. XCode 2.3 is also ongoing work.
 
 
 
3) DOS-like IDE
 
 
 
A description of how to get the IDE running is here: [[How to get the fpc ide running under Mac OS X]]
 
 
 
4) Lazarus
 
 
 
Lazarus is a GTK based RAD environment: http://www.lazarus.freepascal.org
 
 
 
 
 
= More =
 
 
 
* Mac OS Pascal universal interfaces are now part of the extra packages: packages/extra/univint
 
 
 
*  IDE already works, except for some graphic glitches on the user output screen,
 
*  gdb support?
 
**  the gdb can be executed from command line and works
 
 
 
* can mouse events be supported with Terminal.app and X11.app? how?
 
** The mouse unit needs to be checked.
 
 
 
* universal binaries (powerpc and i386)
 
**the powerpc and i386 executables have to be created separately and then combined using lipo
 

Latest revision as of 00:54, 29 March 2022

macOSlogo.png

This article applies to macOS only.

See also: Multiplatform Programming Guide

Apple iOS new.svg

This article applies to iOS only.

See also: Multiplatform Programming Guide

English (en)

<translate> Warning: </translate> Warning In Lazarus 2.2.0/FPC 3.2.2 and later, the target for building iOS applications was changed from Darwin to iOS due to the advent of the Apple Silicon M1 (ARM64) processor in Mac computers.

Introduction

Darwin is the target for macOS and iOS, both PowerPC, ARM and ARM64, i386 and X86_64. Programs may also be run on a machine with only Darwin installed.

Installation

See Installing Lazarus on macOS.

Usage

1) Lazarus IDE

Lazarus is a Delphi-style RAD environment

2) Lightweight IDE

A free IDE in the classic Mac style

3) Any Editor (AlphaX, BBedit, ...) and command line (fpc your_pascal_program.pas)

Universal binaries

Normally for each processor - operating system combination there is one executable, but in macOS you can combine an aarch64 (ARM64) binary and an x86_64 binary into a so-called "universal binary" or "multi-architecture binary" that will run on both Apple ARM64 processors and Intel 64 bit processors. To do this the ARM64 and x86_64 executables have to be compiled separately and then combined using the lipo command line utility.

It is also possible to combine a PowerPC binaries and an x86 binaries into a single combined binary using the lipo command line tool. You would need to first download the PowerPC cross-compiler so you only need to use ppcppc instead of fpc to build your project to generate the PowerPC binary. If you have a PowerPC computer, then the simplest solution is to build the x86 binary on a different computer with x86 architecture.

See also