From 542ea4dee15916641fd469573ae985dca7dea048 Mon Sep 17 00:00:00 2001 From: midipix Date: Mon, 31 Dec 2018 20:57:15 -0500 Subject: build system: sofort: refactored, rearranged using distinct sub-folders. --- sofort/cfgdefs.in | 6 --- sofort/config.vars | 113 ---------------------------------------------- sofort/config/cfgdefs.in | 6 +++ sofort/config/config.vars | 113 ++++++++++++++++++++++++++++++++++++++++++++++ sofort/config/flag.vars | 25 ++++++++++ sofort/core/defs.mk | 66 +++++++++++++++++++++++++++ sofort/core/flavor.mk | 70 ++++++++++++++++++++++++++++ sofort/core/pkgconf.mk | 40 ++++++++++++++++ sofort/core/version.mk | 63 ++++++++++++++++++++++++++ sofort/defs.mk | 66 --------------------------- sofort/flag.vars | 25 ---------- sofort/flavor.mk | 70 ---------------------------- sofort/pkgconf.mk | 40 ---------------- sofort/pkgconf.sh | 107 ------------------------------------------- sofort/tools/pkgconf.sh | 107 +++++++++++++++++++++++++++++++++++++++++++ sofort/tools/version.sh | 72 +++++++++++++++++++++++++++++ sofort/version.mk | 63 -------------------------- sofort/version.sh | 72 ----------------------------- 18 files changed, 562 insertions(+), 562 deletions(-) delete mode 100644 sofort/cfgdefs.in delete mode 100644 sofort/config.vars create mode 100644 sofort/config/cfgdefs.in create mode 100644 sofort/config/config.vars create mode 100644 sofort/config/flag.vars create mode 100644 sofort/core/defs.mk create mode 100644 sofort/core/flavor.mk create mode 100644 sofort/core/pkgconf.mk create mode 100644 sofort/core/version.mk delete mode 100644 sofort/defs.mk delete mode 100644 sofort/flag.vars delete mode 100644 sofort/flavor.mk delete mode 100644 sofort/pkgconf.mk delete mode 100755 sofort/pkgconf.sh create mode 100755 sofort/tools/pkgconf.sh create mode 100755 sofort/tools/version.sh delete mode 100644 sofort/version.mk delete mode 100755 sofort/version.sh (limited to 'sofort') diff --git a/sofort/cfgdefs.in b/sofort/cfgdefs.in deleted file mode 100644 index fd4b947..0000000 --- a/sofort/cfgdefs.in +++ /dev/null @@ -1,6 +0,0 @@ -# changes made to this file will be gone the next time -# you run ./configure. - -# for persistent post-configure, ad-hoc changes to the -# build project, use usrdefs.mk instead. - diff --git a/sofort/config.vars b/sofort/config.vars deleted file mode 100644 index ac7c2aa..0000000 --- a/sofort/config.vars +++ /dev/null @@ -1,113 +0,0 @@ -package -nickname -project_dir -source_dir -git_reference_index -custom_install_headers -avoid_version - -pkgname -pkgdesc -pkgusrc -pkgrepo -pkgpsrc -pkgdurl -pkgdefs -pkglibs - -build -host -cchost -cfghost -target -arch -compiler -toolchain -zealous -sysroot -cross_compile -shell - -prefix -exec_prefix -bindir -sbindir -libdir -includedir -oldincludedir -mandir -docdir -libexecdir - -sysconfdir -sharedstatedir -localstatedir -runstatedir -datarootdir -datadir -infodir -localedir -htmldir -dvidir -pdfdir -psdir - -cflags -cflags_common -cflags_debug -cflags_cmdline -cflags_config -cflags_sysroot -cflags_os -cflags_site -cflags_path -cflags_strict -cflags_util -cflags_last -cflags_once - -ldflags -ldflags_common -ldflags_debug -ldflags_cmdline -ldflags_config -ldflags_sysroot -ldflags_path -ldflags_strict -ldflags_util -ldflags_last -ldflags_once - -cc -cpp -cxx - -user_cc -user_cpp -user_cxx - -pe_subsystem -pe_image_base -pe_config_defs - -elf_eh_frame -elf_hash_style -elf_config_defs - -native_cc -native_cpp -native_cxx - -native_host -native_cfghost -native_cflags -native_ldflags - -all_shared -all_static -disable_frontend -disable_shared -disable_static - -use_custom_cfgdefs -use_custom_usrdefs diff --git a/sofort/config/cfgdefs.in b/sofort/config/cfgdefs.in new file mode 100644 index 0000000..fd4b947 --- /dev/null +++ b/sofort/config/cfgdefs.in @@ -0,0 +1,6 @@ +# changes made to this file will be gone the next time +# you run ./configure. + +# for persistent post-configure, ad-hoc changes to the +# build project, use usrdefs.mk instead. + diff --git a/sofort/config/config.vars b/sofort/config/config.vars new file mode 100644 index 0000000..ac7c2aa --- /dev/null +++ b/sofort/config/config.vars @@ -0,0 +1,113 @@ +package +nickname +project_dir +source_dir +git_reference_index +custom_install_headers +avoid_version + +pkgname +pkgdesc +pkgusrc +pkgrepo +pkgpsrc +pkgdurl +pkgdefs +pkglibs + +build +host +cchost +cfghost +target +arch +compiler +toolchain +zealous +sysroot +cross_compile +shell + +prefix +exec_prefix +bindir +sbindir +libdir +includedir +oldincludedir +mandir +docdir +libexecdir + +sysconfdir +sharedstatedir +localstatedir +runstatedir +datarootdir +datadir +infodir +localedir +htmldir +dvidir +pdfdir +psdir + +cflags +cflags_common +cflags_debug +cflags_cmdline +cflags_config +cflags_sysroot +cflags_os +cflags_site +cflags_path +cflags_strict +cflags_util +cflags_last +cflags_once + +ldflags +ldflags_common +ldflags_debug +ldflags_cmdline +ldflags_config +ldflags_sysroot +ldflags_path +ldflags_strict +ldflags_util +ldflags_last +ldflags_once + +cc +cpp +cxx + +user_cc +user_cpp +user_cxx + +pe_subsystem +pe_image_base +pe_config_defs + +elf_eh_frame +elf_hash_style +elf_config_defs + +native_cc +native_cpp +native_cxx + +native_host +native_cfghost +native_cflags +native_ldflags + +all_shared +all_static +disable_frontend +disable_shared +disable_static + +use_custom_cfgdefs +use_custom_usrdefs diff --git a/sofort/config/flag.vars b/sofort/config/flag.vars new file mode 100644 index 0000000..4229e3e --- /dev/null +++ b/sofort/config/flag.vars @@ -0,0 +1,25 @@ +# configure +mb_config +mb_debug + +mb_ccstrict +mb_ldstrict + +mb_program_prefix +mb_require_source_dir + +mb_prefix_set +mb_bindir_set +mb_exec_prefix_set + +mb_bindir_basename + +# ccenv +mb_agnostic + +# cfgtest +mb_cfgtest_cc +mb_cfgtest_cflags +mb_cfgtest_cfgtype +mb_cfgtest_makevar +mb_cfgtest_headers diff --git a/sofort/core/defs.mk b/sofort/core/defs.mk new file mode 100644 index 0000000..151bc3d --- /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=.o) + +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..bd9ab06 --- /dev/null +++ b/sofort/core/flavor.mk @@ -0,0 +1,70 @@ +ifneq ($(OS_DSO_EXRULES),) +include $(PROJECT_DIR)/sofort/exrules/$(OS_DSO_EXRULES).mk +endif + +ifeq ($(DISABLE_STATIC),yes) +package-static: +package-install-static: +else +package-static: static +package-install-static: install-static +endif + +ifeq ($(DISABLE_SHARED),yes) +package-shared: +package-install-shared: +else +package-shared: shared +package-install-shared: install-shared +endif + + + +ifeq ($(DISABLE_FRONTEND),yes) +app-tag: +package-install-app: +package-install-extras: +else +app-tag: package-app app.tag +package-install-app: install-app +package-install-extras: install-extras +endif + + + +ifeq ($(ALL_STATIC),yes) + +package-app: static-app +app: PACKAGE_APP = $(STATIC_APP) +app-tag: PACKAGE_APP = $(STATIC_APP) +app.tag: $(STATIC_APP) + + +else ifeq ($(ALL_SHARED),yes) + +package-app: shared-app +app: PACKAGE_APP = $(SHARED_APP) +app-tag: PACKAGE_APP = $(SHARED_APP) +app.tag: $(SHARED_APP) + + +else + +package-app: default-app +app: PACKAGE_APP = $(DEFAULT_APP) +app-tag: PACKAGE_APP = $(DEFAULT_APP) +app.tag: $(DEFAULT_APP) + +endif + + + +ifeq ($(CUSTOM_INSTALL_HEADERS),yes) + +install-headers:install-headers-custom + +else + +install-headers:install-headers-default + +endif diff --git a/sofort/core/pkgconf.mk b/sofort/core/pkgconf.mk new file mode 100644 index 0000000..f266b9f --- /dev/null +++ b/sofort/core/pkgconf.mk @@ -0,0 +1,40 @@ +ifeq ($(PKGCONF),no) + +install-pkgconf: + +else + +PKGCONF_VERSION = $(VER_MAJOR).$(VER_MINOR).$(VER_PATCH) + +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_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 + +endif diff --git a/sofort/core/version.mk b/sofort/core/version.mk new file mode 100644 index 0000000..5ef0ee2 --- /dev/null +++ b/sofort/core/version.mk @@ -0,0 +1,63 @@ +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) + +ifeq ($(AVOID_VERSION),yes) + +VER_XYZ = +VER_SONAME = + +package-shared-soname: +package-shared-solink: +package-install-soname: +package-install-solink: + +else + +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) +ifeq ($(OS_SONAME),symlink) +$(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) +endif + + +# libfoo.so.x (copy) +ifeq ($(OS_SONAME),copy) +install-soname: install-lib + cp $(SHARED_LIB) $(DESTDIR)$(LIBDIR)/$(DSO_SONAME) + +$(SHARED_SONAME): $(SHARED_LIB) + cp $(SHARED_LIB) $(SHARED_SONAME) +endif + +endif diff --git a/sofort/defs.mk b/sofort/defs.mk deleted file mode 100644 index 151bc3d..0000000 --- a/sofort/defs.mk +++ /dev/null @@ -1,66 +0,0 @@ -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=.o) - -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/flag.vars b/sofort/flag.vars deleted file mode 100644 index 4229e3e..0000000 --- a/sofort/flag.vars +++ /dev/null @@ -1,25 +0,0 @@ -# configure -mb_config -mb_debug - -mb_ccstrict -mb_ldstrict - -mb_program_prefix -mb_require_source_dir - -mb_prefix_set -mb_bindir_set -mb_exec_prefix_set - -mb_bindir_basename - -# ccenv -mb_agnostic - -# cfgtest -mb_cfgtest_cc -mb_cfgtest_cflags -mb_cfgtest_cfgtype -mb_cfgtest_makevar -mb_cfgtest_headers diff --git a/sofort/flavor.mk b/sofort/flavor.mk deleted file mode 100644 index bd9ab06..0000000 --- a/sofort/flavor.mk +++ /dev/null @@ -1,70 +0,0 @@ -ifneq ($(OS_DSO_EXRULES),) -include $(PROJECT_DIR)/sofort/exrules/$(OS_DSO_EXRULES).mk -endif - -ifeq ($(DISABLE_STATIC),yes) -package-static: -package-install-static: -else -package-static: static -package-install-static: install-static -endif - -ifeq ($(DISABLE_SHARED),yes) -package-shared: -package-install-shared: -else -package-shared: shared -package-install-shared: install-shared -endif - - - -ifeq ($(DISABLE_FRONTEND),yes) -app-tag: -package-install-app: -package-install-extras: -else -app-tag: package-app app.tag -package-install-app: install-app -package-install-extras: install-extras -endif - - - -ifeq ($(ALL_STATIC),yes) - -package-app: static-app -app: PACKAGE_APP = $(STATIC_APP) -app-tag: PACKAGE_APP = $(STATIC_APP) -app.tag: $(STATIC_APP) - - -else ifeq ($(ALL_SHARED),yes) - -package-app: shared-app -app: PACKAGE_APP = $(SHARED_APP) -app-tag: PACKAGE_APP = $(SHARED_APP) -app.tag: $(SHARED_APP) - - -else - -package-app: default-app -app: PACKAGE_APP = $(DEFAULT_APP) -app-tag: PACKAGE_APP = $(DEFAULT_APP) -app.tag: $(DEFAULT_APP) - -endif - - - -ifeq ($(CUSTOM_INSTALL_HEADERS),yes) - -install-headers:install-headers-custom - -else - -install-headers:install-headers-default - -endif diff --git a/sofort/pkgconf.mk b/sofort/pkgconf.mk deleted file mode 100644 index c8fc711..0000000 --- a/sofort/pkgconf.mk +++ /dev/null @@ -1,40 +0,0 @@ -ifeq ($(PKGCONF),no) - -install-pkgconf: - -else - -PKGCONF_VERSION = $(VER_MAJOR).$(VER_MINOR).$(VER_PATCH) - -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_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/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 - -endif diff --git a/sofort/pkgconf.sh b/sofort/pkgconf.sh deleted file mode 100755 index a37e368..0000000 --- a/sofort/pkgconf.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/sh - -# prefix, exec_prefix -if [ "$PKGCONF_PREFIX" = "$PKGCONF_EXEC_PREFIX" ]; then - pkgconf_prefix="${PKGCONF_PREFIX}" - pkgconf_exec_prefix='${prefix}' -else - pkgconf_prefix="${PKGCONF_PREFIX}" - pkgconf_exec_prefix="${PKGCONF_EXEC_PREFIX}" -fi - - -# (relative) includedir -if [ -z "$PKGCONF_INCLUDEDIR" ]; then - pkgconf_includedir= - pkgconf_cflags= -else - prefix=$(dirname "$PKGCONF_INCLUDEDIR") - base=$(basename "$PKGCONF_INCLUDEDIR") - - if [ "$prefix/$base" = "$PKGCONF_PREFIX/$base" ]; then - pkgconf_includedir='${prefix}/'"${base}" - pkgconf_cflags='-I${includedir}' - else - pkgconf_includedir="${PKGCONF_INCLUDEDIR}" - pkgconf_cflags='-I${includedir}' - fi -fi - - -# (relative) libdir (blank unless needed) -if [ -z "$PKGCONF_LIBDIR" ]; then - pkgconf_libdir= -else - prefix=$(dirname "$PKGCONF_LIBDIR") - base=$(basename "$PKGCONF_LIBDIR") - - if [ "$prefix/$base" = "$PKGCONF_EXEC_PREFIX/$base" ]; then - pkgconf_libdir='${exec_prefix}/'"${base}" - else - pkgconf_libdir='${prefix}/'"${PKGCONF_LIBDIR}" - fi -fi - - -# ldflags (--libs) -if [ -n "$pkgconf_libdir" ] && [ -n "${PKGCONF_NAME}" ]; then - pkgconf_ldflags="$pkgconf_libdir -l${PKGCONF_NAME}" -elif [ -n "${PKGCONF_NAME}" ]; then - pkgconf_ldflags="-l${PKGCONF_NAME}" -else - pkgconf_ldflags="$pkgconf_libdir" -fi - - -# cflags -if [ -n "$pkgconf_cflags" ] || [ -n "${PKGCONF_DEFS}" ]; then - pkgconf_cflags="$pkgconf_cflags ${PKGCONF_DEFS}" - pkgconf_cflags=$(printf '%s' "$pkgconf_cflags" | sed -e 's/^[ \t]*//g') -fi - - -# repo (optional) -if [ -z "${PKGCONF_REPO}" ]; then - pkgconf_repo='#' -else - pkgconf_repo="Repo: ${PKGCONF_REPO}" -fi - -# patches (optional) -if [ -z "${PKGCONF_PSRC}" ]; then - pkgconf_psrc='#' -else - pkgconf_psrc="Patches: ${PKGCONF_PSRC}" -fi - -# distro (optional) -if [ -z "${PKGCONF_DURL}" ]; then - pkgconf_durl='#' -else - pkgconf_durl="Distro: ${PKGCONF_DURL}" -fi - - -# output (without trailing spaces) -cat << _EOF | grep -v '^#' | sed 's/[ \t]*$//' -### -prefix=$pkgconf_prefix -exec_prefix=$pkgconf_exec_prefix -includedir=$pkgconf_includedir -libdir=$pkgconf_libdir - -Name: ${PKGCONF_NAME} -Description: ${PKGCONF_DESC} -URL: ${PKGCONF_USRC} -Version: ${PKGCONF_VERSION} -$pkgconf_repo -$pkgconf_psrc -$pkgconf_durl - -Cflags: $pkgconf_cflags -Libs: $pkgconf_ldflags -### -_EOF - -# all done -exit 0 diff --git a/sofort/tools/pkgconf.sh b/sofort/tools/pkgconf.sh new file mode 100755 index 0000000..a37e368 --- /dev/null +++ b/sofort/tools/pkgconf.sh @@ -0,0 +1,107 @@ +#!/bin/sh + +# prefix, exec_prefix +if [ "$PKGCONF_PREFIX" = "$PKGCONF_EXEC_PREFIX" ]; then + pkgconf_prefix="${PKGCONF_PREFIX}" + pkgconf_exec_prefix='${prefix}' +else + pkgconf_prefix="${PKGCONF_PREFIX}" + pkgconf_exec_prefix="${PKGCONF_EXEC_PREFIX}" +fi + + +# (relative) includedir +if [ -z "$PKGCONF_INCLUDEDIR" ]; then + pkgconf_includedir= + pkgconf_cflags= +else + prefix=$(dirname "$PKGCONF_INCLUDEDIR") + base=$(basename "$PKGCONF_INCLUDEDIR") + + if [ "$prefix/$base" = "$PKGCONF_PREFIX/$base" ]; then + pkgconf_includedir='${prefix}/'"${base}" + pkgconf_cflags='-I${includedir}' + else + pkgconf_includedir="${PKGCONF_INCLUDEDIR}" + pkgconf_cflags='-I${includedir}' + fi +fi + + +# (relative) libdir (blank unless needed) +if [ -z "$PKGCONF_LIBDIR" ]; then + pkgconf_libdir= +else + prefix=$(dirname "$PKGCONF_LIBDIR") + base=$(basename "$PKGCONF_LIBDIR") + + if [ "$prefix/$base" = "$PKGCONF_EXEC_PREFIX/$base" ]; then + pkgconf_libdir='${exec_prefix}/'"${base}" + else + pkgconf_libdir='${prefix}/'"${PKGCONF_LIBDIR}" + fi +fi + + +# ldflags (--libs) +if [ -n "$pkgconf_libdir" ] && [ -n "${PKGCONF_NAME}" ]; then + pkgconf_ldflags="$pkgconf_libdir -l${PKGCONF_NAME}" +elif [ -n "${PKGCONF_NAME}" ]; then + pkgconf_ldflags="-l${PKGCONF_NAME}" +else + pkgconf_ldflags="$pkgconf_libdir" +fi + + +# cflags +if [ -n "$pkgconf_cflags" ] || [ -n "${PKGCONF_DEFS}" ]; then + pkgconf_cflags="$pkgconf_cflags ${PKGCONF_DEFS}" + pkgconf_cflags=$(printf '%s' "$pkgconf_cflags" | sed -e 's/^[ \t]*//g') +fi + + +# repo (optional) +if [ -z "${PKGCONF_REPO}" ]; then + pkgconf_repo='#' +else + pkgconf_repo="Repo: ${PKGCONF_REPO}" +fi + +# patches (optional) +if [ -z "${PKGCONF_PSRC}" ]; then + pkgconf_psrc='#' +else + pkgconf_psrc="Patches: ${PKGCONF_PSRC}" +fi + +# distro (optional) +if [ -z "${PKGCONF_DURL}" ]; then + pkgconf_durl='#' +else + pkgconf_durl="Distro: ${PKGCONF_DURL}" +fi + + +# output (without trailing spaces) +cat << _EOF | grep -v '^#' | sed 's/[ \t]*$//' +### +prefix=$pkgconf_prefix +exec_prefix=$pkgconf_exec_prefix +includedir=$pkgconf_includedir +libdir=$pkgconf_libdir + +Name: ${PKGCONF_NAME} +Description: ${PKGCONF_DESC} +URL: ${PKGCONF_USRC} +Version: ${PKGCONF_VERSION} +$pkgconf_repo +$pkgconf_psrc +$pkgconf_durl + +Cflags: $pkgconf_cflags +Libs: $pkgconf_ldflags +### +_EOF + +# all done +exit 0 diff --git a/sofort/tools/version.sh b/sofort/tools/version.sh new file mode 100755 index 0000000..f510a32 --- /dev/null +++ b/sofort/tools/version.sh @@ -0,0 +1,72 @@ +#!/bin/sh + +set -eu + +usage() +{ +cat << EOF >&2 + +Usage: + -h show this HELP message + -s SRCDIR set source directory + -o OUTPUT set output header + -p PREFIX set macro prefix + +EOF +exit 1 +} + + +# one +workdir=$(pwd) +srcdir= +output= +prefix= + + +while getopts "hs:o:p:" opt; do + case $opt in + h) + usage + ;; + s) + srcdir="$OPTARG" + ;; + o) + output="$OPTARG" + ;; + p) + prefix="$OPTARG" + ;; + \?) + printf "Invalid option: -%s" "$OPTARG" >&2 + usage + ;; + esac +done + + +# two +if [ -z "$srcdir" ] || [ -z "$output" ] || [ -z "$prefix" ]; then + usage +fi + +cd "$srcdir" + +gitver=$(git rev-parse --verify HEAD 2>/dev/null) || gitver="unknown" +cvdate=$(git show -s --format=%ci $gitver 2>/dev/null) || cvdate=$(date) + +vmacro=$(printf '%s' "$prefix"'_GIT_VERSION' | tr '[:lower:]' '[:upper:]') +dmacro=$(printf '%s' "$prefix"'_GIT_DATE ' | tr '[:lower:]' '[:upper:]') + +cd "$workdir" + + +# three +printf '#define %s "%s"\n#define %s "%s"\n' \ + "$vmacro" "$gitver" \ + "$dmacro" "$cvdate" \ + > "$output" + +# all done +exit 0 diff --git a/sofort/version.mk b/sofort/version.mk deleted file mode 100644 index 5ef0ee2..0000000 --- a/sofort/version.mk +++ /dev/null @@ -1,63 +0,0 @@ -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) - -ifeq ($(AVOID_VERSION),yes) - -VER_XYZ = -VER_SONAME = - -package-shared-soname: -package-shared-solink: -package-install-soname: -package-install-solink: - -else - -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) -ifeq ($(OS_SONAME),symlink) -$(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) -endif - - -# libfoo.so.x (copy) -ifeq ($(OS_SONAME),copy) -install-soname: install-lib - cp $(SHARED_LIB) $(DESTDIR)$(LIBDIR)/$(DSO_SONAME) - -$(SHARED_SONAME): $(SHARED_LIB) - cp $(SHARED_LIB) $(SHARED_SONAME) -endif - -endif diff --git a/sofort/version.sh b/sofort/version.sh deleted file mode 100755 index f510a32..0000000 --- a/sofort/version.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/sh - -set -eu - -usage() -{ -cat << EOF >&2 - -Usage: - -h show this HELP message - -s SRCDIR set source directory - -o OUTPUT set output header - -p PREFIX set macro prefix - -EOF -exit 1 -} - - -# one -workdir=$(pwd) -srcdir= -output= -prefix= - - -while getopts "hs:o:p:" opt; do - case $opt in - h) - usage - ;; - s) - srcdir="$OPTARG" - ;; - o) - output="$OPTARG" - ;; - p) - prefix="$OPTARG" - ;; - \?) - printf "Invalid option: -%s" "$OPTARG" >&2 - usage - ;; - esac -done - - -# two -if [ -z "$srcdir" ] || [ -z "$output" ] || [ -z "$prefix" ]; then - usage -fi - -cd "$srcdir" - -gitver=$(git rev-parse --verify HEAD 2>/dev/null) || gitver="unknown" -cvdate=$(git show -s --format=%ci $gitver 2>/dev/null) || cvdate=$(date) - -vmacro=$(printf '%s' "$prefix"'_GIT_VERSION' | tr '[:lower:]' '[:upper:]') -dmacro=$(printf '%s' "$prefix"'_GIT_DATE ' | tr '[:lower:]' '[:upper:]') - -cd "$workdir" - - -# three -printf '#define %s "%s"\n#define %s "%s"\n' \ - "$vmacro" "$gitver" \ - "$dmacro" "$cvdate" \ - > "$output" - -# all done -exit 0 -- cgit v1.2.3