3
name: Linux Directory Notification
10
#include<sys/utsname.h>
12
//----------------------------------------------------------------------------
14
//----------------------------------------------------------------------------
15
class qc_dnotify : public ConfObj
18
qc_dnotify(Conf *c) : ConfObj(c)
28
QString name() const { return "Linux Directory Notification"; }
29
QString shortname() const { return "dnotify"; }
34
"#define _GNU_SOURCE\n"
35
"#include<unistd.h>\n"
37
"#include<signal.h>\n"
38
"#include<sys/utsname.h>\n"
42
" DN_DELETE|DN_CREATE|DN_RENAME|DN_MULTISHOT|DN_MODIFY|DN_ATTRIB;\n"
47
f = fopen("ftest.c", "w");
50
fwrite(fdata, strlen(fdata), 1, f);
58
QString str = conf->qvar("QMAKE_CC") + " -c ftest.c -o ftest.o";
59
int r = conf->doCommand(str);
69
bool supports_dnotify = true; // not guilty until proven guilty
71
int major, minor, patch;
73
supports_dnotify = false; // *shrug*
74
else if(sscanf(uts.release, "%d.%d.%d", &major, &minor, &patch) != 3)
75
supports_dnotify = false; // *shrug*
76
else if( major * 1000000 + minor * 1000 + patch < 2004019 ) // <2.4.19
77
supports_dnotify = false;
86
conf->addDefine("HAVE_DNOTIFY");