X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fabsolute-header.m4;h=89ff5beb65fe8c4824b5087a813cf570ee647368;hb=da8054d48dc22e1c051db54049e005d51a006e69;hp=b7276a3b2bc55eb2553873342c9677cf2c0b33ef;hpb=caa70a3d343f8adb6385d3da8a3c4f5ab0333ea7;p=gnulib.git diff --git a/m4/absolute-header.m4 b/m4/absolute-header.m4 index b7276a3b2..89ff5beb6 100644 --- a/m4/absolute-header.m4 +++ b/m4/absolute-header.m4 @@ -1,5 +1,5 @@ -# absolute-header.m4 serial 15 -dnl Copyright (C) 2006-2011 Free Software Foundation, Inc. +# absolute-header.m4 serial 16 +dnl Copyright (C) 2006-2013 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. @@ -10,12 +10,12 @@ dnl From Derek Price. # --------------------------------------- # Find the absolute name of a header file, testing first if the header exists. # If the header were sys/inttypes.h, this macro would define -# ABSOLUTE_SYS_INTTYPES_H to the `""' quoted absolute name of sys/inttypes.h +# ABSOLUTE_SYS_INTTYPES_H to the '""' quoted absolute name of sys/inttypes.h # in config.h -# (e.g. `#define ABSOLUTE_SYS_INTTYPES_H "///usr/include/sys/inttypes.h"'). +# (e.g. '#define ABSOLUTE_SYS_INTTYPES_H "///usr/include/sys/inttypes.h"'). # The three "///" are to pacify Sun C 5.8, which otherwise would say # "warning: #include of /usr/include/... may be non-portable". -# Use `""', not `<>', so that the /// cannot be confused with a C99 comment. +# Use '""', not '<>', so that the /// cannot be confused with a C99 comment. # Note: This macro assumes that the header file is not empty after # preprocessing, i.e. it does not only define preprocessor macros but also # provides some type/enum definitions or function/variable declarations. @@ -78,11 +78,16 @@ changequote(,) gl_dirsep_regex='[/\\]' ;; *) - gl_dirsep_regex='/' + gl_dirsep_regex='\/' ;; esac - gl_absolute_header_sed='\|'"${gl_dirsep_regex}"'$1|{ - s|.*"\(.*'"${gl_dirsep_regex}"'$1\)".*|\1| + dnl A sed expression that turns a string into a basic regular + dnl expression, for use within "/.../". + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo '$1' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ s|^/[^/]|//&| p q