Mercurial > hg > octave-jordi > gnulib-hg
annotate m4/link.m4 @ 15009:2917eb19f982
truncl: Move AC_LIBOBJ invocations to module description.
* m4/truncl.m4 (gl_FUNC_TRUNCL): Move AC_LIBOBJ invocation from here...
* modules/truncl (configure.ac): ... to here.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sat, 21 May 2011 11:32:55 +0200 |
parents | 97fc9a21a8fb |
children | ff4e14f9c0be |
rev | line source |
---|---|
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
1 # link.m4 serial 5 |
14079
97fc9a21a8fb
maint: update almost all copyright ranges to include 2011
Jim Meyering <meyering@redhat.com>
parents:
13918
diff
changeset
|
2 dnl Copyright (C) 2009-2011 Free Software Foundation, Inc. |
11041 | 3 dnl This file is free software; the Free Software Foundation |
4 dnl gives unlimited permission to copy and/or distribute it, | |
5 dnl with or without modifications, as long as this notice is preserved. | |
6 | |
7 AC_DEFUN([gl_FUNC_LINK], | |
8 [ | |
9 AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) | |
10 AC_CHECK_FUNCS_ONCE([link]) | |
11 if test $ac_cv_func_link = no; then | |
12 HAVE_LINK=0 | |
13 AC_LIBOBJ([link]) | |
11981 | 14 else |
15 AC_CACHE_CHECK([whether link handles trailing slash correctly], | |
16 [gl_cv_func_link_works], | |
17 [touch conftest.a | |
12263 | 18 # Assume that if we have lstat, we can also check symlinks. |
19 if test $ac_cv_func_lstat = yes; then | |
20 ln -s conftest.a conftest.lnk | |
21 fi | |
11981 | 22 AC_RUN_IFELSE( |
23 [AC_LANG_PROGRAM( | |
24 [[#include <unistd.h> | |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
25 ]], |
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
26 [[int result = 0; |
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
27 if (!link ("conftest.a", "conftest.b/")) |
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
28 result |= 1; |
12263 | 29 #if HAVE_LSTAT |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
30 if (!link ("conftest.lnk/", "conftest.b")) |
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
31 result |= 2; |
12263 | 32 #endif |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
33 return result; |
12263 | 34 ]])], |
11981 | 35 [gl_cv_func_link_works=yes], [gl_cv_func_link_works=no], |
36 [gl_cv_func_link_works="guessing no"]) | |
12263 | 37 rm -f conftest.a conftest.b conftest.lnk]) |
12048 | 38 if test "$gl_cv_func_link_works" != yes; then |
11981 | 39 REPLACE_LINK=1 |
40 AC_LIBOBJ([link]) | |
41 fi | |
11041 | 42 fi |
43 ]) |