+2003-07-01 Bruno Haible <bruno@clisp.org>
+
+ * config/install-reloc: Also compile readlink.c.
+
2003-06-19 Bruno Haible <bruno@clisp.org>
* PACKAGING: Add intmax.m4, longdouble.m4, longlong.m4,
# Compile wrapper.
installdir=`echo "$destprog" | sed -e 's,/[^/]*$,,'`
-func_verbose $compile_command -I"$builddir" -I"$srcdir" -I"$config_h_dir" -DHAVE_CONFIG_H -DNO_XMALLOC -D"INSTALLPREFIX=\"$prefix\"" -D"INSTALLDIR=\"$installdir\"" -D"LIBPATHVAR=\"$library_path_var\"" -D"LIBDIRS=$libdirs" "$srcdir"/relocwrapper.c "$srcdir"/progname.c "$srcdir"/progreloc.c "$srcdir"/xreadlink.c "$srcdir"/canonicalize.c "$srcdir"/relocatable.c "$srcdir"/setenv.c "$srcdir"/strerror.c -o $destprog.wrapper || exit $?
+func_verbose $compile_command -I"$builddir" -I"$srcdir" -I"$config_h_dir" -DHAVE_CONFIG_H -DNO_XMALLOC -D"INSTALLPREFIX=\"$prefix\"" -D"INSTALLDIR=\"$installdir\"" -D"LIBPATHVAR=\"$library_path_var\"" -D"LIBDIRS=$libdirs" "$srcdir"/relocwrapper.c "$srcdir"/progname.c "$srcdir"/progreloc.c "$srcdir"/xreadlink.c "$srcdir"/readlink.c "$srcdir"/canonicalize.c "$srcdir"/relocatable.c "$srcdir"/setenv.c "$srcdir"/strerror.c -o $destprog.wrapper || exit $?
# Rename $destprog.wrapper -> $destprog -> $destprog.bin.
ln -f $destprog $destprog.bin || exit 1
+2003-07-01 Bruno Haible <bruno@clisp.org>
+
+ * configure.ac: Invoke gl_FUNC_READLINK.
+
2003-06-19 Bruno Haible <bruno@clisp.org>
* Makefile.am (config.h_vms, config.h.msvc): Update.
jm_FUNC_GLIBC_UNLOCKED_IO
gt_FUNC_ERROR_AT_LINE
gl_PATHMAX
+gl_FUNC_READLINK
gl_XREADLINK
gl_CANONICALIZE
+2003-07-01 Bruno Haible <bruno@clisp.org>
+
+ * readlink.c: New file, trivial link to ../../gettext-tools/lib.
+ * Makefile.am (LIBADD_SOURCE): Add readlink.c.
+
2003-07-01 Bruno Haible <bruno@clisp.org>
* Makefile.am (EXTRA_DIST, stdbool.h): Use stdbool_.h instead of
alloca.c \
../../gettext-tools/lib/canonicalize.h canonicalize.c \
memmove.c \
+ readlink.c \
../../gettext-tools/lib/relocatable.h relocatable.c \
../../gettext-tools/lib/setenv.h setenv.c unsetenv.c \
strerror.c
--- /dev/null
+#include "../../gettext-tools/lib/readlink.c"
+2003-07-01 Bruno Haible <bruno@clisp.org>
+
+ * configure.ac: Invoke gl_FUNC_READLINK.
+
2003-07-01 Bruno Haible <bruno@clisp.org>
* Makefile.am (windows/stdbool.h): Use stdbool_.h instead of
jm_FUNC_GLIBC_UNLOCKED_IO
gt_FUNC_ERROR_AT_LINE
gl_PATHMAX
+gl_FUNC_READLINK
gl_XREADLINK
gl_CANONICALIZE
gt_SETLOCALE
+2003-07-01 Bruno Haible <bruno@clisp.org>
+
+ * readlink.c: New file, from gnulib.
+ * Makefile.am (LIBADD_SOURCE): Add it.
+
2003-07-01 Bruno Haible <bruno@clisp.org>
* Makefile.am (EXTRA_DIST, stdbool.h): Use stdbool_.h instead of
memset.c \
mkdtemp.h mkdtemp.c \
pfnmatch.h pfnmatch.c \
+ readlink.c \
relocatable.h relocatable.c \
setenv.h setenv.c unsetenv.c \
stpcpy.h stpcpy.c \
--- /dev/null
+/* Stub for readlink().
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#if !HAVE_READLINK
+
+/* readlink() substitute for systems that don't have a readlink() function,
+ such as DJGPP 2.03 and mingw32. */
+
+/* The official POSIX return type of readlink() is ssize_t, but since here
+ we have no declaration in a public header file, we use 'int' as return
+ type. */
+
+int
+readlink (const char *path, char *buf, size_t bufsize)
+{
+ struct stat statbuf;
+
+ /* In general we should use lstat() here, not stat(). But on platforms
+ without symbolic links lstat() - if it exists - would be equivalent to
+ stat(), therefore we can use stat(). This saves us a configure check. */
+ if (stat (path, &statbuf) >= 0)
+ errno = EINVAL;
+ return -1;
+}
+
+#endif
-> progname
-> progreloc
-> xreadlink
+ -> readlink
-> canonicalize
-> relocatable
-> setenv
mkdtemp.m4 \
onceonly.m4 \
pathmax.m4 \
+readlink.m4 \
relocatable.m4 \
setenv.m4 \
setlocale.m4 \
--- /dev/null
+# readlink.m4 serial 1
+dnl Copyright (C) 2003 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License. As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+AC_DEFUN([gl_FUNC_READLINK],
+[
+ AC_CHECK_FUNCS(readlink)
+ if test $ac_cv_func_readlink = no; then
+ AC_LIBOBJ(readlink)
+ gl_PREREQ_READLINK
+ fi
+])
+
+# Prerequisites of lib/readlink.c.
+AC_DEFUN([gl_PREREQ_READLINE],
+[
+ :
+])