diff options
author | Jim Meyering <jim@meyering.net> | 1998-12-07 05:54:29 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1998-12-07 05:54:29 +0000 |
commit | 572632b8eba216a81ffed9379b5026d09c8add73 (patch) | |
tree | 73dfd3e624a03f621cff4cead9eb4c0ad6588264 /m4 | |
parent | a467be8ae83c598457570f4cac704f0079b73a03 (diff) | |
download | coreutils-572632b8eba216a81ffed9379b5026d09c8add73.tar.xz |
*** empty log message ***
Diffstat (limited to 'm4')
-rw-r--r-- | m4/dirname.m4 | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/m4/dirname.m4 b/m4/dirname.m4 new file mode 100644 index 000000000..48ecd009e --- /dev/null +++ b/m4/dirname.m4 @@ -0,0 +1,27 @@ +#serial 1 + +dnl See if the dirname function modifies its argument. +dnl We can't just do AC_REPLACE_FUNCS(dirname) because some systems +dnl (e.g., X/Open) have a function by that name that modifies and returns +dnl its argument. +AC_DEFUN(jm_FUNC_DIRNAME, +[dnl + AC_CACHE_CHECK([for working dirname function], jm_cv_func_working_dirname, + [AC_TRY_RUN([ + int main () + { + const char *path = "a/b"; + char *dir = dirname (path); + exit ((dir != path && *dir == 'a' && dir[1] == 0) ? 0 : 1); + } + ], jm_cv_func_working_dirname=yes dnl The library version works. + , jm_cv_func_working_dirname=no dnl The library version does NOT work. + , jm_cv_func_working_dirname=no dnl We're cross compiling. + ) + ]) + + if test $jm_cv_func_working_dirname = no; then + LIBOBJS="$LIBOBJS dirname.o" + AC_SUBST(LIBOBJS)dnl + fi +]) |