summaryrefslogtreecommitdiff
path: root/sofort/core
diff options
context:
space:
mode:
Diffstat (limited to 'sofort/core')
-rw-r--r--sofort/core/_flavor/flavor_app_frontend_disabled.mk6
-rw-r--r--sofort/core/_flavor/flavor_app_frontend_enabled.mk6
-rw-r--r--sofort/core/_flavor/flavor_app_linking_all_shared.mk7
-rw-r--r--sofort/core/_flavor/flavor_app_linking_all_static.mk7
-rw-r--r--sofort/core/_flavor/flavor_app_linking_default.mk7
-rw-r--r--sofort/core/_flavor/flavor_install_headers_custom.mk4
-rw-r--r--sofort/core/_flavor/flavor_install_headers_default.mk4
-rw-r--r--sofort/core/_flavor/flavor_shared_library_disabled.mk5
-rw-r--r--sofort/core/_flavor/flavor_shared_library_enabled.mk5
-rw-r--r--sofort/core/_flavor/flavor_static_library_disabled.mk5
-rw-r--r--sofort/core/_flavor/flavor_static_library_enabled.mk5
-rw-r--r--sofort/core/_infer/infer_modern.mk22
-rw-r--r--sofort/core/_infer/infer_posix.mk27
-rw-r--r--sofort/core/_version/_soname/version_soname_copy.mk8
-rw-r--r--sofort/core/_version/_soname/version_soname_symlink.mk12
-rw-r--r--sofort/core/_version/version_none.mk10
-rw-r--r--sofort/core/_version/version_used.mk26
-rw-r--r--sofort/core/defs.mk66
-rw-r--r--sofort/core/flavor.mk12
-rw-r--r--sofort/core/infer.mk4
-rw-r--r--sofort/core/modern.m4117
-rw-r--r--sofort/core/pkgconf.mk39
-rw-r--r--sofort/core/version.mk10
23 files changed, 414 insertions, 0 deletions
diff --git a/sofort/core/_flavor/flavor_app_frontend_disabled.mk b/sofort/core/_flavor/flavor_app_frontend_disabled.mk
new file mode 100644
index 0000000..31ad23a
--- /dev/null
+++ b/sofort/core/_flavor/flavor_app_frontend_disabled.mk
@@ -0,0 +1,6 @@
+# flavor_app_frontend_disabled.mk: handling of frontend build options.
+# this file is covered by COPYING.SOFORT.
+
+app-tag:
+package-install-app:
+package-install-extras:
diff --git a/sofort/core/_flavor/flavor_app_frontend_enabled.mk b/sofort/core/_flavor/flavor_app_frontend_enabled.mk
new file mode 100644
index 0000000..ebbc256
--- /dev/null
+++ b/sofort/core/_flavor/flavor_app_frontend_enabled.mk
@@ -0,0 +1,6 @@
+# flavor_app_frontend_enabled.mk: handling of frontend build options.
+# this file is covered by COPYING.SOFORT.
+
+app-tag: package-app app.tag
+package-install-app: install-app
+package-install-extras: install-extras
diff --git a/sofort/core/_flavor/flavor_app_linking_all_shared.mk b/sofort/core/_flavor/flavor_app_linking_all_shared.mk
new file mode 100644
index 0000000..fe89318
--- /dev/null
+++ b/sofort/core/_flavor/flavor_app_linking_all_shared.mk
@@ -0,0 +1,7 @@
+# flavor_app_linking_all_shared.mk: handling of frontend linking options.
+# this file is covered by COPYING.SOFORT.
+
+PACKAGE_APP = $(SHARED_APP)
+
+package-app: shared-app
+app.tag: $(SHARED_APP)
diff --git a/sofort/core/_flavor/flavor_app_linking_all_static.mk b/sofort/core/_flavor/flavor_app_linking_all_static.mk
new file mode 100644
index 0000000..7a5f620
--- /dev/null
+++ b/sofort/core/_flavor/flavor_app_linking_all_static.mk
@@ -0,0 +1,7 @@
+# flavor_app_linking_all_static.mk: handling of frontend linking options.
+# this file is covered by COPYING.SOFORT.
+
+PACKAGE_APP = $(STATIC_APP)
+
+package-app: static-app
+app.tag: $(STATIC_APP)
diff --git a/sofort/core/_flavor/flavor_app_linking_default.mk b/sofort/core/_flavor/flavor_app_linking_default.mk
new file mode 100644
index 0000000..b0c1d34
--- /dev/null
+++ b/sofort/core/_flavor/flavor_app_linking_default.mk
@@ -0,0 +1,7 @@
+# flavor_app_linking_default.mk: handling of frontend linking options.
+# this file is covered by COPYING.SOFORT.
+
+PACKAGE_APP = $(DEFAULT_APP)
+
+package-app: default-app
+app.tag: $(DEFAULT_APP)
diff --git a/sofort/core/_flavor/flavor_install_headers_custom.mk b/sofort/core/_flavor/flavor_install_headers_custom.mk
new file mode 100644
index 0000000..4f8da97
--- /dev/null
+++ b/sofort/core/_flavor/flavor_install_headers_custom.mk
@@ -0,0 +1,4 @@
+# flavor_install_headers_custom.mk: handling of header installation option.
+# this file is covered by COPYING.SOFORT.
+
+install-headers:install-headers-custom
diff --git a/sofort/core/_flavor/flavor_install_headers_default.mk b/sofort/core/_flavor/flavor_install_headers_default.mk
new file mode 100644
index 0000000..f8b49c4
--- /dev/null
+++ b/sofort/core/_flavor/flavor_install_headers_default.mk
@@ -0,0 +1,4 @@
+# flavor_install_headers_default.mk: handling of header installation option.
+# this file is covered by COPYING.SOFORT.
+
+install-headers:install-headers-default
diff --git a/sofort/core/_flavor/flavor_shared_library_disabled.mk b/sofort/core/_flavor/flavor_shared_library_disabled.mk
new file mode 100644
index 0000000..9846e1b
--- /dev/null
+++ b/sofort/core/_flavor/flavor_shared_library_disabled.mk
@@ -0,0 +1,5 @@
+# flavor_shared_library_disabled.mk: handling of shared library dependencies.
+# this file is covered by COPYING.SOFORT.
+
+package-shared:
+package-install-shared:
diff --git a/sofort/core/_flavor/flavor_shared_library_enabled.mk b/sofort/core/_flavor/flavor_shared_library_enabled.mk
new file mode 100644
index 0000000..2e54d21
--- /dev/null
+++ b/sofort/core/_flavor/flavor_shared_library_enabled.mk
@@ -0,0 +1,5 @@
+# flavor_shared_library_enabled.mk: handling of shared library dependencies.
+# this file is covered by COPYING.SOFORT.
+
+package-shared: shared
+package-install-shared: install-shared
diff --git a/sofort/core/_flavor/flavor_static_library_disabled.mk b/sofort/core/_flavor/flavor_static_library_disabled.mk
new file mode 100644
index 0000000..e46d186
--- /dev/null
+++ b/sofort/core/_flavor/flavor_static_library_disabled.mk
@@ -0,0 +1,5 @@
+# flavor_static_library_disabled.mk: handling of static library dependencies.
+# this file is covered by COPYING.SOFORT.
+
+package-static:
+package-install-static:
diff --git a/sofort/core/_flavor/flavor_static_library_enabled.mk b/sofort/core/_flavor/flavor_static_library_enabled.mk
new file mode 100644
index 0000000..20d4bd8
--- /dev/null
+++ b/sofort/core/_flavor/flavor_static_library_enabled.mk
@@ -0,0 +1,5 @@
+# flavor_static_library_enabled.mk: handling of static library dependencies.
+# this file is covered by COPYING.SOFORT.
+
+package-static: static
+package-install-static: install-static
diff --git a/sofort/core/_infer/infer_modern.mk b/sofort/core/_infer/infer_modern.mk
new file mode 100644
index 0000000..aaf3361
--- /dev/null
+++ b/sofort/core/_infer/infer_modern.mk
@@ -0,0 +1,22 @@
+# infer_modern.mk: modern make target- and inference rules.
+# this file is covered by COPYING.SOFORT.
+
+src/%.ao: $(SOURCE_DIR)/src/%.c
+ $(CC) -c -o $@ $< $(CFLAGS_APP)
+
+src/%.lo: $(SOURCE_DIR)/src/%.c
+ $(CC) -c -o $@ $< $(CFLAGS_SHARED)
+
+src/%.o: $(SOURCE_DIR)/src/%.c
+ $(CC) -c -o $@ $< $(CFLAGS_STATIC)
+
+$(SHARED_LIB):
+ $(SHARED_LIB_CMD) $@ $^ $(SHARED_LIB_LDFLAGS) $(LDFLAGS_IMPLIB)
+
+lib/%$(OS_ARCHIVE_EXT):
+ mkdir -p lib
+ rm -f $@
+ $(AR) rcs $@ $^
+
+srcs.tag:
+ touch $@
diff --git a/sofort/core/_infer/infer_posix.mk b/sofort/core/_infer/infer_posix.mk
new file mode 100644
index 0000000..ae990e8
--- /dev/null
+++ b/sofort/core/_infer/infer_posix.mk
@@ -0,0 +1,27 @@
+# infer_posix.mk: posix make target- and inference rules.
+# this file is covered by COPYING.SOFORT.
+
+.c.ao:
+ $(CC) -c -o $@ $< $(CFLAGS_APP)
+
+.c.lo:
+ $(CC) -c -o $@ $< $(CFLAGS_SHARED)
+
+.c.o:
+ $(CC) -c -o $@ $< $(CFLAGS_STATIC)
+
+$(SHARED_LIB):
+ $(SHARED_LIB_CMD) $@ $(SHARED_OBJS) $(SHARED_LIB_LDFLAGS) $(LDFLAGS_IMPLIB)
+
+$(STATIC_LIB):
+ mkdir -p lib
+ rm -f $@
+ $(AR) rcs $@ $(STATIC_OBJS)
+
+srcs.tag: tree.tag
+
+srcs.tag:
+ $(PROJECT_DIR)/sofort/tools/srctree.sh \
+ --srctree=$(SOURCE_DIR) -- \
+ $(COMMON_SRCS) $(APP_SRCS)
+ touch $@
diff --git a/sofort/core/_version/_soname/version_soname_copy.mk b/sofort/core/_version/_soname/version_soname_copy.mk
new file mode 100644
index 0000000..c176d5a
--- /dev/null
+++ b/sofort/core/_version/_soname/version_soname_copy.mk
@@ -0,0 +1,8 @@
+# version_soname_copy.mk: handling of shared library versioning schemes.
+# this file is covered by COPYING.SOFORT.
+
+install-soname: install-lib
+ cp $(SHARED_LIB) $(DESTDIR)$(LIBDIR)/$(DSO_SONAME)
+
+$(SHARED_SONAME): $(SHARED_LIB)
+ cp $(SHARED_LIB) $(SHARED_SONAME)
diff --git a/sofort/core/_version/_soname/version_soname_symlink.mk b/sofort/core/_version/_soname/version_soname_symlink.mk
new file mode 100644
index 0000000..963b891
--- /dev/null
+++ b/sofort/core/_version/_soname/version_soname_symlink.mk
@@ -0,0 +1,12 @@
+# version_soname_symlink.mk: handling of shared library versioning schemes.
+# this file is covered by COPYING.SOFORT.
+
+$(SHARED_SONAME): $(SHARED_LIB)
+ rm -f $@.tmp
+ ln -s $(DSO_VER) $@.tmp
+ mv $@.tmp $@
+
+install-soname: install-lib
+ rm -f $(SHARED_SONAME).tmp
+ ln -s $(DSO_VER) $(SHARED_SONAME).tmp
+ mv $(SHARED_SONAME).tmp $(DESTDIR)$(LIBDIR)/$(DSO_SONAME)
diff --git a/sofort/core/_version/version_none.mk b/sofort/core/_version/version_none.mk
new file mode 100644
index 0000000..d8fc570
--- /dev/null
+++ b/sofort/core/_version/version_none.mk
@@ -0,0 +1,10 @@
+# version_none.mk: handling of shared library versioning schemes.
+# this file is covered by COPYING.SOFORT.
+
+VER_XYZ =
+VER_SONAME =
+
+package-shared-soname:
+package-shared-solink:
+package-install-soname:
+package-install-solink:
diff --git a/sofort/core/_version/version_used.mk b/sofort/core/_version/version_used.mk
new file mode 100644
index 0000000..4724cee
--- /dev/null
+++ b/sofort/core/_version/version_used.mk
@@ -0,0 +1,26 @@
+# version_used.mk: handling of shared library versioning schemes.
+# this file is covered by COPYING.SOFORT.
+
+VER_XYZ = .$(VER_MAJOR).$(VER_MINOR).$(VER_PATCH)
+VER_SONAME = .$(VER_MAJOR)
+
+package-shared-soname: shared-soname
+package-shared-solink: shared-solink
+package-install-soname: install-soname
+package-install-solink: install-solink
+
+
+
+# libfoo.so (common)
+install-solink: install-lib
+ rm -f $(SHARED_SOLINK).tmp
+ ln -s $(DSO_VER) $(SHARED_SOLINK).tmp
+ mv $(SHARED_SOLINK).tmp $(DESTDIR)$(LIBDIR)/$(DSO_SOLINK)
+
+$(SHARED_SOLINK): $(SHARED_LIB)
+ rm -f $@.tmp
+ ln -s $(DSO_VER) $@.tmp
+ mv $@.tmp $@
+
+# libfoo.so.x (symlink or copy)
+include $(PROJECT_DIR)/sofort/core/_version/_soname/version_soname_$(OS_SONAME).mk
diff --git a/sofort/core/defs.mk b/sofort/core/defs.mk
new file mode 100644
index 0000000..2622cff
--- /dev/null
+++ b/sofort/core/defs.mk
@@ -0,0 +1,66 @@
+SHARED_LIB_DEPS +=
+SHARED_APP_DEPS +=
+STATIC_APP_DEPS +=
+
+COMMON_LOBJS += $(COMMON_SRCS:.c=.lo)
+COMMON_OBJS += $(COMMON_SRCS:.c=.o)
+
+ARCH_LOBJS += $(ARCH_SRCS:.c=.lo)
+ARCH_OBJS += $(ARCH_SRCS:.c=.o)
+
+APP_LOBJS += $(APP_SRCS:.c=.lo)
+APP_OBJS += $(APP_SRCS:.c=.ao)
+
+SHARED_OBJS += $(COMMON_LOBJS) $(ARCH_LOBJS)
+STATIC_OBJS += $(COMMON_OBJS) $(ARCH_OBJS)
+
+STATIC_LIB_NAME = $(OS_LIB_PREFIX)$(PACKAGE)$(OS_ARCHIVE_EXT)
+STATIC_LIB = lib/$(STATIC_LIB_NAME)
+
+DSO_VER = $(OS_LIB_PREFIX)$(PACKAGE)$(OS_LIB_PREFIXED_SUFFIX)$(VER_XYZ)$(OS_LIB_SUFFIXED_SUFFIX)
+DSO_SONAME = $(OS_LIB_PREFIX)$(PACKAGE)$(OS_LIB_PREFIXED_SUFFIX)$(VER_SONAME)$(OS_LIB_SUFFIXED_SUFFIX)
+DSO_SOLINK = $(OS_LIB_PREFIX)$(PACKAGE)$(OS_LIB_SUFFIX)
+
+SHARED_LIB = lib/$(DSO_VER)
+SHARED_SONAME = lib/$(DSO_SONAME)
+SHARED_SOLINK = lib/$(DSO_SOLINK)
+
+IMP_DEF = $(OS_LIB_PREFIX)$(PACKAGE)$(VER_XYZ)$(OS_LIBDEF_EXT)
+IMP_VER = $(OS_LIB_PREFIX)$(PACKAGE)$(VER_XYZ)$(OS_IMPLIB_EXT)
+IMP_SONAME = $(OS_LIB_PREFIX)$(PACKAGE)$(VER_SONAME)$(OS_IMPLIB_EXT)
+IMP_SOLINK = $(OS_LIB_PREFIX)$(PACKAGE)$(OS_IMPLIB_EXT)
+
+IMPLIB_DEF = lib/$(IMP_DEF)
+IMPLIB_VER = lib/$(IMP_VER)
+IMPLIB_SONAME = lib/$(IMP_SONAME)
+IMPLIB_SOLINK = lib/$(IMP_SOLINK)
+
+APP = bin/$(OS_APP_PREFIX)$(NICKNAME)$(OS_APP_SUFFIX)
+DEFAULT_APP = bin/$(OS_APP_PREFIX)$(NICKNAME)-default$(OS_APP_SUFFIX)
+SHARED_APP = bin/$(OS_APP_PREFIX)$(NICKNAME)-shared$(OS_APP_SUFFIX)
+STATIC_APP = bin/$(OS_APP_PREFIX)$(NICKNAME)-static$(OS_APP_SUFFIX)
+
+CFLAGS = $(CFLAGS_DEBUG) $(CFLAGS_CONFIG) $(CFLAGS_SYSROOT) \
+ $(CFLAGS_COMMON) $(CFLAGS_CMDLINE) $(CFLAGS_HOST) \
+ $(CFLAGS_PATH) $(CFLAGS_OS) $(CFLAGS_SITE) \
+ $(CFLAGS_VERSION) $(CFLAGS_STRICT) \
+ $(CFLAGS_LAST) $(CFLAGS_ONCE)
+
+CFLAGS_SHARED = $(CFLAGS) $(CFLAGS_PIC) $(CFLAGS_SHARED_ATTR)
+CFLAGS_STATIC = $(CFLAGS) $(CFLAGS_OBJ) $(CFLAGS_STATIC_ATTR)
+CFLAGS_APP = $(CFLAGS) $(CFLAGS_OBJ) $(CFLAGS_APP_ATTR) $(CFLAGS_UTIL)
+
+LDFLAGS_SHARED = $(LDFLAGS_DEBUG) $(LDFLAGS_CONFIG) $(LDFLAGS_SYSROOT) \
+ $(LDFLAGS_COMMON) $(LDFLAGS_CMDLINE) $(LDFLAGS_HOST) \
+ $(LDFLAGS_PATH) $(SHARED_LIB_DEPS) $(LDFLAGS_STRICT) \
+ $(LDFLAGS_LAST) $(LDFLAGS_ONCE)
+
+LDFLAGS_APP = $(LDFLAGS_DEBUG) $(LDFLAGS_CONFIG) $(LDFLAGS_SYSROOT) \
+ $(LDFLAGS_COMMON) $(LDFLAGS_CMDLINE) $(LDFLAGS_HOST) \
+ $(LDFLAGS_PATH) $(SHARED_APP_DEPS) $(LDFLAGS_STRICT) \
+ $(LDFLAGS_UTIL) $(LDFLAGS_LAST) $(LDFLAGS_ONCE)
+
+LDFLAGS_STATIC = $(LDFLAGS_DEBUG) $(LDFLAGS_CONFIG) $(LDFLAGS_SYSROOT) \
+ $(LDFLAGS_COMMON) $(LDFLAGS_CMDLINE) $(LDFLAGS_HOST) \
+ $(LDFLAGS_PATH) $(STATIC_APP_DEPS) $(LDFLAGS_STRICT) \
+ $(LDFLAGS_LAST) $(LDFLAGS_ONCE)
diff --git a/sofort/core/flavor.mk b/sofort/core/flavor.mk
new file mode 100644
index 0000000..6a7c97a
--- /dev/null
+++ b/sofort/core/flavor.mk
@@ -0,0 +1,12 @@
+# flavor.mk: top-level handling of build flavors.
+# this file is covered by COPYING.SOFORT.
+
+include $(PROJECT_DIR)/sofort/exrules/$(OS_DSO_EXRULES).mk
+
+include $(PROJECT_DIR)/sofort/core/_flavor/flavor_static_library_$(STATIC_LIBRARY_OPT).mk
+include $(PROJECT_DIR)/sofort/core/_flavor/flavor_shared_library_$(SHARED_LIBRARY_OPT).mk
+
+include $(PROJECT_DIR)/sofort/core/_flavor/flavor_app_frontend_$(APP_FRONTEND_OPT).mk
+include $(PROJECT_DIR)/sofort/core/_flavor/flavor_app_linking_$(APP_LINKING_OPT).mk
+
+include $(PROJECT_DIR)/sofort/core/_flavor/flavor_install_headers_$(INSTALL_HEADERS_OPT).mk
diff --git a/sofort/core/infer.mk b/sofort/core/infer.mk
new file mode 100644
index 0000000..8a1c6dd
--- /dev/null
+++ b/sofort/core/infer.mk
@@ -0,0 +1,4 @@
+# infer.mk: top-level handling of inference rules.
+# this file is covered by COPYING.SOFORT.
+
+include $(PROJECT_DIR)/sofort/core/_infer/infer_$(MAKEMODE).mk
diff --git a/sofort/core/modern.m4 b/sofort/core/modern.m4
new file mode 100644
index 0000000..ad75ca9
--- /dev/null
+++ b/sofort/core/modern.m4
@@ -0,0 +1,117 @@
+dnl modern.m4: a modern and simple framework for using the m4 macro language
+dnl
+dnl This file is covered by COPYING.SOFORT.
+dnl
+dnl 1) make all standard m4 builtins m4_ prefixed.
+dnl 2) set the left-bracket and right-bracket symbols the begin-quote and end-quote strings.
+dnl 3) make a single underscore symbol the equivalent of the standard dnl builtin.
+dnl 4) provide the m4_toupper(), m4_tolower(), and m4_pathvar() macros.
+dnl 5) provide the m4_srclist() and m4_srcitem() macros.
+dnl 6) provide the m4_fillerdots(), m4_fillerdash(), and m4_fillerline() macros.
+dnl 7) provide the m4_whitespace() and m4_spacealign() macros.
+dnl 8) provide the m4_alignlen(), m4_leftalign(), and m4_rightalign() macros.
+dnl 9) provide the m4_tab(), m4_tabtab(), and m4_tabtabtab() macros.
+dnl
+divert(-1)
+
+define(m4_changecom,defn(`changecom'))
+define(m4_changequote,defn(`changequote'))
+define(m4_decr,defn(`decr'))
+define(m4_define,defn(`define'))
+define(m4_defn,defn(`defn'))
+define(m4_divert,defn(`divert'))
+define(m4_divnum,defn(`divnum'))
+define(m4_dnl,defn(`dnl'))
+define(m4_dumpdef,defn(`dumpdef'))
+define(m4_errprint,defn(`errprint'))
+define(m4_eval,defn(`eval'))
+define(m4_ifdef,defn(`ifdef'))
+define(m4_ifelse,defn(`ifelse'))
+define(m4_include,defn(`include'))
+define(m4_incr,defn(`incr'))
+define(m4_index,defn(`index'))
+define(m4_len,defn(`len'))
+define(m4_m4exit,defn(`m4exit'))
+define(m4_m4wrap,defn(`m4wrap'))
+define(m4_maketemp,defn(`maketemp'))
+define(m4_mkstemp,defn(`mkstemp'))
+define(m4_popdef,defn(`popdef'))
+define(m4_pushdef,defn(`pushdef'))
+define(m4_shift,defn(`shift'))
+define(m4_sinclude,defn(`sinclude'))
+define(m4_substr,defn(`substr'))
+define(m4_syscmd,defn(`syscmd'))
+define(m4_sysval,defn(`sysval'))
+define(m4_traceoff,defn(`traceoff'))
+define(m4_traceon,defn(`traceon'))
+define(m4_translit,defn(`translit'))
+define(m4_undefine,defn(`undefine'))
+define(m4_undivert,defn(`undivert'))
+
+m4_changequote([,])
+
+m4_undefine([changecom])
+m4_undefine([changequote])
+m4_undefine([decr])
+m4_undefine([define])
+m4_undefine([defn])
+m4_undefine([divert])
+m4_undefine([divnum])
+m4_undefine([dnl])
+m4_undefine([dumpdef])
+m4_undefine([errprint])
+m4_undefine([eval])
+m4_undefine([ifdef])
+m4_undefine([ifelse])
+m4_undefine([include])
+m4_undefine([incr])
+m4_undefine([index])
+m4_undefine([len])
+m4_undefine([m4exit])
+m4_undefine([m4wrap])
+m4_undefine([maketemp])
+m4_undefine([mkstemp])
+m4_undefine([popdef])
+m4_undefine([pushdef])
+m4_undefine([shift])
+m4_undefine([sinclude])
+m4_undefine([substr])
+m4_undefine([syscmd])
+m4_undefine([sysval])
+m4_undefine([traceoff])
+m4_undefine([traceon])
+m4_undefine([translit])
+m4_undefine([undefine])
+m4_undefine([undivert])
+
+m4_define([_],m4_defn([m4_dnl]))
+
+m4_define([m4_toupper],[m4_translit([[$1]],[[abcdefghijklmnopqrstuvwxyz]],[[ABCDEFGHIJKLMNOPQRSTUVWXYZ]])])
+m4_define([m4_tolower],[m4_translit([[$1]],[[ABCDEFGHIJKLMNOPQRSTUVWXYZ]],[[abcdefghijklmnopqrstuvwxyz]])])
+m4_define([m4_pathvar],[m4_translit(m4_toupper([[$1]]),[/-],[__])])
+
+m4_define([m4_srclist],[[$1] = \])
+m4_define([m4_srcitem],[m4_tab[$1] \])
+
+m4_define([m4_fillerdots],[................................])
+m4_define([m4_fillerdash],[--------------------------------])
+m4_define([m4_fillerline],[m4_fillerdots[]m4_fillerdots[]m4_fillerdots[]])
+
+m4_define([m4_whitespace],[m4_translit(m4_fillerdots,[[.]],[[ ]])])
+m4_define([m4_spacealign],[m4_translit(m4_fillerline,[[.]],[[ ]])])
+
+m4_define([m4_alignlen],[m4_eval([$1]-m4_len([$2]))])
+m4_define([m4_leftalign],[m4_substr(m4_spacealign,0,m4_alignlen([$1],[$2]))[$2]])
+m4_define([m4_rightalign],[[$2]m4_substr(m4_spacealign,0,m4_alignlen([$1],[$2]))])
+
+
+m4_define([m4_tab],_
+ [$1]))
+
+m4_define([m4_tabtab],_
+ [$1])
+
+m4_define([m4_tabtabtab],_
+ [$1])
+
+m4_divert(0)_
diff --git a/sofort/core/pkgconf.mk b/sofort/core/pkgconf.mk
new file mode 100644
index 0000000..5ada069
--- /dev/null
+++ b/sofort/core/pkgconf.mk
@@ -0,0 +1,39 @@
+# pkgconf.mk: rules for pkgconf manifest generation.
+# this file is covered by COPYING.SOFORT.
+
+PKGCONF_VERSION = $(VER_MAJOR).$(VER_MINOR).$(VER_PATCH)
+
+.pkgconf:
+
+build/$(PACKAGE).pc: .pkgconf dirs.tag
+
+build/$(PACKAGE).pc:
+ @touch $@
+ @chmod 0644 $@
+ PKGCONF_NAME='$(PKGNAME)' \
+ PKGCONF_DESC='$(PKGDESC)' \
+ PKGCONF_USRC='$(PKGUSRC)' \
+ PKGCONF_REPO='$(PKGREPO)' \
+ PKGCONF_PSRC='$(PKGPSRC)' \
+ PKGCONF_DURL='$(PKGDURL)' \
+ PKGCONF_BUGS='$(PKGBUGS)' \
+ PKGCONF_HOME='$(PKGHOME)' \
+ PKGCONF_DEFS='$(PKGDEFS)' \
+ PKGCONF_LIBS='$(PKGLIBS)' \
+ \
+ PKGCONF_EXEC_PREFIX='$(EXEC_PREFIX)' \
+ PKGCONF_PREFIX='$(PREFIX)' \
+ PKGCONF_LIBDIR='$(LIBDIR)' \
+ PKGCONF_INCLUDEDIR='$(INCLUDEDIR)' \
+ PKGCONF_VERSION='$(PKGCONF_VERSION)' \
+ $(PROJECT_DIR)/sofort/tools/pkgconf.sh > $@
+
+install-pkgconf: build/$(PACKAGE).pc
+ mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig
+ cp -p build/$(PACKAGE).pc $(DESTDIR)$(LIBDIR)/pkgconfig
+
+install-shared: install-pkgconf
+
+install-static: install-pkgconf
+
+.PHONY: .pkgconf install-pkgconf
diff --git a/sofort/core/version.mk b/sofort/core/version.mk
new file mode 100644
index 0000000..ad693ab
--- /dev/null
+++ b/sofort/core/version.mk
@@ -0,0 +1,10 @@
+# version.mk: handling of shared library versioning schemes.
+# this file is covered by COPYING.SOFORT.
+
+include $(PROJECT_DIR)/project/tagver.mk
+
+CFLAGS_VERSION += -D$(VER_NAMESPACE)_TAG_VER_MAJOR=$(VER_MAJOR)
+CFLAGS_VERSION += -D$(VER_NAMESPACE)_TAG_VER_MINOR=$(VER_MINOR)
+CFLAGS_VERSION += -D$(VER_NAMESPACE)_TAG_VER_PATCH=$(VER_PATCH)
+
+include $(PROJECT_DIR)/sofort/core/_version/version_$(VERSION_OPT).mk