changes for build on Androd by Emmanuel Maillard

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36364 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2013-03-16 05:25:49 +00:00
parent a189d0a06e
commit 7847a7dd4d
5 changed files with 101 additions and 11 deletions

View file

@ -1,3 +1,11 @@
2012-03-16 Emmanuel Maillard <mailing-lists@e-maillard.com>
* configure.ac: checks for pthread library and password structure
* Headers/GNUstepBase/config.h.in: new define for password field
* Source/NSPathUtilities.m: use new define
* configure: regenerate
Changes for Android build
2012-03-12 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSPrivate.h: Change hash function args and add new functions

View file

@ -455,6 +455,9 @@
/* Define to 1 if you have the <pwd.h> header file. */
#undef HAVE_PWD_H
/* Define if you have pw_gecos field in struct passwd */
#undef HAVE_PW_GECOS_IN_PASSWD
/* Define to 1 if you have the `readlink' function. */
#undef HAVE_READLINK
@ -754,9 +757,6 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION

View file

@ -1808,6 +1808,7 @@ NSFullUserName(void)
#else
#ifdef HAVE_PWD_H
#if defined(HAVE_GETPWNAM_R)
#if defined(HAVE_PW_GECOS_IN_PASSWD)
struct passwd pw;
struct passwd *p;
char buf[BUFSIZ*10];
@ -1819,8 +1820,10 @@ NSFullUserName(void)
userName = [NSString stringWithUTF8String: pw.pw_gecos];
}
}
#endif /* HAVE_PW_GECOS_IN_PASSWD */
#else
#if defined(HAVE_GETPWNAM)
#if defined(HAVE_PW_GECOS_IN_PASSWD)
struct passwd *pw;
[gnustep_global_lock lock];
@ -1830,6 +1833,7 @@ NSFullUserName(void)
userName = [NSString stringWithUTF8String: pw->pw_gecos];
}
[gnustep_global_lock lock];
#endif /* HAVE_PW_GECOS_IN_PASSWD */
#endif /* HAVE_GETPWNAM */
#endif /* HAVE_GETPWNAM_R */
#endif /* HAVE_PWD_H */

71
configure vendored
View file

@ -12749,11 +12749,12 @@ else
fi
ismingw=no
isqnx=no
checkinlibc=no
case "$target_os" in
mingw*) ismingw=yes;;
nto*) isqnx=yes;;
qnx*) isqnx=yes;;
nto*) checkinlibc=yes;;
qnx*) checkinlibc=yes;;
*android*) checkinlibc=yes;;
esac
if test $pthread_ok = yes ; then
LIBS="$LIBS -lpthread"
@ -12834,7 +12835,8 @@ fi
LIBS="$LIBS -lpthreadGC2"
fi
fi
if test $isqnx = yes ; then
# Android and QNX have pthread in libc instead of libpthread
if test $checkinlibc = yes ; then
{ $as_echo "$as_me:$LINENO: checking for pthread_join in -lc" >&5
$as_echo_n "checking for pthread_join in -lc... " >&6; }
if test "${ac_cv_lib_c_pthread_join+set}" = set; then
@ -15752,6 +15754,67 @@ done
LIBS="$saved_LIBS"
{ $as_echo "$as_me:$LINENO: checking for pw_gecos field in struct passwd" >&5
$as_echo_n "checking for pw_gecos field in struct passwd... " >&6; }
if test "${ac_cv_have_pw_gecos_in_struct_passwd+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <pwd.h>
int
main ()
{
struct passwd p; p.pw_gecos = 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_have_pw_gecos_in_struct_passwd="yes"
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_have_pw_gecos_in_struct_passwd="no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_pw_gecos_in_struct_passwd" >&5
$as_echo "$ac_cv_have_pw_gecos_in_struct_passwd" >&6; }
if test "x$ac_cv_have_pw_gecos_in_struct_passwd" = "xyes" ; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_PW_GECOS_IN_PASSWD 1
_ACEOF
fi
#--------------------------------------------------------------------
# These two headers (functions) needed by Time.m
#--------------------------------------------------------------------

View file

@ -1669,11 +1669,12 @@ else
fi
AC_CHECK_LIB(pthread, pthread_join, pthread_ok=yes, pthread_ok=no)
ismingw=no
isqnx=no
checkinlibc=no
case "$target_os" in
mingw*) ismingw=yes;;
nto*) isqnx=yes;;
qnx*) isqnx=yes;;
nto*) checkinlibc=yes;;
qnx*) checkinlibc=yes;;
*android*) checkinlibc=yes;;
esac
if test $pthread_ok = yes ; then
LIBS="$LIBS -lpthread"
@ -1684,7 +1685,8 @@ else
LIBS="$LIBS -lpthreadGC2"
fi
fi
if test $isqnx = yes ; then
# Android and QNX have pthread in libc instead of libpthread
if test $checkinlibc = yes ; then
AC_CHECK_LIB(c, pthread_join, pthread_ok=yes, pthread_ok=no)
if test $pthread_ok = yes ; then
LIBS="$LIBS -lc"
@ -2079,6 +2081,19 @@ AC_CHECK_LIB(m, main)
AC_CHECK_FUNCS(statvfs link symlink readlink geteuid getlogin getpwnam getpwnam_r getpwuid getpwuid_r getgrgid getgrgid_r getgrnam getgrnam_r rint getopt)
LIBS="$saved_LIBS"
AC_CACHE_CHECK([for pw_gecos field in struct passwd],
ac_cv_have_pw_gecos_in_struct_passwd, [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <pwd.h> ]],
[[ struct passwd p; p.pw_gecos = 0; ]])],
[ ac_cv_have_pw_gecos_in_struct_passwd="yes" ],
[ ac_cv_have_pw_gecos_in_struct_passwd="no"
])
])
if test "x$ac_cv_have_pw_gecos_in_struct_passwd" = "xyes" ; then
AC_DEFINE([HAVE_PW_GECOS_IN_PASSWD], [1],
[Define if you have pw_gecos field in struct passwd])
fi
#--------------------------------------------------------------------
# These two headers (functions) needed by Time.m
#--------------------------------------------------------------------