a40e0a build system: moved handling of pe-specific variables to ccenv.

Authored and Committed by midipix 6 years ago
    build system: moved handling of pe-specific variables to ccenv.
    
        
file modified
+4 -8
Makefile.in CHANGED
@@ -79,10 +79,6 @@ USER_CC = @user_cc@
79
79
USER_CPP = @user_cpp@
80
80
USER_CXX = @user_cxx@
81
81
82
- PE_SUBSYSTEM = @pe_subsystem@
83
- PE_IMAGE_BASE = @pe_image_base@
84
- PE_CONFIG_DEFS = @pe_config_defs@
85
-
86
82
NATIVE_HOST = @native_host@
87
83
NATIVE_CFGHOST = @native_cfghost@
88
84
NATIVE_CFLAGS = @native_cflags@
@@ -281,9 +277,10 @@ clean: clean-implib
281
277
rm -f build/$(PACKAGE).pc
282
278
283
279
284
- .display: .display-project .display-pkgconf .display-env \
285
- .display-tools .display-flags .display-pe \
286
- .display-dirs .display-build .display-config
280
+ .display: .display-project .display-pkgconf .display-env \
281
+ .display-tools .display-flags \
282
+ .display-dirs .display-build \
283
+ .display-config
287
284
288
285
.conf: PAGER ?= less
289
286
.conf:
@@ -375,7 +372,6 @@ clean: clean-implib
375
372
.display-pe:
376
373
@echo PE_SUBSYSTEM:' '$(PE_SUBSYSTEM)
377
374
@echo PE_IMAGE_BASE:' '$(PE_IMAGE_BASE)
378
- @echo PE_CONFIG_DEFS:' '$(PE_CONFIG_DEFS)
379
375
@echo
380
376
381
377
.display-dirs:
file modified
+0 -1
config.usage CHANGED
@@ -147,7 +147,6 @@ supported variables:
147
147
148
148
PE_SUBSYSTEM
149
149
PE_IMAGE_BASE
150
- PE_CONFIG_DEFS
151
150
152
151
NATIVE_CC
153
152
NATIVE_CPP
file modified
+3 -1
configure CHANGED
@@ -184,7 +184,6 @@ init_vars()
184
184
185
185
mb_pe_subsystem=$PE_SUBSYSTEM
186
186
mb_pe_image_base=$PE_IMAGE_BASE
187
- mb_pe_config_defs=$PE_CONFIG_DEFS
188
187
189
188
# overrides
190
189
mb_user_cc=$CC
@@ -199,6 +198,9 @@ init_vars()
199
198
mb_native_cfghost=$NATIVE_CFGHOST
200
199
mb_native_cflags=$NATIVE_CFLAGS
201
200
mb_native_ldflags=$NATIVE_LDFLAGS
201
+
202
+ mb_native_pe_subsystem=$NATIVE_PE_SUBSYSTEM
203
+ mb_native_pe_image_base=$NATIVE_PE_IMAGE_BASE
202
204
}
203
205
204
206
file modified
+28 -2
sofort/ccenv/ccenv.sh CHANGED
@@ -903,11 +903,30 @@ ccenv_set_os_dso_patterns()
903
903
esac
904
904
}
905
905
906
+ ccenv_set_os_pe_switches()
907
+ {
908
+ if [ "$ccenv_os" = 'PE' ] && [ -z "$ccenv_pe_subsystem" ]; then
909
+ case "$ccenv_os" in
910
+ midipix | mingw )
911
+ ccenv_pe_subsystem='windows'
912
+ ;;
913
+ * )
914
+ ccenv_pe_subsystem='console'
915
+ ;;
916
+ esac
917
+ fi
918
+ }
919
+
906
920
ccenv_output_defs()
907
921
{
908
922
ccenv_in="$mb_project_dir/sofort/ccenv/ccenv.in"
909
923
ccenv_mk="$mb_pwd/ccenv/$ccenv_cfgtype.mk"
910
924
925
+ if [ "$ccenv_cc_binfmt" = 'PE' ]; then
926
+ ccenv_pe="$mb_project_dir/sofort/ccenv/pedefs.in"
927
+ ccenv_in="$ccenv_in $ccenv_pe"
928
+ fi
929
+
911
930
if [ $ccenv_cfgtype = 'native' ]; then
912
931
913
932
ccenv_tmp=$(mktemp)
@@ -919,7 +938,7 @@ ccenv_output_defs()
919
938
-e 's/NATIVE_#/#/g' \
920
939
-e 's/ =/=/g' \
921
940
-e 's/ +=/+=/g' \
922
- "$ccenv_in" > "$ccenv_tmp"
941
+ $ccenv_in > "$ccenv_tmp"
923
942
924
943
ccenv_in="$ccenv_tmp"
925
944
fi
@@ -935,7 +954,7 @@ ccenv_output_defs()
935
954
"$__var" "'/g' "; \
936
955
done)"
937
956
938
- eval sed $ccenv_sed_substs "$ccenv_in" \
957
+ eval sed $ccenv_sed_substs $ccenv_in \
939
958
| sed -e 's/[ \t]*$//g' \
940
959
> "$ccenv_mk"
941
960
@@ -1015,12 +1034,18 @@ ccenv_common_init()
1015
1034
ccenv_cc="$mb_user_cc"
1016
1035
ccenv_cpp="$mb_user_cpp"
1017
1036
ccenv_cxx="$mb_user_cxx"
1037
+
1038
+ ccenv_pe_subsystem="$mb_pe_subsystem"
1039
+ ccenv_pe_image_base="$mb_pe_image_base"
1018
1040
else
1019
1041
ccenv_tflags=
1020
1042
ccenv_cflags="$mb_native_cflags"
1021
1043
ccenv_cc="$mb_native_cc"
1022
1044
ccenv_cpp="$mb_native_cpp"
1023
1045
ccenv_cxx="$mb_native_cxx"
1046
+
1047
+ ccenv_pe_subsystem="$mb_native_pe_subsystem"
1048
+ ccenv_pe_image_base="$mb_native_pe_image_base"
1024
1049
fi
1025
1050
}
1026
1051
@@ -1048,6 +1073,7 @@ ccenv_set_toolchain_variables()
1048
1073
ccenv_set_os_dso_exrules
1049
1074
ccenv_set_os_dso_linkage
1050
1075
ccenv_set_os_dso_patterns
1076
+ ccenv_set_os_pe_switches
1051
1077
1052
1078
ccenv_output_defs
1053
1079
ccenv_clean_up
file modified
+4 -0
sofort/ccenv/ccenv.vars CHANGED
@@ -80,3 +80,7 @@ ccenv_windrc=
80
80
# cflags
81
81
ccenv_cflags_os=
82
82
ccenv_cflags_pic=
83
+
84
+ # pe
85
+ ccenv_pe_subsystem=
86
+ ccenv_pe_image_base=
sofort/ccenv/pedefs.in ADDED
@@ -0,0 +1,4 @@
1
+ # @ccenv_cfgtype@ pe switches
2
+ PE_SUBSYSTEM = @ccenv_pe_subsystem@
3
+ PE_IMAGE_BASE = @ccenv_pe_image_base@
4
+
file modified
+3 -1
sofort/config/config.vars CHANGED
@@ -92,7 +92,6 @@ user_cxx
92
92
93
93
pe_subsystem
94
94
pe_image_base
95
- pe_config_defs
96
95
97
96
native_cc
98
97
native_cpp
@@ -103,6 +102,9 @@ native_cfghost
103
102
native_cflags
104
103
native_ldflags
105
104
105
+ native_pe_subsystem
106
+ native_pe_image_base
107
+
106
108
all_shared
107
109
all_static
108
110
disable_frontend