autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AC_PREFIX_PATH, AS_BASENAME fixes and a new test!


From: Paul Eggert
Subject: Re: AC_PREFIX_PATH, AS_BASENAME fixes and a new test!
Date: Mon, 17 Sep 2001 15:59:30 -0700 (PDT)

The AS_BASENAME fix doesn't seem complete to me.
AS_BASENAME should look like AS_DIRNAME, e.g. something like this:

        # AS_BASENAME(PATHNAME)
        # --------------------
        # Simulate running `basename(1)' on PATHNAME, not all systems have it.
        # Also see the comments for AS_DIRNAME.
        m4_defun([AS_BASENAME_EXPR],
        [m4_require([_AS_EXPR_PREPARE])dnl
        $as_expr X[]$1 : '.*/\([^/][^/]*\)/*$' \| \
                 X[]$1 : '\([^/][^/]*\)/*$' \|
                 X[]$1 : 'X\(//\)$' \| \
                 X[]$1 : 'X\(/\)/*$' \| \
                 .     : '\(.\)'])

        m4_defun([AS_BASENAME_SED],
        [echo X[]$1 | 
            sed ['???']])

        m4_defun([AS_BASENAME],
        [AS_BASENAME_EXPR([$1]) 2>/dev/null ||
        AS_BASENAME_SED([$1])])

except you need to fill in the '???'.

AS_BASENAME_SED should be to AS_BASENAME_EXPR
as AS_DIRNAME_SED is to AS_DIRNAME_EXPR.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]