bug-gnulib
[Top][All Lists]
Advanced

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

making gl_FULL_HEADER_PATH more reusable


From: Bruno Haible
Subject: making gl_FULL_HEADER_PATH more reusable
Date: Tue, 2 May 2006 16:36:36 +0200
User-agent: KMail/1.5

Hi,

The gl_FULL_HEADER_PATH can also be useful when include_next works, such as
  - to create modified copies of system include files (like fixincludes does),
  - to test whether an include file (e.g. <iconv.h>) comes from the system
    or from a third party, even if the file does not define specific macros
    that testify the third party. (Grepping the header file for the copyright
    notice, or similar.)

Here is a patch to make it usable for these situations. Opinions, objections?


2006-05-01  Bruno Haible  <address@hidden>

        * full-header-path.m4 (gl_FULL_HEADER_PATH): Move the include_next
        test from here...
        * _inttypes_h.m4 (gl_INTTYPES_H): ... to here.

*** gnulib-20060430/m4/full-header-path.m4      2006-04-19 18:47:17.000000000 
+0200
--- gnulib-20060430-modified/m4/full-header-path.m4     2006-05-01 
21:17:51.000000000 +0200
***************
*** 1,4 ****
! # full-header-path.m4 serial 1
  dnl Copyright (C) 2006 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
--- 1,4 ----
! # full-header-path.m4 serial 2
  dnl Copyright (C) 2006 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
***************
*** 8,23 ****
  
  # gl_FULL_HEADER_PATH(HEADER1 HEADER2 ...)
  # ----------------------------------------
! # Find the full path to a header file, when the #include_next directive
! # doesn't work and the header exists in the first place.  If the header were
! # sys/inttypes.h (and it existed and #include_next didn't work), this macro
! # would define FULL_PATH_SYS_INTTYPES_H to the `<>' quoted full path to
! # sys/inttypes.h in config.h
  # (e.g. `#define FULL_PATH_SYS_INTTYPES_H </usr/include/sys/inttypes.h>').
  AC_DEFUN([gl_FULL_HEADER_PATH],
  [AC_LANG_PREPROC_REQUIRE()dnl
- AC_REQUIRE([gl_INCLUDE_NEXT])dnl
- if test $gl_cv_have_include_next = no; then
  AC_FOREACH([gl_HEADER_NAME], [$1],
    [AS_VAR_PUSHDEF([gl_full_header_path],
                    [gl_cv_full_path_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl
--- 8,20 ----
  
  # gl_FULL_HEADER_PATH(HEADER1 HEADER2 ...)
  # ----------------------------------------
! # Find the full path to a header file, assuming the header exists.
! # If the header were sys/inttypes.h, this macro would define
! # FULL_PATH_SYS_INTTYPES_H to the `<>' quoted full path to sys/inttypes.h
! # in config.h
  # (e.g. `#define FULL_PATH_SYS_INTTYPES_H </usr/include/sys/inttypes.h>').
  AC_DEFUN([gl_FULL_HEADER_PATH],
  [AC_LANG_PREPROC_REQUIRE()dnl
  AC_FOREACH([gl_HEADER_NAME], [$1],
    [AS_VAR_PUSHDEF([gl_full_header_path],
                    [gl_cv_full_path_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl
***************
*** 41,45 ****
                       [Define this to the full path to 
<]m4_quote(m4_defn([gl_HEADER_NAME]))[>.])
    AS_VAR_POPDEF([gl_full_header_path])dnl
  ])dnl
- fi
  ])# gl_FULL_HEADER_PATH
--- 38,41 ----
*** gnulib-20060430/m4/_inttypes_h.m4   2006-04-18 19:20:47.000000000 +0200
--- gnulib-20060430-modified/m4/_inttypes_h.m4  2006-05-01 21:17:49.000000000 
+0200
***************
*** 1,4 ****
! # _inttypes_h.m4 serial 1
  dnl Copyright (C) 2006 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
--- 1,4 ----
! # _inttypes_h.m4 serial 2
  dnl Copyright (C) 2006 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
***************
*** 7,13 ****
  dnl From Derek Price.
  
  AC_DEFUN([gl_INTTYPES_H],
! [AC_LIBSOURCES([inttypes.h])
! gl_FULL_HEADER_PATH([inttypes.h])
  AC_CHECK_DECLS_ONCE([strtoimax strtoumax])dnl
  ])
--- 7,16 ----
  dnl From Derek Price.
  
  AC_DEFUN([gl_INTTYPES_H],
! [AC_REQUIRE([gl_INCLUDE_NEXT])dnl
! AC_LIBSOURCES([inttypes.h])
! if test $gl_cv_have_include_next = no; then
!   gl_FULL_HEADER_PATH([inttypes.h])
! fi
  AC_CHECK_DECLS_ONCE([strtoimax strtoumax])dnl
  ])





reply via email to

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