Changeset 3af3ca in git


Ignore:
Timestamp:
Oct 13, 2011, 4:24:47 PM (13 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '45e267b9942dec9429fe249ce3e5e44ab80a6a3a')
Children:
4df5bdf2bfc58ff557a17588fb30694405784655
Parents:
4f7f4469ecb607b0fb7ebb1896b92f388634d796
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-10-13 16:24:47+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 16:14:00+01:00
Message:
FIX: public factory config.h should have ifndef/define/endif guards!
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • factory/.gitignore

    r4f7f44 r3af3ca  
    1 _configs.sed
    21cplusplus
    32cplusplus.h
  • factory/Makefile.am

    r4f7f44 r3af3ca  
    330330##
    331331
    332 DISTCLEANFILES=_configs.sed factory_config.h
     332# DISTCLEANFILES=_configs.sed factory_config.h
  • factory/configure.ac

    r4f7f44 r3af3ca  
    2323
    2424# Add pre'prefixed config
    25 AX_PREFIX_CONFIG_H([factory_config.h], [__FACTORY], [config.h])
     25AX_PREFIX_CONFIG_H([config.h],[],[config.h])
    2626
    2727AC_PROG_YACC
  • factory/factoryconf.template

    r4f7f44 r3af3ca  
    2121/*MAKEHEADER*/
    2222#include "config.h"
    23 /* #include "factory_config.h" */
    2423
    2524/*MAKEHEADER*/
  • m4/ax_prefix_config_h.m4

    r4f7f44 r3af3ca  
    55# SYNOPSIS
    66#
    7 #   AX_PREFIX_CONFIG_H [(OUTPUT-HEADER [,PREFIX [,ORIG-HEADER]])]
     7#   AX_PREFIX_CONFIG_H (OUTPUT-HEADER, PREFIX [,ORIG-HEADER])
    88#
    99# DESCRIPTION
     
    2424#   Defaults:
    2525#
    26 #     OUTPUT-HEADER = $PACKAGE-config.h
    27 #     PREFIX = $PACKAGE
    2826#     ORIG-HEADER, from AM_CONFIG_HEADER(config.h)
    2927#
     
    3735#     AM_INIT_AUTOMAKE(testpkg, 0.1.1)    # makes #undef VERSION and PACKAGE
    3836#     AM_CONFIG_HEADER(config.h)          # prep config.h from config.h.in
    39 #     AX_PREFIX_CONFIG_H(mylib/_config.h) # prep mylib/_config.h from it..
     37#     AX_PREFIX_CONFIG_H(mylib/_config.h, TESTPKG_) # prep mylib/_config.h from it..
    4038#     AC_MEMORY_H                         # makes "#undef NEED_MEMORY_H"
    4139#     AC_C_CONST_H                        # makes "#undef const"
     
    4341#                                         # and also mylib/_config.h
    4442#
    45 #   if the argument to AX_PREFIX_CONFIG_H would have been omitted then the
    46 #   default outputfile would have been called simply "testpkg-config.h", but
    47 #   even under the name "mylib/_config.h" it contains prefix-defines like
     43#   outputfile called "mylib/_config.h" contains prefix-defines like
    4844#
    4945#     #ifndef TESTPKG_VERSION
     
    5349#     #define TESTPKG_NEED_MEMORY_H 1
    5450#     #endif
    55 #     #ifndef _testpkg_const
    56 #     #define _testpkg_const _const
     51#     #ifndef testpkg_const
     52#     #define testpkg_const _const
    5753#     #endif
    5854#
     
    7066#
    7167#     #include <mylib/_config.h>
    72 #     #ifndef _testpkg_const
    73 #     #define _testpkg_const const
    74 #     #endif
    75 #
    76 #   and then start using _testpkg_const in the header files. That is also a
     68#     #ifndef testpkg_const
     69#     #define testpkg_const const
     70#     #endif
     71#
     72#   and then start using testpkg_const in the header files. That is also a
    7773#   good thing to differentiate whether some library-user has starting to
    7874#   take up with a different compiler, so perhaps it could read something
     
    8480#     #include <mylib/_config.h>
    8581#     #endif
    86 #     #ifndef _testpkg_const
    87 #     #define _testpkg_const const
     82#     #ifndef testpkg_const
     83#     #define testpkg_const const
    8884#     #endif
    8985#
     
    134130m4_pushdef([_script],[conftest.prefix])dnl
    135131m4_pushdef([_symbol],[m4_cr_Letters[]m4_cr_digits[]_])dnl
     132
    136133_OUT=`echo ifelse($1, , $PACKAGE-config.h, $1)`
    137 _DEF=`echo _$_OUT | sed -e "y:m4_cr_letters:m4_cr_LETTERS[]:" -e "s/@<:@^m4_cr_Letters@:>@/_/g"`
    138 _PKG=`echo ifelse($2, , $PACKAGE, $2)`
    139 _LOW=`echo _$_PKG | sed -e "y:m4_cr_LETTERS-:m4_cr_letters[]_:"`
     134_PKG=`echo $2`
     135_LOW=`echo $_PKG | sed -e "y:m4_cr_LETTERS-:m4_cr_letters[]_:"`
    140136_UPP=`echo $_PKG | sed -e "y:m4_cr_letters-:m4_cr_LETTERS[]_:"  -e "/^@<:@m4_cr_digits@:>@/s/^/_/"`
    141137_INP=`echo "ifelse($3,,,$3)" | sed -e 's/ *//'`
     138_DEF=`echo "$_UPP $PACKAGE $_OUT" | sed -e "y:m4_cr_letters:m4_cr_LETTERS[]:" -e "s/@<:@^m4_cr_Letters@:>@/_/g"`
     139
    142140if test ".$_INP" = "."; then
    143141   for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue
     
    159157   esac
    160158fi
    161 if test -z "$_PKG" ; then
    162    AC_MSG_ERROR([no prefix for _PREFIX_PKG_CONFIG_H])
    163 else
     159#if test -z "$_PKG" ; then
     160#   AC_MSG_ERROR([no prefix for AX_PREFIX_PKG_CONFIG_H])
     161#else
    164162  if test ! -f "$_INP" ; then if test -f "$srcdir/$_INP" ; then
    165163     _INP="$srcdir/$_INP"
    166164  fi fi
    167   AC_MSG_NOTICE(creating $_OUT - prefix $_UPP for $_INP defines)
     165  AC_MSG_NOTICE([creating '$_OUT' - prefix '$_UPP' for '$_INP' defines])
    168166  if test -f $_INP ; then
    169     AS_ECHO(["s/^@%:@undef  *\\(@<:@m4_cr_LETTERS[]_@:>@\\)/@%:@undef $_UPP""_\\1/"]) > _script
    170     AS_ECHO(["s/^@%:@undef  *\\(@<:@m4_cr_letters@:>@\\)/@%:@undef $_LOW""_\\1/"]) >> _script
    171     AS_ECHO(["s/^@%:@def[]ine  *\\(@<:@m4_cr_LETTERS[]_@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_UPP""_\\1\\"]) >> _script
    172     AS_ECHO(["@%:@def[]ine $_UPP""_\\1\\2\\"]) >> _script
     167    AS_ECHO(["s/^@%:@undef  *\\(@<:@m4_cr_LETTERS[]_@:>@\\)/@%:@undef $_UPP""\\1/"]) > _script
     168    AS_ECHO(["s/^@%:@undef  *\\(@<:@m4_cr_letters@:>@\\)/@%:@undef $_LOW""\\1/"]) >> _script
     169    AS_ECHO(["s/^@%:@def[]ine  *\\(@<:@m4_cr_LETTERS[]_@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_UPP""\\1\\"]) >> _script
     170    AS_ECHO(["@%:@def[]ine $_UPP""\\1\\2\\"]) >> _script
    173171    AS_ECHO(["@%:@endif/"]) >> _script
    174     AS_ECHO(["s/^@%:@def[]ine  *\\(@<:@m4_cr_letters@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_LOW""_\\1\\"]) >> _script
    175     AS_ECHO(["@%:@define $_LOW""_\\1\\2\\"]) >> _script
     172    AS_ECHO(["s/^@%:@def[]ine  *\\(@<:@m4_cr_letters@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_LOW""\\1\\"]) >> _script
     173    AS_ECHO(["@%:@define $_LOW""\\1\\2\\"]) >> _script
    176174    AS_ECHO(["@%:@endif/"]) >> _script
    177175    # now executing _script on _DEF input to create _OUT output file
     
    194192    fi
    195193    cp _script _configs.sed
     194    rm _configs.sed
    196195  else
    197196    AC_MSG_ERROR([input file $_INP does not exist - skip generating $_OUT])
    198197  fi
    199198  rm -f conftest.*
    200 fi
     199#fi
    201200m4_popdef([_symbol])dnl
    202201m4_popdef([_script])dnl
Note: See TracChangeset for help on using the changeset viewer.