diff --git a/SConstruct b/SConstruct index 422efe6..c46c090 100644 --- a/SConstruct +++ b/SConstruct @@ -28,6 +28,8 @@ if 'DESTDIR' in env: env['libpath'] = calcInstallPath("$prefix", "lib") env['incpath'] = calcInstallPath("$prefix", "include", "hammer") +env['parsersincpath'] = calcInstallPath("$prefix", "include", "hammer", "parsers") +env['backendsincpath'] = calcInstallPath("$prefix", "include", "hammer", "backends") env['pkgconfigpath'] = calcInstallPath("$prefix", "lib", "pkgconfig") env.ScanReplace('libhammer.pc.in') @@ -35,6 +37,7 @@ env.MergeFlags("-std=gnu99 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-attr if not env['PLATFORM'] == 'darwin': env.MergeFlags("-lrt") + env.Append(SHLINKFLAGS = ['-install_name ' + '$TARGET']) AddOption("--variant", dest="variant", @@ -90,4 +93,6 @@ env.Command('test', 'build/$VARIANT/src/test_suite', 'env LD_LIBRARY_PATH=build/ env.Alias("install", "$libpath") env.Alias("install", "$incpath") +env.Alias("install", "$parsersincpath") +env.Alias("install", "$backendsincpath") env.Alias("install", "$pkgconfigpath") diff --git a/src/SConscript b/src/SConscript index a06244b..1d9ca76 100644 --- a/src/SConscript +++ b/src/SConscript @@ -6,7 +6,17 @@ bindings = [] dist_headers = [ "hammer.h", "allocator.h", - "glue.h" + "glue.h", + "internal.h" +] + +parsers_headers = [ + "parsers/parser_internal.h" +] + +backends_headers = [ + "backends/regex.h", + "backends/contextfree.h" ] parsers = ['parsers/%s.c'%s for s in @@ -64,6 +74,8 @@ libhammer_static = env.StaticLibrary('hammer', parsers + backends + misc_hammer_ env.Install("$libpath", [libhammer_static, libhammer_shared]) env.Install("$incpath", dist_headers) +env.Install("$parsersincpath", parsers_headers) +env.Install("$backendsincpath", backends_headers) env.Install("$pkgconfigpath", "../../../libhammer.pc") testenv = env.Clone() diff --git a/src/backends/contextfree.h b/src/backends/contextfree.h index b387e55..ab04ab5 100644 --- a/src/backends/contextfree.h +++ b/src/backends/contextfree.h @@ -1,3 +1,8 @@ +/* + * NOTE: This is an internal header and installed for use by extensions. The + * API is not guaranteed stable. +*/ + // This is an internal header; it provides macros to make desugaring cleaner. #include #include "../internal.h" diff --git a/src/backends/regex.h b/src/backends/regex.h index a84904d..4ea85a8 100644 --- a/src/backends/regex.h +++ b/src/backends/regex.h @@ -1,3 +1,8 @@ +/* + * NOTE: This is an internal header and installed for use by extensions. The + * API is not guaranteed stable. +*/ + // Internal defs #ifndef HAMMER_BACKEND_REGEX__H #define HAMMER_BACKEND_REGEX__H diff --git a/src/internal.h b/src/internal.h index c402da5..89cb380 100644 --- a/src/internal.h +++ b/src/internal.h @@ -15,6 +15,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/* + * NOTE: This is an internal header and installed for use by extensions. The + * API is not guaranteed stable. +*/ + #ifndef HAMMER_INTERNAL__H #define HAMMER_INTERNAL__H #include diff --git a/src/parsers/parser_internal.h b/src/parsers/parser_internal.h index aeb202b..ec97dd1 100644 --- a/src/parsers/parser_internal.h +++ b/src/parsers/parser_internal.h @@ -1,3 +1,8 @@ +/* + * NOTE: This is an internal header and installed for use by extensions. The + * API is not guaranteed stable. +*/ + #ifndef HAMMER_PARSE_INTERNAL__H #define HAMMER_PARSE_INTERNAL__H #include "../hammer.h"