summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-12-28 08:08:19 -0500
committermidipix <writeonce@midipix.org>2018-12-30 17:55:42 -0500
commit5a4c0683c14004a51b9ad3cded0791e46cd1e5bb (patch)
treedd5147ebb54e29aacedad70bdb2ba466de12ad3f
parent82c65f38ae4ea04519599addb3c4124faf51b7af (diff)
downloadbcparser-5a4c0683c14004a51b9ad3cded0791e46cd1e5bb.tar.bz2
bcparser-5a4c0683c14004a51b9ad3cded0791e46cd1e5bb.tar.xz
build system: streamlined config.vars and variable initialization.
-rwxr-xr-xconfigure137
-rw-r--r--sofort/config.vars304
-rw-r--r--sofort/flag.vars22
3 files changed, 162 insertions, 301 deletions
diff --git a/configure b/configure
index abb0750..49596b9 100755
--- a/configure
+++ b/configure
@@ -50,9 +50,21 @@ init_vars()
mb_custom_cfgdefs_args=''
mb_custom_cfgdefs_space=''
- mb_vars=$(cat $mb_project_dir/sofort/config.vars | grep -v '^#')
+ mb_make_vars=$(cat $mb_project_dir/sofort/config.vars \
+ | grep -v -e '^#' -e '^$' | tr '[:lower:]' '[:upper:]')
- for mb_var in $mb_vars; do
+ mb_impl_vars=$(cat $mb_project_dir/sofort/config.vars \
+ | grep -v -e '^#' -e '^$' | sed 's/^/mb_/g')
+
+ mb_proj_vars=$(cat $mb_project_dir/sofort/config.vars \
+ | grep -v -e '^#' -e '^$' | sed 's/^/mb_default_/g')
+
+ mb_flag_vars=$(cat $mb_project_dir/sofort/flag.vars \
+ | grep -v -e '^#' -e '^$')
+
+ mb_vars="$mb_make_vars $mb_impl_vars $mb_proj_vars $mb_flag_vars"
+
+ for mb_var in $mb_vars ; do
mb_expr=$mb_var='${'$mb_var':-}'
eval "$mb_expr"
done
@@ -492,114 +504,19 @@ config_flags()
config_copy()
{
- sed -e 's^@package@^'"$mb_package"'^g' \
- -e 's^@nickname@^'"$mb_nickname"'^g' \
- -e 's^@project_dir@^'"$mb_project_dir"'^g' \
- -e 's^@source_dir@^'"$mb_source_dir"'^g' \
- -e 's^@git_reference_index@^'"$mb_git_reference_index"'^g' \
- -e 's^@custom_install_headers@^'"$mb_custom_install_headers"'^g' \
- -e 's^@avoid_version@^'"$mb_avoid_version"'^g' \
- \
- -e 's^@pkgname@^'"$mb_pkgname"'^g' \
- -e 's^@pkgdesc@^'"$mb_pkgdesc"'^g' \
- -e 's^@pkgusrc@^'"$mb_pkgusrc"'^g' \
- -e 's^@pkgrepo@^'"$mb_pkgrepo"'^g' \
- -e 's^@pkgpsrc@^'"$mb_pkgpsrc"'^g' \
- -e 's^@pkgdurl@^'"$mb_pkgdurl"'^g' \
- -e 's^@pkgdefs@^'"$mb_pkgdefs"'^g' \
- -e 's^@pkglibs@^'"$mb_pkglibs"'^g' \
- \
- -e 's^@build@^'"$mb_build"'^g' \
- -e 's^@host@^'"$mb_host"'^g' \
- -e 's^@target@^'"$mb_target"'^g' \
- -e 's^@arch@^'"$mb_arch"'^g' \
- -e 's^@compiler@^'"$mb_compiler"'^g' \
- -e 's^@toolchain@^'"$mb_toolchain"'^g' \
- -e 's^@sysroot@^'"$mb_sysroot"'^g' \
- -e 's^@cross_compile@^'"$mb_cross_compile"'^g' \
- -e 's^@shell@^'"$mb_shell"'^g' \
- \
- -e 's^@cflags@^'"$mb_cflags"'^g' \
- -e 's^@cflags_debug@^'"$mb_cflags_debug"'^g' \
- -e 's^@cflags_common@^'"$mb_cflags_common"'^g' \
- -e 's^@cflags_cmdline@^'"$mb_cflags $mb_cflags_cmdline"'^g' \
- -e 's^@cflags_config@^'"$mb_cflags_config"'^g' \
- -e 's^@cflags_sysroot@^'"$mb_cflags_sysroot"'^g' \
- -e 's^@cflags_os@^'"$mb_cflags_os"'^g' \
- -e 's^@cflags_site@^'"$mb_cflags_site"'^g' \
- -e 's^@cflags_path@^'"$mb_cflags_path"'^g' \
- -e 's^@cflags_strict@^'"$mb_cflags_strict"'^g' \
- -e 's^@cflags_util@^'"$mb_cflags_util"'^g' \
- -e 's^@cflags_last@^'"$mb_cflags_last"'^g' \
- -e 's^@cflags_once@^'"$mb_cflags_once"'^g' \
- \
- -e 's^@ldflags@^'"$mb_ldflags"'^g' \
- -e 's^@ldflags_debug@^'"$mb_ldflags_debug"'^g' \
- -e 's^@ldflags_common@^'"$mb_ldflags_common"'^g' \
- -e 's^@ldflags_cmdline@^'"$mb_ldflags $mb_ldflags_cmdline"'^g' \
- -e 's^@ldflags_config@^'"$mb_ldflags_config"'^g' \
- -e 's^@ldflags_sysroot@^'"$mb_ldflags_sysroot"'^g' \
- -e 's^@ldflags_path@^'"$mb_ldflags_path"'^g' \
- -e 's^@ldflags_strict@^'"$mb_ldflags_strict"'^g' \
- -e 's^@ldflags_util@^'"$mb_ldflags_util"'^g' \
- -e 's^@ldflags_last@^'"$mb_ldflags_last"'^g' \
- -e 's^@ldflags_once@^'"$mb_ldflags_once"'^g' \
- \
- -e 's^@pe_subsystem@^'"$mb_pe_subsystem"'^g' \
- -e 's^@pe_image\_base@^'"$mb_pe_image_base"'^g' \
- -e 's^@pe_config\_defs@^'"$mb_pe_config_defs"'^g' \
- \
- -e 's^@elf_eh\_frame@^'"$mb_elf_eh_frame"'^g' \
- -e 's^@elf_hash\_style@^'"$mb_elf_hash_style"'^g' \
- -e 's^@elf_config\_defs@^'"$mb_elf_config_defs"'^g' \
- \
- -e 's^@prefix@^'"$mb_prefix"'^g' \
- -e 's^@exec_prefix@^'"$mb_exec_prefix"'^g' \
- -e 's^@bindir@^'"$mb_bindir"'^g' \
- -e 's^@sbindir@^'"$mb_sbindir"'^g' \
- -e 's^@libdir@^'"$mb_libdir"'^g' \
- -e 's^@includedir@^'"$mb_includedir"'^g' \
- -e 's^@oldincludedir@^'"$mb_oldincludedir"'^g' \
- -e 's^@mandir@^'"$mb_mandir"'^g' \
- -e 's^@docdir@^'"$mb_docdir"'^g' \
- -e 's^@libexecdir@^'"$mb_libexecdir"'^g' \
- \
- -e 's^@sysconfdir@^'"$mb_sysconfdir"'^g' \
- -e 's^@sharedstatedir@^'"$mb_sharedstatedir"'^g' \
- -e 's^@localstatedir@^'"$mb_localstatedir"'^g' \
- -e 's^@runstatedir@^'"$mb_runstatedir"'^g' \
- -e 's^@datarootdir@^'"$mb_datarootdir"'^g' \
- -e 's^@datadir@^'"$mb_datadir"'^g' \
- -e 's^@infodir@^'"$mb_infodir"'^g' \
- -e 's^@localedir@^'"$mb_localedir"'^g' \
- -e 's^@htmldir@^'"$mb_htmldir"'^g' \
- -e 's^@dvidir@^'"$mb_dvidir"'^g' \
- -e 's^@pdfdir@^'"$mb_pdfdir"'^g' \
- -e 's^@psdir@^'"$mb_psdir"'^g' \
- \
- -e 's^@native_cc@^'"$mb_native_cc"'^g' \
- -e 's^@native_cc_host@^'"$mb_native_cc_host"'^g' \
- -e 's^@native_cc_cfghost@^'"$mb_native_cc_cfghost"'^g' \
- -e 's^@native_cc_cflags@^'"$mb_native_cc_cflags"'^g' \
- -e 's^@native_cc_ldflags@^'"$mb_native_cc_ldflags"'^g' \
- \
- -e 's^@native_os@^'"$mb_native_os"'^g' \
- -e 's^@native_os_bits@^'"$mb_native_os_bits"'^g' \
- -e 's^@native_os_underscore@^'"$mb_native_os_underscore"'^g' \
- \
- -e 's^@user_cc@^'"$mb_user_cc"'^g' \
- -e 's^@user_cpp@^'"$mb_user_cpp"'^g' \
- -e 's^@user_cxx@^'"$mb_user_cxx"'^g' \
- \
- -e 's^@all_static@^'"$mb_all_static"'^g' \
- -e 's^@all_shared@^'"$mb_all_shared"'^g' \
- -e 's^@disable_frontend@^'"$mb_disable_frontend"'^g' \
- -e 's^@disable_static@^'"$mb_disable_static"'^g' \
- -e 's^@disable_shared@^'"$mb_disable_shared"'^g' \
- \
- -e 's^@use_custom_cfgdefs@^'"$mb_use_custom_cfgdefs"'^g' \
- -e 's^@use_custom_usrdefs@^'"$mb_use_custom_usrdefs"'^g' \
- $mb_project_dir/Makefile.in > $mb_pwd/Makefile.tmp
+ mb_vars=$(cut -d'=' -f1 "$mb_project_dir/sofort/config.vars" \
+ | grep -v '^#')
+
+ mb_sed_substs=" \
+ $(for __var in $mb_vars; do \
+ printf '%s"$%s"%s' "-e 's^@$__var@^'" \
+ "mb_$__var" "'^g' "; \
+ done)"
+
+ eval sed $mb_sed_substs \
+ $mb_project_dir/Makefile.in \
+ | sed -e 's/[ \t]*$//g' \
+ > $mb_pwd/Makefile.tmp
if [ -z "$mb_cchost" ]; then
if [ "$mb_host" = 'native' ]; then
diff --git a/sofort/config.vars b/sofort/config.vars
index 0189c6e..c4b3358 100644
--- a/sofort/config.vars
+++ b/sofort/config.vars
@@ -1,191 +1,113 @@
-NICKNAME
-SOURCE_DIR
-
-PREFIX
-EXEC_PREFIX
-BINDIR
-SBINDIR
-LIBDIR
-INCLUDEDIR
-OLDINCLUDEDIR
-MANDIR
-DOCDIR
-LIBEXECDIR
-
-SYSCONFDIR
-SHAREDSTATEDIR
-LOCALSTATEDIR
-RUNSTATEDIR
-DATAROOTDIR
-DATADIR
-INFODIR
-LOCALEDIR
-HTMLDIR
-DVIDIR
-PDFDIR
-PSDIR
-
-CC
-CPP
-CXX
-
-BUILD
-HOST
-CCHOST
-CFGHOST
-TARGET
-ARCH
-COMPILER
-TOOLCHAIN
-SYSROOT
-CROSS_COMPILE
-SHELL
-
-CFLAGS
-CFLAGS_DEBUG
-CFLAGS_COMMON
-CFLAGS_CMDLINE
-CFLAGS_CONFIG
-CFLAGS_SYSROOT
-CFLAGS_OS
-CFLAGS_SITE
-CFLAGS_PATH
-CFLAGS_STRICT
-CFLAGS_UTIL
-CFLAGS_LAST
-CFLAGS_ONCE
-
-LDFLAGS
-LDFLAGS_DEBUG
-LDFLAGS_COMMON
-LDFLAGS_CMDLINE
-LDFLAGS_CONFIG
-LDFLAGS_SYSROOT
-LDFLAGS_PATH
-LDFLAGS_STRICT
-LDFLAGS_UTIL
-LDFLAGS_LAST
-LDFLAGS_ONCE
-
-PE_SUBSYSTEM
-PE_IMAGE_BASE
-PE_CONFIG_DEFS
-
-ELF_EH_FRAME
-ELF_HASH_STYLE
-ELF_CONFIG_DEFS
-
-NATIVE_CC
-NATIVE_CC_HOST
-NATIVE_CC_CFGHOST
-NATIVE_CC_CFLAGS
-NATIVE_CC_LDFLAGS
-
-NATIVE_OS
-NATIVE_OS_BITS
-NATIVE_OS_UNDERSCORE
-
-# config
-mb_config
-mb_debug
-mb_require_out_of_tree
-mb_require_source_dir
-
-mb_use_custom_cfgdefs
-mb_use_custom_usrdefs
-
-# flags
-mb_prefix_set
-mb_exec_prefix_set
-mb_bindir_set
-
-# project
-mb_package
-mb_require_out_of_tree
-mb_custom_install_headers
-mb_avoid_version
-
-# pkgconfig
-mb_pkgname
-mb_pkgdesc
-mb_pkgusrc
-mb_pkgrepo
-mb_pkgpsrc
-mb_pkgdurl
-mb_pkgdefs
-mb_pkglibs
-
-# config
-mb_all_static
-mb_all_shared
-mb_disable_frontend
-mb_disable_static
-mb_disable_shared
-
-# misc
-mb_ccstrict
-mb_ldstrict
-mb_program_prefix
-mb_bindir_basename
-mb_git_reference_index
-
-# defaults
-mb_default_build
-mb_default_host
-mb_default_cchost
-mb_default_cfghost
-mb_default_target
-mb_default_arch
-mb_default_compiler
-mb_default_toolchain
-mb_default_sysroot
-mb_default_cross_compile
-mb_default_shell
-
-mb_default_cflags_debug
-mb_default_cflags_common
-mb_default_cflags_cmdline
-mb_default_cflags_config
-mb_default_cflags_sysroot
-mb_default_cflags_os
-mb_default_cflags_site
-mb_default_cflags_path
-mb_default_cflags_strict
-mb_default_cflags_util
-mb_default_cflags_last
-mb_default_cflags_once
-
-mb_default_ldflags_debug
-mb_default_ldflags_common
-mb_default_ldflags_cmdline
-mb_default_ldflags_config
-mb_default_ldflags_sysroot
-mb_default_ldflags_path
-mb_default_ldflags_strict
-mb_default_ldflags_util
-mb_default_ldflags_last
-mb_default_ldflags_once
-
-mb_default_pe_subsystem
-mb_default_pe_image_base
-mb_default_pe_config_defs
-
-mb_default_elf_eh_frame
-mb_default_elf_hash_style
-mb_default_elf_config_defs
-
-mb_default_pkgname
-mb_default_pkgdesc
-mb_default_pkgusrc
-mb_default_pkgrepo
-mb_default_pkgpsrc
-mb_default_pkgdurl
-mb_default_pkgdefs
-mb_default_pkglibs
-
-# cfgtest
-mb_cfgtest_cc
-mb_cfgtest_cflags
-mb_cfgtest_cfgtype
-mb_cfgtest_makevar
-mb_cfgtest_headers
+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
+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_cc_host
+native_cc_cfghost
+native_cc_cflags
+native_cc_ldflags
+
+native_os
+native_os_bits
+native_os_underscore
+
+all_shared
+all_static
+disable_frontend
+disable_shared
+disable_static
+
+use_custom_cfgdefs
+use_custom_usrdefs
diff --git a/sofort/flag.vars b/sofort/flag.vars
new file mode 100644
index 0000000..798096b
--- /dev/null
+++ b/sofort/flag.vars
@@ -0,0 +1,22 @@
+# 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
+
+# cfgtest
+mb_cfgtest_cc
+mb_cfgtest_cflags
+mb_cfgtest_cfgtype
+mb_cfgtest_makevar
+mb_cfgtest_headers