setenv.c if at least of these is undefined. [pullup from
krb5-1-2-2-branch]
* setenv.c: Add conditionals for compilation of setenv, unsetenv,
and getenv such that they only get compiled if they don't already
exist. [pullup from krb5-1-2-2-branch]
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13140
dc483132-0cff-0310-8789-
dd5450dbe970
+2001-04-03 Tom Yu <tlyu@mit.edu>
+
+ * configure.in: Check for setenv, unsetenv, and getenv. Compile
+ setenv.c if at least of these is undefined. [pullup from
+ krb5-1-2-2-branch]
+
+ * setenv.c: Add conditionals for compilation of setenv, unsetenv,
+ and getenv such that they only get compiled if they don't already
+ exist. [pullup from krb5-1-2-2-branch]
+
2000-11-01 Ezra Peisach <epeisach@mit.edu>
* configure.in: Use AC_C_CONST instead of AC_CONST.
AC_PROG_ARCHIVE
AC_PROG_ARCHIVE_ADD
AC_PROG_RANLIB
-AC_REPLACE_FUNCS([strcasecmp strdup setenv setsid strerror strftime getopt herror parsetos])
-AC_CHECK_FUNCS(gettosbyname cgetent)
+AC_REPLACE_FUNCS([strcasecmp strdup setsid strerror strftime getopt herror parsetos])
+AC_CHECK_FUNCS(setenv unsetenv getenv gettosbyname cgetent)
AC_CHECK_HEADERS(stdlib.h string.h)
LIBOBJS="$LIBOBJS getent.o"
+if test $ac_cv_func_setenv = no || test $ac_cv_func_unsetenv = no \
+ || test $ac_cv_func_getenv = no; then
+ LIBOBJS="$LIBOBJS setenv.o"
+fi
AC_C_CONST
if test "$KRB4_LIB" = ''; then
AC_MSG_RESULT(No Kerberos 4 authentication)
* Set the value of the environmental variable "name" to be
* "value". If rewrite is set, replace any current value.
*/
+#ifndef HAVE_SETENV
setenv(name, value, rewrite)
register const char *name;
register const char *value;
for (*c++ = '='; *c++ = *value++;);
return (0);
}
+#endif
/*
* unsetenv(name) --
* Delete environmental variable "name".
*/
+#ifndef HAVE_UNSETENV
void
unsetenv(name)
const char *name;
if (!(*p = *(p + 1)))
break;
}
+#endif
/*
* getenv --
* Returns ptr to value associated with name, if any, else NULL.
*/
+#ifndef HAVE_GETENV
char *
getenv(name)
const char *name;
return (__findenv(name, &offset));
}
+#endif
/*
* __findenv --