Skip to content
Browse files

- Made 'make install' install config.h (into $PREFIX/include/pire);

- Prefixed all definitions in config.h with PIRE_ to avoid name
  collisions.
  • Loading branch information...
1 parent f1342c1 commit 48883872cdb30df59448103ed966099303aa49b1 @dprokoptsev dprokoptsev committed
Showing with 9 additions and 6 deletions.
  1. +1 −0 Makefile.am
  2. +2 −1 configure.ac
  3. +2 −0 pire/Makefile.am
  4. +3 −1 pire/defs.h
  5. +1 −4 pire/scanners/common.h
View
1 Makefile.am
@@ -1,2 +1,3 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = pire tests pkg samples tools
+CONFIG_CLEAN_FILES = pire/config.h
View
3 configure.ac
@@ -2,7 +2,7 @@ AC_PREREQ([2.60])
AC_INIT([pire], [0.0.4], [dprokoptsev@yandex-team.ru])
AM_INIT_AUTOMAKE([foreign -Wall])
AC_CONFIG_SRCDIR([pire/classes.cpp])
-AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_HEADERS([config.h.in])
AC_CONFIG_MACRO_DIR([m4])
AC_LANG_CPLUSPLUS
@@ -50,4 +50,5 @@ AC_CONFIG_FILES([
samples/blacklist/Makefile
samples/pigrep/Makefile
])
+AC_OUTPUT_COMMANDS([sed 's/#define \([A-Z]\)/#define PIRE_\1/' < config.h.in > pire/config.h])
AC_OUTPUT
View
2 pire/Makefile.am
@@ -80,6 +80,8 @@ pire_hdr_HEADERS = \
platform.h \
vbitset.h
+nodist_pire_hdr_HEADERS = config.h
+
if ENABLE_EXTRA
pire_extradir = $(includedir)/pire/extra
pire_extra_HEADERS = \
View
4 pire/defs.h
@@ -24,6 +24,8 @@
#ifndef PIRE_DEFS_H
#define PIRE_DEFS_H
+#include <pire/config.h>
+
namespace Pire {
#ifdef PIRE_DEBUG
@@ -51,7 +53,7 @@ namespace Pire {
using namespace SpecialChar;
namespace Impl {
-#ifndef WORDS_BIGENDIAN
+#ifndef PIRE_WORDS_BIGENDIAN
inline size_t ToLittleEndian(size_t val) { return val; }
#else
#error TODO: Please implement Pire::Impl::ToLittleEndian()
View
5 pire/scanners/common.h
@@ -24,15 +24,12 @@
#define PIRE_SCANNERS_COMMON_H_INCLUDED
#include <stdlib.h>
+#include <pire/config.h>
#include "../align.h"
#include "../stub/defaults.h"
#include "../defs.h"
#include "../platform.h"
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
namespace Pire {
struct Header {

0 comments on commit 4888387

Please sign in to comment.
Something went wrong with that request. Please try again.