This fixes bug #253 "re2c should install unicode_categories.re somewhere"
(reported by Wesley W. Terpstra).
-# flags
-# do *not* add CXXFLAGS here, add them in configure.ac
+
+# stdlib directory
+stdlibdir = $(datadir)/re2c/stdlib
+
+# do not add compiler options/warnings here, add them in configure.ac
AM_CXXFLAGS = $(CXXFLAGSDEFAULT)
+AM_CXXFLAGS += -DRE2C_STDLIB_DIR='"$(stdlibdir)/"'
if DEBUG
AM_CXXFLAGS += -DRE2C_DEBUG
endif
+
RE2CFLAGS = -br -W
# binary
DOC = doc/re2c.1
man_MANS = $(DOC)
+# include files (stdlib)
+dist_stdlib_DATA = include/unicode_categories.re
+
EXTRA_DIST = \
$(re2c_BOOT) \
$(re2c_CUSTOM) \
autogen.sh \
genhelp.sh \
examples \
- include \
test
CLEANFILES = \
path = incpaths[i] + name;
file = fopen(path.c_str(), "rb");
}
+
+ // if user-defined include paths failed, try stdlib path
+ if (!file) {
+ path = RE2C_STDLIB_DIR + name;
+ file = fopen(path.c_str(), "rb");
+ }
}
if (!file) {