summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2024-05-17 19:21:05 +0800
committerPo Lu <luangruo@yahoo.com>2024-05-17 19:21:29 +0800
commit1f08984a67c94e957bec7f8c59818b627a67427b (patch)
tree8bec1accc256c920c4dbed4c5e1d5912aea785f9 /configure.ac
parent6ca3a60db3427bc6aef08144c1524920ff3d9c4d (diff)
Port to certain Android environments with no GUI
* configure.ac (USER_FULL_NAME): Define to android_user_full_name only when a GUI system is being built. Otherwise, set to pw->pw_gecos or NULL consistently with the presence of pw->pw_gecos. * src/editfns.c (Fuser_full_name): Adjust to match. Accept NULL values from USER_FULL_NAME.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 11 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 626e09aad8a..cab9eedd6cf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2464,11 +2464,6 @@ AC_DEFINE_UNQUOTED([SYSTEM_TYPE], ["$SYSTEM_TYPE"],
[The type of system you are compiling for; sets 'system-type'.])
AC_SUBST([SYSTEM_TYPE])
-# Check for pw_gecos in struct passwd; this is known to be missing on
-# Android.
-
-AC_CHECK_MEMBERS([struct passwd.pw_gecos], [], [], [#include <pwd.h>])
-
pre_PKG_CONFIG_CFLAGS=$CFLAGS
pre_PKG_CONFIG_LIBS=$LIBS
@@ -2754,6 +2749,17 @@ AC_SUBST([ANDROID_BUILD_CFLAGS])
AC_SUBST([ANDROID_SHARED_USER_ID])
AC_SUBST([ANDROID_SHARED_USER_NAME])
+# Check for pw_gecos in struct passwd; this is known to be missing on
+# Android.
+
+AH_TEMPLATE([USER_FULL_NAME], [How to get a user's full name.])
+AC_CHECK_MEMBERS([struct passwd.pw_gecos], [], [], [#include <pwd.h>])
+AS_IF([test x"$REALLY_ANDROID" = "xyes"],
+ [AC_DEFINE([USER_FULL_NAME], [android_user_full_name (pw)])],
+ [AS_IF([test x"$ac_cv_member_struct_passwd_pw_gecos" = "xyes"],
+ [AC_DEFINE([USER_FULL_NAME], [pw->pw_gecos])],
+ [AC_DEFINE([USER_FULL_NAME], [NULL])])])
+
if test "${with_pgtk}" = "yes"; then
window_system=pgtk
fi
@@ -6460,9 +6466,6 @@ AC_SUBST([SEPCHAR])
dnl Everybody supports this, except MS-DOS.
AC_DEFINE([subprocesses], [1], [Define to enable asynchronous subprocesses.])
-AC_DEFINE([USER_FULL_NAME], [pw->pw_gecos], [How to get a user's full name.])
-
-
AC_DEFINE([DIRECTORY_SEP], ['/'],
[Character that separates directories in a file name.])