X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=m4%2Fdirname.m4;h=4252b62e3a5df7c609bf389026d586eed501379d;hb=87f8903d4b15b30b6b3da2c0632fef3e626129fd;hp=48ecd009ef0d22a835421cfc4a2ceb2f71d5d0b6;hpb=e75f5a624421fe98932ce123a300bc463aa44bc2;p=gnulib.git diff --git a/m4/dirname.m4 b/m4/dirname.m4 index 48ecd009e..4252b62e3 100644 --- a/m4/dirname.m4 +++ b/m4/dirname.m4 @@ -1,27 +1,26 @@ -#serial 1 +#serial 8 -*- autoconf -*- +dnl Copyright (C) 2002-2006, 2009 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. -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. - ) - ]) +AC_DEFUN([gl_DIRNAME], +[ + AC_REQUIRE([gl_DIRNAME_LGPL]) + AC_LIBOBJ([basename]) + AC_LIBOBJ([dirname]) +]) + +AC_DEFUN([gl_DIRNAME_LGPL], +[ + AC_LIBOBJ([basename-lgpl]) + AC_LIBOBJ([dirname-lgpl]) + AC_LIBOBJ([stripslash]) + + dnl Prerequisites of lib/dirname.h. + AC_REQUIRE([gl_AC_DOS]) + AC_REQUIRE([gl_DOUBLE_SLASH_ROOT]) - if test $jm_cv_func_working_dirname = no; then - LIBOBJS="$LIBOBJS dirname.o" - AC_SUBST(LIBOBJS)dnl - fi + dnl No prerequisites of lib/basename-lgpl.c, lib/dirname-lgpl.c, + dnl lib/stripslash.c. ])