TLazSerial Component lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- jcdammeyer · 2020-12-23 18:02 Since I thought that the Mac used Linux under the covers I wondered why this component wouldn't work.  https://github.com/JurassicPork/TLazSerial But since it's Unix I can see the $IFDEF for LINUX failing and therefore trying to build for Windows.  Just moving Classes out side of the ifdef and commenting out windows doesn't work. There are other files in the package that have issues.  I can try and make this work but before I head down that rabbit hole will macOS allow access to a USB Serial device or is this against Mac rules? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {$IFDEF LINUX}  Classes,{$IFDEF UseCThreads}  cthreads,{$ENDIF}{$ELSE}  Windows, Classes, //registry,{$ENDIF}  SysUtils, lazsynaser,  LResources, Forms, Controls, Graphics, Dialogs,  PropEdits; ---------------------------------------------------------------------- trev · 2020-12-23 20:56 I have no firsthand experience with doing this on macOS, but you may find the Wiki article Hardware Access helpful. Also, see https://forum.lazarus.freepascal.org/index.php/topic,20481.45.html ---------------------------------------------------------------------- wp · 2020-12-23 21:25 When you simply open a new project and look at the lpr file you'll see Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses  {$IFDEF UNIX}  cthreads,  {$ENDIF}  {$IFDEF HASAMIGA}  athreads,  {$ENDIF}    ...Therefore, I'd guess that you only have to replace the {$IFDEF LINUX} by {$IFDEF UNIX}. ---------------------------------------------------------------------- jcdammeyer · 2020-12-23 22:12 I did try that but there are several other .pas files and they did have IFDEF UNIX but there were missing constants.  I didn't want to spend a lot of time on it if was going to be a rabbit hole that would eat up a week or more. @WP Interesting.  I hadn't thought of that.  the cthreads is a requirement of LazSerial with Linux but not Windows.  I'll report back when I've done a bit more research.  If I can get it working then we can update the github to include macOS as one of the targets.  At the moment, it does say only for Windows and Linux. ---------------------------------------------------------------------- jcdammeyer · 2020-12-23 22:30 @trev.  Interesting that all that work for LazSerial in the link you posted was from 2014.  In computer terms that's eons ago. Something i don't understand though.  Serial ports go back to the first PCs.  Linux can't really function without it.  Lazarus isn't alone in this.  The same issue is there with Delphi where for at least the last 15 years I've been using the CPort component.  Each year I think my RAD Studio upgrade will have serial and each year not. ---------------------------------------------------------------------- jcdammeyer · 2020-12-23 23:20 The Poster, Jurassic Pork (JP) has made changes to LazSerial based on comments in LazSynaSer.pas.  And there are {$IFDEF DARWIN} conditionals. However, compiling the component fails on identifier not found TIOCGSERIAL.  That doesn't happen in the windows version because that piece of code is not defined so not accessed. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i     {$IFNDEF MSWINDOWS}    // Modif J.P   03/2013 - O1/2017    function GetSerialPortNames: string;    ... However drop into the Pi Linux version and it's defined in the termios.inc.   It's not defined in the termios.inc on the Mac. So termio.pp which is in ../rtl/darwin/ is different from termio.pp in ../rtl/linux/ Changing the Linux Run Time Library files is really above my pay grade so to speak. For the same reason on another Linux Lazarus project I'm having trouble incorporating socketCAN support in sockets.pp while the sockets.c used by C and Python already have it. Where do we put in a request to upgrade /rtl/termio.pp and the corresponding termios.inc to match what is available in Lazarus for Linux? Thanks John [edit: argh - edited original post instead of my reply :-] ---------------------------------------------------------------------- trev · 2020-12-24 01:54 QuoteThe Poster, Jurassic Pork (JP) has made changes to LazSerial based on comments in LazSynaSer.pas.  And there are {$IFDEF DARWIN} conditionals.  However, compiling the component fails on identifier not found TIOCGSERIAL.  Although I didn't read that whole thread I pointed you to, I did notice that there was a post about defining the missing constants/identifiers. QuoteHowever drop into the Pi Linux version and it's defined in the termios.inc.   It's not defined in the termios.inc on the Mac. So termio.pp which is in ../rtl/darwin/ is different from termio.pp in ../rtl/linux/ Changing the Linux Run Time Library files is really above my pay grade so to speak.  For the same reason on another Linux Lazarus project I'm having trouble incorporating socketCAN support in sockets.pp while the sockets.c used by C and Python already have it. Where do we put in a request to upgrade /rtl/termio.pp and the corresponding termios.inc to match what is available in Lazarus for Linux? The BugTracker would be the place. ---------------------------------------------------------------------- jcdammeyer · 2020-12-24 02:26 Submitted to Bug Tracker.