diff --git a/Makefile.in b/Makefile.in index 5ad6ff0..fb4f341 100644 --- a/Makefile.in +++ b/Makefile.in @@ -143,16 +143,16 @@ install-extras: install-app-extras: .cflags-host: - @true : $(CFLAGS) + @echo $(CFLAGS) .cflags-native: - @true : $(NATIVE_CFLAGS) + @echo $(NATIVE_CFLAGS) .ldflags-host: - @true : $(LDFLAGS_APP) + @echo $(LDFLAGS_APP) .ldflags-native: - @true : $(NATIVE_LDFLAGS) + @echo $(NATIVE_LDFLAGS) include ./ccenv/host.mk diff --git a/configure b/configure index 839d8b3..d36ca54 100755 --- a/configure +++ b/configure @@ -679,12 +679,12 @@ common_defaults() if [ -z "$mb_makemode" ]; then mb_makemode='posix' - printf '%s\n%s\n%s\n\n%s\n\n' \ - 'ifeq (a,b)' \ - 'VAR = val' \ - 'endif' \ - 'all:' \ - | ${mb_make} -s -f - 2>/dev/null \ + printf '%s\n%s\n%s\n\n%s\n\n' \ + 'ifeq (a,b)' \ + 'VAR = val' \ + 'endif' \ + 'all:' \ + | ${mb_make} -s -f - >/dev/null 2>&1 \ && mb_makemode='modern' fi @@ -914,10 +914,8 @@ config_host() mb_cfghost_cc="$ccenv_host_cc" mb_cfghost_tmpname='ccenv/c3RyaWN0X21vZGUK.c' - mb_cfghost_cflags=$(${mb_make} -n -f "$mb_makefile" \ - .cflags-host) - - mb_cfghost_cflags="${mb_cfghost_cflags#*: }" + mb_cfghost_cflags=$(${mb_make} -s -f "$mb_makefile" \ + .cflags-host | tail -1) if [ "$mb_cc_environment" = 'freestanding' ]; then if [ -z "mb_cc_underscore" ]; then @@ -955,7 +953,7 @@ config_host() printf '\n\n' >&3 # execute - if eval $mb_cfghost_cc "$ccenv_tmpname" -o a.out \ + if $mb_cfghost_cc "$ccenv_tmpname" -o a.out \ $(printf '%s' "$mb_cfghost_cflags") \ 2>&3; then rm a.out diff --git a/sofort/ccenv/ccenv.sh b/sofort/ccenv/ccenv.sh index 30e28fd..a331029 100644 --- a/sofort/ccenv/ccenv.sh +++ b/sofort/ccenv/ccenv.sh @@ -527,7 +527,7 @@ ccenv_set_cc() ccenv_host="$mb_native_host" elif [ -n "$ccenv_dumpmachine_switch" ]; then - ccenv_host=$(eval $ccenv_cc $(printf '%s' "$ccenv_cflags") \ + ccenv_host=$($ccenv_cc $(printf '%s' "$ccenv_cflags") \ $ccenv_dumpmachine_switch 2>&3) elif command -v slibtool > /dev/null 2>&1; then @@ -559,7 +559,7 @@ ccenv_set_cc() fi if [ -z "$ccenv_host" ] && [ -n "$ccenv_dumpmachine_switch" ]; then - ccenv_host=$(eval $ccenv_cc $(printf '%s' "$ccenv_cflags") \ + ccenv_host=$($ccenv_cc $(printf '%s' "$ccenv_cflags") \ $ccenv_dumpmachine_switch 2>&3) ccenv_cchost=$ccenv_host @@ -605,7 +605,7 @@ ccenv_set_cc() rm -f "$ccenv_tmp" unset ccenv_tmp - ccenv_cchost=$(eval $ccenv_cc $(printf '%s' "$ccenv_cflags") \ + ccenv_cchost=$($ccenv_cc $(printf '%s' "$ccenv_cflags") \ $ccenv_dumpmachine_switch 2>&3) fi @@ -775,7 +775,7 @@ ccenv_set_cc_bits() if [ "$ccenv_stdin_input" = 'yes' ]; then printf '%s' "$ccenv_internal_str" \ - | eval $ccenv_cc -S -xc - -o - \ + | $ccenv_cc -S -xc - -o - \ $(printf '%s' "$ccenv_cflags") \ > /dev/null 2>&3 \ && ccenv_internal_size=$ccenv_internal_guess @@ -1513,17 +1513,14 @@ ccenv_output_defs() if [ "${ccenv_cfgtype}" = 'host' ]; then - ccenv_cflags=$(${mb_make} -n -f "$mb_pwd/Makefile.tmp" .cflags-host) - ccenv_ldflags=$(${mb_make} -n -f "$mb_pwd/Makefile.tmp" .ldflags-host) + ccenv_cflags=$(${mb_make} -s -f "$mb_pwd/Makefile.tmp" .cflags-host | tail -1) + ccenv_ldflags=$(${mb_make} -s -f "$mb_pwd/Makefile.tmp" .ldflags-host | tail -1) else - ccenv_cflags=$(${mb_make} -n -f "$mb_pwd/Makefile.tmp" .cflags-native) - ccenv_ldflags=$(${mb_make} -n -f "$mb_pwd/Makefile.tmp" .ldflags-native) + ccenv_cflags=$(${mb_make} -s -f "$mb_pwd/Makefile.tmp" .cflags-native | tail -1) + ccenv_ldflags=$(${mb_make} -s -f "$mb_pwd/Makefile.tmp" .ldflags-native | tail -1) fi - ccenv_cflags="${ccenv_cflags#*: }" - ccenv_ldflags="${ccenv_ldflags#*: }" - - ccenv_sysroot=$(eval $ccenv_cc $(printf '%s' "$ccenv_cflags") \ + ccenv_sysroot=$($ccenv_cc $(printf '%s' "$ccenv_cflags") \ -print-sysroot 2>/dev/null || true) eval 'ccenv_'${ccenv_cfgtype}'_cflags'=\'$ccenv_cflags\' @@ -1734,13 +1731,11 @@ ccenv_common_init() if [ $ccenv_cfgtype = 'host' ]; then ccenv_tflags= - ccenv_cflags=$(${mb_make} -n -f "$mb_pwd/Makefile.tmp" \ + ccenv_cflags=$(${mb_make} -s -f "$mb_pwd/Makefile.tmp" \ OS_DSO_EXRULES=default \ OS_SONAME=symlink \ OS_ARCHIVE_EXT='.a' \ - .cflags-host) - - ccenv_cflags="${ccenv_cflags#*: }" + .cflags-host | tail -1) ccenv_cc="$mb_user_cc" ccenv_cpp="$mb_user_cpp" @@ -1750,13 +1745,11 @@ ccenv_common_init() ccenv_pe_image_base="$mb_pe_image_base" else ccenv_tflags= - ccenv_cflags=$(${mb_make} -n -f "$mb_pwd/Makefile.tmp" \ + ccenv_cflags=$(${mb_make} -s -f "$mb_pwd/Makefile.tmp" \ OS_DSO_EXRULES=default \ OS_SONAME=symlink \ OS_ARCHIVE_EXT='.a' \ - .cflags-native) - - ccenv_cflags="${ccenv_cflags#*: }" + .cflags-native | tail -1) ccenv_cc="$mb_native_cc" ccenv_cpp="$mb_native_cpp" diff --git a/sofort/cfgtest/cfgtest.sh b/sofort/cfgtest/cfgtest.sh index 8e1db07..eb8d00f 100644 --- a/sofort/cfgtest/cfgtest.sh +++ b/sofort/cfgtest/cfgtest.sh @@ -44,21 +44,17 @@ cfgtest_host_section() mb_cfgtest_stdin_input=${ccenv_host_stdin_input:-} mb_cfgtest_environment=${ccenv_host_cc_environment:-} - mb_cfgtest_cflags=$(${mb_make} -n -f "$mb_pwd/Makefile.tmp" \ + mb_cfgtest_cflags=$(${mb_make} -s -f "$mb_pwd/Makefile.tmp" \ OS_DSO_EXRULES=default \ OS_SONAME=symlink \ OS_ARCHIVE_EXT='.a' \ - .cflags-host) + .cflags-host | tail -1) - mb_cfgtest_cflags="${mb_cfgtest_cflags#*: }" - - mb_cfgtest_ldflags=$(${mb_make} -n -f "$mb_pwd/Makefile.tmp" \ + mb_cfgtest_ldflags=$(${mb_make} -s -f "$mb_pwd/Makefile.tmp" \ OS_DSO_EXRULES=default \ OS_SONAME=symlink \ OS_ARCHIVE_EXT='.a' \ - .ldflags-host) - - mb_cfgtest_ldflags="${mb_cfgtest_ldflags#*: }" + .ldflags-host | tail -1) } @@ -70,21 +66,17 @@ cfgtest_native_section() mb_cfgtest_stdin_input=${ccenv_native_stdin_input:-} mb_cfgtest_environment=${ccenv_native_cc_environment:-} - mb_cfgtest_cflags=$(${mb_make} -n -f "$mb_pwd/Makefile.tmp" \ + mb_cfgtest_cflags=$(${mb_make} -s -f "$mb_pwd/Makefile.tmp" \ OS_DSO_EXRULES=default \ OS_SONAME=symlink \ OS_ARCHIVE_EXT='.a' \ - .cflags-native) + .cflags-native | tail -1) - mb_cfgtest_cflags="${mb_cfgtest_cflags#*: }" - - mb_cfgtest_ldflags=$(${mb_make} -n -f "$mb_pwd/Makefile.tmp" \ + mb_cfgtest_ldflags=$(${mb_make} -s -f "$mb_pwd/Makefile.tmp" \ OS_DSO_EXRULES=default \ OS_SONAME=symlink \ OS_ARCHIVE_EXT='.a' \ - .ldflags-native) - - mb_cfgtest_ldflags="${mb_cfgtest_ldflags#*: }" + .ldflags-native | tail -1) } @@ -352,7 +344,7 @@ cfgtest_header_presence() # execute printf '%s\n' "$cfgtest_src" \ - | eval $(printf '%s' "$cfgtest_cmd") \ + | $(printf '%s' "$cfgtest_cmd") \ > /dev/null 2>&3 \ || cfgtest_epilog 'header' '-----' "<${1}>" \ || return @@ -392,7 +384,7 @@ cfgtest_header_absence() # execute printf '%s\n' "$cfgtest_src" \ - | eval $(printf '%s' "$cfgtest_cmd") \ + | $(printf '%s' "$cfgtest_cmd") \ > /dev/null 2>&3 \ && printf 'cfgtest: %s header <%s>: no error.' \ "$mb_cfgtest_cfgtype" "${1}" >&3 \ @@ -429,7 +421,7 @@ cfgtest_interface_presence() # execute printf '%s\n' "$cfgtest_src" \ - | eval $(printf '%s' "$cfgtest_cmd") \ + | $(printf '%s' "$cfgtest_cmd") \ > /dev/null 2>&3 \ || cfgtest_epilog 'interface' '(error)' "${1}" \ || return @@ -466,7 +458,7 @@ cfgtest_decl_presence() # execute printf '%s\n' "$cfgtest_src" \ - | eval $(printf '%s' "$cfgtest_cmd") \ + | $(printf '%s' "$cfgtest_cmd") \ > /dev/null 2>&3 \ || cfgtest_epilog 'decl' '(error)' "${1}" \ || return @@ -519,7 +511,7 @@ cfgtest_type_size() cfgtest_common_init printf '%s\n' "$cfgtest_src" \ - | eval $(printf '%s' "$cfgtest_cmd") \ + | $(printf '%s' "$cfgtest_cmd") \ > /dev/null 2>&3 \ && mb_internal_size=$mb_internal_guess @@ -570,7 +562,7 @@ cfgtest_attr_visibility() cfgtest_ret=1 printf '%s\n' "$cfgtest_src" \ - | eval $(printf '%s' "$cfgtest_cmd") \ + | $(printf '%s' "$cfgtest_cmd") \ > /dev/null 2>&3 \ || cfgtest_epilog 'attr' '(error)' "${1}" \ || return @@ -602,7 +594,7 @@ cfgtest_code_snippet_asm() cfgtest_ret=1 printf '%s\n' "$cfgtest_src" \ - | eval $(printf '%s' "$cfgtest_cmd") \ + | $(printf '%s' "$cfgtest_cmd") \ > /dev/null 2>&3 \ || cfgtest_epilog 'snippet' '(error)' \ || return @@ -635,7 +627,7 @@ cfgtest_macro_definition() cfgtest_ret=1 printf '%s\n' "$cfgtest_src" \ - | eval $(printf '%s' "$cfgtest_cmd") \ + | $(printf '%s' "$cfgtest_cmd") \ > /dev/null 2>&3 \ || cfgtest_epilog 'macro' '(error)' "${1}" \ || return @@ -683,7 +675,7 @@ cfgtest_library_presence() # execute printf '%s\n' "$cfgtest_src" \ - | eval $(printf '%s' "$cfgtest_cmd") \ + | $(printf '%s' "$cfgtest_cmd") \ > /dev/null 2>&3 \ || cfgtest_epilog 'library' '-----' "$@" \ || return 1 @@ -867,7 +859,7 @@ cfgtest_compiler_switch() # execute printf '%s\n' "$cfgtest_src" \ - | eval $(printf '%s' "$cfgtest_cmd") \ + | $(printf '%s' "$cfgtest_cmd") \ > /dev/null 2>&3 \ || cfgtest_epilog 'switch' '(error)' "$@" \ || return 1