File diff r5586:c50e3258a19f → r5587:034e5e185dc2
config.lib
Show inline comments
 
@@ -9,12 +9,13 @@ set_default() {
 
	# We set all kinds of defaults for params. Later on the user can override
 
	# most of them; but if they don't, this default is used.
 
	build=""
 
	host=""
 
	cc_build=""
 
	cc_host=""
 
	cxx_build=""
 
	cxx_host=""
 
	windres=""
 
	strip=""
 
	lipo=""
 
	os="DETECT"
 
	endian="AUTO"
 
@@ -51,13 +52,13 @@ set_default() {
 
	with_iconv="1"
 
	with_midi=""
 
	with_midi_arg=""
 
	with_freetype="1"
 
	with_fontconfig="1"
 

	
 
	save_params_array="build host cc_build cc_host cxx_host windres strip lipo os revision endian config_log prefix_dir binary_dir data_dir icon_dir personal_dir install_dir custom_lang_dir second_data_dir enable_install enable_debug enable_profiling enable_dedicated enable_network enable_static enable_translator enable_assert enable_strip with_osx_sysroot enable_universal enable_osx_g5 with_application_bundle with_sdl with_cocoa with_zlib with_png with_makedepend with_direct_music with_sort with_iconv with_midi with_midi_arg with_freetype with_fontconfig CC CXX CFLAGS LDFLAGS"
 
	save_params_array="build host cc_build cc_host cxx_build cxx_host windres strip lipo os revision endian config_log prefix_dir binary_dir data_dir icon_dir personal_dir install_dir custom_lang_dir second_data_dir enable_install enable_debug enable_profiling enable_dedicated enable_network enable_static enable_translator enable_assert enable_strip with_osx_sysroot enable_universal enable_osx_g5 with_application_bundle with_sdl with_cocoa with_zlib with_png with_makedepend with_direct_music with_sort with_iconv with_midi with_midi_arg with_freetype with_fontconfig CC CXX CFLAGS LDFLAGS"
 
}
 

	
 
detect_params() {
 
	# Walk over all params from the user and override any default settings if
 
	#  needed. This also handles any invalid option.
 
	for p in "$@"; do
 
@@ -87,12 +88,14 @@ detect_params() {
 
			--revision=*)                 revision="$optarg";;
 

	
 
			--cc-build)                   prevp_p="cc_build";;
 
			--cc-build=*)                 cc_build="$optarg";;
 
			--cc-host)                    prevp_p="cc_host";;
 
			--cc-host=*)                  cc_host="$optarg";;
 
			--cxx-build)                  prevp_p="cxx_build";;
 
			--cxx-build=*)                cxx_build="$optarg";;
 
			--cxx-host)                   prevp_p="cxx_host";;
 
			--cxx-host=*)                 cxx_host="$optarg";;
 
			--windres)                    prevp_p="windres";;
 
			--windres=*)                  windres="$optarg";;
 
			--strip)                      prevp_p="strip";;
 
			--strip=*)                    strip="$optarg";;
 
@@ -317,13 +320,14 @@ check_params() {
 
	fi
 

	
 
	# Already detected by check_build
 
	log 1 "checking for build gcc... $cc_build"
 
	log 1 "checking for host gcc... $cc_host"
 

	
 
	check_cxx
 
	check_cxx_build
 
	check_cxx_host
 
	check_windres
 
	check_strip
 
	check_lipo
 
	check_makedepend
 

	
 
	if [ "$enable_static" = "1" ]; then
 
@@ -532,13 +536,13 @@ check_params() {
 
			log 1 "detecting G5... yes (forced)"
 
		else
 
			# First, are we a real OSX system, else we can't detect it
 
			native=`LC_ALL=C uname | tr [:upper:] [:lower:] | grep darwin`
 
			# If $host doesn't match $build , we are cross-compiling
 
			if [ -n "$native" ] && [ "$build" != "$host" ]; then
 
				$cc_build $SRC_DIR/os/macosx/G5_detector.c -o G5_detector
 
				$cc_build $SRC_DIR/os/macosx/G5_detector.cpp -o G5_detector
 
				res=`./G5_detector`
 
				rm -f G5_detector
 
				if [ -n "$res" ]; then
 
					# This is G5, add flags for it
 
					enable_osx_g5="2"
 

	
 
@@ -978,13 +982,19 @@ check_build() {
 
check_host() {
 
	# By default the host is the build
 
	if [ -z "$host" ]; then host="$build"; fi
 
	check_compiler "host system type" "cc_host" "$host" "$cc_host" "$CC" "gcc" "cc" "0" "-dumpmachine"
 
}
 

	
 
check_cxx() {
 
check_cxx_build() {
 
	check_compiler "build g++" "cxx_build" "$build" "$cxx_build" "$CXX" "g++" "c++" 1 "-dumpmachine"
 
}
 

	
 
check_cxx_host() {
 
	# By default the host is the build
 
	if [ -z "$host" ]; then host="$build"; fi
 
	check_compiler "host g++" "cxx_host" "$host" "$cxx_host" "$CXX" "g++" "c++" 1 "-dumpmachine"
 
}
 

	
 
check_windres() {
 
	if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
 
		check_compiler "host windres" "windres" "$host" "$windres" "$WINDRES" "windres" "windres" "2" "-V"
 
@@ -1581,12 +1591,13 @@ make_sed() {
 
	#  use multiple OBJS_DIR, because all in-between
 
	#  binaries are stored in there, and nowhere else.
 
	SRC_REPLACE="
 
		s#!!CC_HOST!!#$cc_host#g;
 
		s#!!CXX_HOST!!#$cxx_host#g;
 
		s#!!CC_BUILD!!#$cc_build#g;
 
		s#!!CXX_BUILD!!#$cxx_build#g;
 
		s#!!WINDRES!!#$windres#g;
 
		s#!!STRIP!!#$strip $strip_arg#g;
 
		s#!!LIPO!!#$lipo#g;
 
		s#!!CC_CFLAGS!!#$CC_CFLAGS#g;
 
		s#!!CFLAGS!!#$T_CFLAGS#g;
 
		s#!!CFLAGS_BUILD!!#$CFLAGS_BUILD#g;