Drop realpath() and fix breakage on Win32
# Checks for library functions.
AC_FUNC_VPRINTF
AC_FUNC_MMAP
-AC_CHECK_FUNCS([link mkstemp mkostemp _mktemp_s getopt getopt_long getprogname rand random lrand48 random_r rand_r realpath regcomp regerror regexec regfree fstatvfs fstatfs lstat])
+AC_CHECK_FUNCS([link mkstemp mkostemp _mktemp_s getopt getopt_long getprogname rand random lrand48 random_r rand_r regcomp regerror regexec regfree fstatvfs fstatfs lstat])
dnl AC_CHECK_FUNCS doesn't check for header files.
dnl posix_fadvise() may be not available in older libc.
prgname = FcStrdup (p);
}
+#elif defined (HAVE_GETPROGNAME)
+ const char *q = getprogname ();
+ if (q)
+ prgname = FcStrdup (q);
+ else
+ prgname = FcStrdup ("");
#else
char buf[PATH_MAX + 1];
unsigned int len;
char *p = NULL;
-#if defined (HAVE_GETPROGNAME) && defined (HAVE_REALPATH)
- const char *q = getprogname ();
- if (q)
- p = realpath (q, buf);
-#else
len = readlink ("/proc/self/exe", buf, sizeof (buf) - 1);
if (len > 0)
{
buf[len] = '\0';
p = buf;
}
-#endif
if (p)
{
if (!prgname)
prgname = FcStrdup ("");
+#endif
if (!fc_atomic_ptr_cmpexch (&default_prgname, NULL, prgname)) {
free (prgname);
goto retry;
}
-#endif
}
if (prgname && !prgname[0])