*** ./src/fcstat.c.ORIG Wed Aug 29 14:42:20 2012 --- ./src/fcstat.c Wed Aug 29 14:40:21 2012 *************** *** 36,41 **** --- 36,44 ---- #ifdef HAVE_SYS_STATFS_H #include #endif + #ifdef _AIX + #include + #endif #ifdef HAVE_SYS_PARAM_H #include #endif *** ./src/fccompat.c.ORIG Tue Nov 5 19:21:06 2013 --- ./src/fccompat.c Tue Nov 5 19:23:22 2013 *************** *** 161,183 **** return fd; } int32_t FcRandom(void) { int32_t result; #if HAVE_RANDOM_R static struct random_data fcrandbuf; static char statebuf[256]; static FcBool initialized = FcFalse; if (initialized != FcTrue) { ! initstate_r(time(NULL), statebuf, 256, &fcrandbuf); initialized = FcTrue; } ! random_r(&fcrandbuf, &result); #elif HAVE_RANDOM static char statebuf[256]; char *state; --- 161,195 ---- return fd; } + + /* + * random_r() is implemented differently on AIX than on Linux: + * Please check out this posting for details: + * http://lists.gnu.org/archive/html/bug-gnulib/2012-01/msg00215.html + */ + int32_t FcRandom(void) { + #ifdef _AIX + long result; + #else int32_t result; + #endif #if HAVE_RANDOM_R static struct random_data fcrandbuf; static char statebuf[256]; + static char *randP; static FcBool initialized = FcFalse; if (initialized != FcTrue) { ! initstate_r(time(NULL), statebuf, 256, &randP, &fcrandbuf); initialized = FcTrue; } ! random_r(&result, &fcrandbuf); #elif HAVE_RANDOM static char statebuf[256]; char *state; *** ./test/test-migration.c.ORIG Tue May 24 18:21:16 2016 --- ./test/test-migration.c Tue May 24 18:25:53 2016 *************** *** 6,11 **** --- 6,22 ---- #include #include + #ifdef _AIX + char * + mkdtemp (char *template) + { + if (!mktemp (template) || mkdir (template, 0700)) + return NULL; + + return template; + } + #endif + FcBool mkdir_p(const char *dir) { *************** *** 36,41 **** --- 47,55 ---- size_t len = strlen (dir); char *n = NULL; FcBool ret = FcTrue; + #ifndef HAVE_STRUCT_DIRENT_D_TYPE + struct stat statb; + #endif if (!d) return FcFalse; *************** *** 53,59 **** --- 67,83 ---- strcpy (n, dir); n[len] = '/'; strcpy (&n[len + 1], e->d_name); + #ifdef HAVE_STRUCT_DIRENT_D_TYPE if (e->d_type == DT_DIR) + #else + if (stat (n, &statb) == -1) + { + fprintf (stderr, "E: %s\n", n); + ret = FcFalse; + break; + } + if (S_ISDIR (statb.st_mode)) + #endif { if (!unlink_dirs (n)) {