Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How portable is GLib?

I know this question might sound strange because GLib is a portability library, but how portable is it? To name one example: Does GLib (including GObject) run on microcontrollers or does it depend on some kind of operating system?

Are there any limitations on where I can use GLib or will it run everywhere where it is possible to run C code?

like image 460
drakide Avatar asked Apr 30 '12 14:04

drakide


1 Answers

The only resource I could find on what the dependencies of GLib are is here:

Compiling the GLib package

Look in the "Dependencies" section - the non-optional dependencies seem to be:

  • A iconv function
  • A gettext function
  • A threading implementation
  • The PCRE library

This means that you will need to provide (or port) each of these to whatever the target system is (e.g. a microcontroller). Although not an insurmountable barrier, a threading implementation generally implies some form of operating system.

Also its worth noting that GLib appears to depend on a "Hosted" C environment, and so you would also need to have a standard C library ported to the target environment as well (as opposed to a "Free-standing" C environment, a subset of the standard C doesn't require that a standard C library be ported). See Hosted and Free-Standing Environments. Again this generaly implies at least a very basic form of operating system.

like image 52
Justin Avatar answered Nov 01 '22 15:11

Justin