From 321aa59b957fc3b8c09f1840f8df78cd28658875 Mon Sep 17 00:00:00 2001 From: midipix Date: Jun 12 2021 10:45:10 +0000 Subject: build system: configure, ccenv: added --pkgconf[if] support and integration. --- diff --git a/config.usage b/config.usage index 98c36a6..33d1e58 100644 --- a/config.usage +++ b/config.usage @@ -75,6 +75,9 @@ supported switches: --shell --debug + --pkgconf + --pkgconfig + --strict --ccstrict --ldstrict @@ -142,6 +145,9 @@ supported variables: CROSS_COMPILE SHELL + PKGCONF + PKGCONFIG + CFLAGS CFLAGS_DEBUG CFLAGS_COMMON @@ -180,6 +186,9 @@ supported variables: NATIVE_CFLAGS NATIVE_LDFLAGS + NATIVE_PKGCONF + NATIVE_PKGCONFIG + NATIVE_OS NATIVE_OS_BITS NATIVE_OS_UNDERSCORE diff --git a/configure b/configure index bc7f9f7..d2283e0 100755 --- a/configure +++ b/configure @@ -186,6 +186,24 @@ init_vars() mb_makefile='Makefile' fi + # pkgconf (host) + if [ -z "${PKGCONF}" ]; then + PKGCONF="$mb_pkgconf" + fi + + if [ -z "${PKGCONF}" ]; then + PKGCONF="${PKGCONFIG}" + fi + + # pkgconf (native) + if [ -z "${NATIVE_PKGCONF}" ]; then + NATIVE_PKGCONF="$mb_native_pkgconf" + fi + + if [ -z "${NATIVE_PKGCONF}" ]; then + NATIVE_PKGCONF="${NATIVE_PKGCONFIG}" + fi + # project-specific initialization if [ _$mb_use_custom_cfginit = _yes ]; then . "$mb_project_dir/project/config/cfginit.sh" @@ -259,6 +277,9 @@ init_vars() mb_cross_compile=$CROSS_COMPILE mb_shell=$SHELL + # pkgconf + mb_pkgconf=$PKGCONF + # switches mb_cflags=$CFLAGS mb_cflags_debug=$CFLAGS_DEBUG @@ -303,6 +324,8 @@ init_vars() mb_native_cflags=$NATIVE_CFLAGS mb_native_ldflags=$NATIVE_LDFLAGS + mb_native_pkgconf=$NATIVE_PKGCONF + mb_native_pe_subsystem=$NATIVE_PE_SUBSYSTEM mb_native_pe_image_base=$NATIVE_PE_IMAGE_BASE @@ -1107,6 +1130,15 @@ for arg ; do mb_makemode=${arg#*=} ;; + #pkgconf[ig] + --pkgconf=*) + mb_pkgconf=${arg#*=} + ;; + + --pkgconfig=*) + mb_pkgconf=${arg#*=} + ;; + # build --build=*) mb_build=${arg#*=} diff --git a/sofort/ccenv/ccenv.in b/sofort/ccenv/ccenv.in index bfbb563..441f8ab 100644 --- a/sofort/ccenv/ccenv.in +++ b/sofort/ccenv/ccenv.in @@ -77,6 +77,8 @@ DLLTOOL = @ccenv_dlltool@ WINDMC = @ccenv_windmc@ WINDRC = @ccenv_windrc@ +PKGCONF = @ccenv_pkgconf@ + # @ccenv_cfgtype@ secondary tools # note: the direct use of $(@ccenv_makevar_prefix@LD) is highly discouraged AS = @ccenv_as@ diff --git a/sofort/ccenv/ccenv.sh b/sofort/ccenv/ccenv.sh index e66614a..26270f4 100644 --- a/sofort/ccenv/ccenv.sh +++ b/sofort/ccenv/ccenv.sh @@ -181,7 +181,7 @@ ccenv_set_primary_tools() { ccenv_core_tools="ar nm objdump ranlib size strip strings objcopy" ccenv_hack_tools="addr2line cov elfedit readelf readobj otool" - ccenv_peep_tools="perk mdso dlltool windmc windres" + ccenv_peep_tools="perk mdso dlltool windmc windres pkgconf" for __tool in $(printf '%s' "$ccenv_core_tools $ccenv_hack_tools $ccenv_peep_tools"); do ccenv_tool_prolog "$__tool" diff --git a/sofort/ccenv/ccenv.vars b/sofort/ccenv/ccenv.vars index 6cdd547..41eb327 100644 --- a/sofort/ccenv/ccenv.vars +++ b/sofort/ccenv/ccenv.vars @@ -80,6 +80,8 @@ ccenv_dlltool= ccenv_windmc= ccenv_windrc= +ccenv_pkgconf= + # cflags ccenv_cflags_os= ccenv_cflags_pic= diff --git a/sofort/config/config.vars b/sofort/config/config.vars index d8a5b2b..0c01a29 100644 --- a/sofort/config/config.vars +++ b/sofort/config/config.vars @@ -56,6 +56,9 @@ freestanding cross_compile shell +pkgconf +pkgconfig + prefix exec_prefix bindir @@ -126,6 +129,9 @@ native_cfghost native_cflags native_ldflags +native_pkgconf +native_pkgconfig + native_pe_subsystem native_pe_image_base