VirtualBox

source: kBuild/vendor/grep/2.12/m4/symlink.m4@ 3627

Last change on this file since 3627 was 2595, checked in by bird, 13 years ago

gnu grep version 2.12 (grep-2.12.tar.xz, md5sum=8d2f0346d08b13c18afb81f0e8aa1e2f)

File size: 1.5 KB
Line 
1# serial 5
2# See if we need to provide symlink replacement.
3
4dnl Copyright (C) 2009-2012 Free Software Foundation, Inc.
5dnl This file is free software; the Free Software Foundation
6dnl gives unlimited permission to copy and/or distribute it,
7dnl with or without modifications, as long as this notice is preserved.
8
9# Written by Eric Blake.
10
11AC_DEFUN([gl_FUNC_SYMLINK],
12[
13 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
14 AC_CHECK_FUNCS_ONCE([symlink])
15 dnl The best we can do on mingw is provide a dummy that always fails, so
16 dnl that compilation can proceed with fewer ifdefs. On FreeBSD 7.2, AIX 7.1,
17 dnl and Solaris 9, we want to fix a bug with trailing slash handling.
18 if test $ac_cv_func_symlink = no; then
19 HAVE_SYMLINK=0
20 else
21 AC_CACHE_CHECK([whether symlink handles trailing slash correctly],
22 [gl_cv_func_symlink_works],
23 [AC_RUN_IFELSE(
24 [AC_LANG_PROGRAM(
25 [[#include <unistd.h>
26 ]],
27 [[int result = 0;
28 if (!symlink ("a", "conftest.link/"))
29 result |= 1;
30 if (symlink ("conftest.f", "conftest.lnk2"))
31 result |= 2;
32 else if (!symlink ("a", "conftest.lnk2/"))
33 result |= 4;
34 return result;
35 ]])],
36 [gl_cv_func_symlink_works=yes], [gl_cv_func_symlink_works=no],
37 [gl_cv_func_symlink_works="guessing no"])
38 rm -f conftest.f conftest.link conftest.lnk2])
39 if test "$gl_cv_func_symlink_works" != yes; then
40 REPLACE_SYMLINK=1
41 fi
42 fi
43])
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette