meson: define ETIME to ETIMEDOUT if not present

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
diff --git a/meson.build b/meson.build
index 593bfee..06953b3 100644
--- a/meson.build
+++ b/meson.build
@@ -778,6 +778,11 @@
   error('When using GCC, version 4.4.6 or later is required.')
 endif
 
+# Support systems without ETIME (e.g. FreeBSD)
+if cc.get_define('ETIME', prefix : '#include <errno.h>') == ''
+  pre_args += '-DETIME=ETIMEDOUT'
+endif
+
 # Define DEBUG for debug builds only (debugoptimized is not included on this one)
 if get_option('buildtype') == 'debug'
   pre_args += '-DDEBUG'