Skip to content

Commit defbea4

Browse files
author
gsherman
committed
Tom Russo's patches for FreeBSD:
"I run QGIS on FreeBSD these days, and have found that I need the attached patch to get the grass shell and gps plugin to work. The grass shell patch is needed even to get the thing to compile. The grass shell patch makes sure the right include files are brought in to get at the PTY functions. The gpsplugin patch changes the preprocessor symbol that selects what style of ports to probe for, and adds a block of code that scans for USB serial adapters." git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6047 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 43eee2b commit defbea4

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/plugins/gps_importer/qgsgpsplugingui.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ void QgsGPSPluginGui::populatePortComboBoxes() {
286286

287287
#endif
288288

289-
#ifdef freebsd
289+
#ifdef __FreeBSD__ // freebsd
290290
// and freebsd devices (untested)
291291
QString freebsdDev("/dev/cuaa%1");
292292
for (int i = 0; i < 10; ++i) {
@@ -297,6 +297,18 @@ void QgsGPSPluginGui::populatePortComboBoxes() {
297297
else
298298
break;
299299
}
300+
301+
// and the ucom devices (serial USB adaptors)
302+
freebsdDev = "/dev/ucom%1";
303+
for (int i = 0; i < 10; ++i) {
304+
if (QFileInfo(freebsdDev.arg(i)).exists()) {
305+
cmbDLPort->insertItem(freebsdDev.arg(i));
306+
cmbULPort->insertItem(freebsdDev.arg(i));
307+
}
308+
else
309+
break;
310+
}
311+
300312
#endif
301313

302314
#ifdef sparc

src/plugins/grass/qgsgrassshell.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,14 @@ extern "C" {
4343
#ifdef __NetBSD__
4444
#include <util.h>
4545
#else
46+
#ifdef __FreeBSD__
47+
#include <termios.h>
48+
#include <libutil.h>
49+
#else
4650
#include <pty.h>
4751
#endif
4852
#endif
53+
#endif
4954
#include <sys/types.h>
5055
#include <sys/stat.h>
5156
#include <sys/ioctl.h>

0 commit comments

Comments
 (0)