config.lib
changeset 5587 167d9a91ef02
parent 5578 5f898d0bfebd
child 5753 553170b2ff57
equal deleted inserted replaced
5586:2d4126d81ebb 5587:167d9a91ef02
    10 	# most of them; but if they don't, this default is used.
    10 	# most of them; but if they don't, this default is used.
    11 	build=""
    11 	build=""
    12 	host=""
    12 	host=""
    13 	cc_build=""
    13 	cc_build=""
    14 	cc_host=""
    14 	cc_host=""
       
    15 	cxx_build=""
    15 	cxx_host=""
    16 	cxx_host=""
    16 	windres=""
    17 	windres=""
    17 	strip=""
    18 	strip=""
    18 	lipo=""
    19 	lipo=""
    19 	os="DETECT"
    20 	os="DETECT"
    52 	with_midi=""
    53 	with_midi=""
    53 	with_midi_arg=""
    54 	with_midi_arg=""
    54 	with_freetype="1"
    55 	with_freetype="1"
    55 	with_fontconfig="1"
    56 	with_fontconfig="1"
    56 
    57 
    57 	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"
    58 	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"
    58 }
    59 }
    59 
    60 
    60 detect_params() {
    61 detect_params() {
    61 	# Walk over all params from the user and override any default settings if
    62 	# Walk over all params from the user and override any default settings if
    62 	#  needed. This also handles any invalid option.
    63 	#  needed. This also handles any invalid option.
    88 
    89 
    89 			--cc-build)                   prevp_p="cc_build";;
    90 			--cc-build)                   prevp_p="cc_build";;
    90 			--cc-build=*)                 cc_build="$optarg";;
    91 			--cc-build=*)                 cc_build="$optarg";;
    91 			--cc-host)                    prevp_p="cc_host";;
    92 			--cc-host)                    prevp_p="cc_host";;
    92 			--cc-host=*)                  cc_host="$optarg";;
    93 			--cc-host=*)                  cc_host="$optarg";;
       
    94 			--cxx-build)                  prevp_p="cxx_build";;
       
    95 			--cxx-build=*)                cxx_build="$optarg";;
    93 			--cxx-host)                   prevp_p="cxx_host";;
    96 			--cxx-host)                   prevp_p="cxx_host";;
    94 			--cxx-host=*)                 cxx_host="$optarg";;
    97 			--cxx-host=*)                 cxx_host="$optarg";;
    95 			--windres)                    prevp_p="windres";;
    98 			--windres)                    prevp_p="windres";;
    96 			--windres=*)                  windres="$optarg";;
    99 			--windres=*)                  windres="$optarg";;
    97 			--strip)                      prevp_p="strip";;
   100 			--strip)                      prevp_p="strip";;
   318 
   321 
   319 	# Already detected by check_build
   322 	# Already detected by check_build
   320 	log 1 "checking for build gcc... $cc_build"
   323 	log 1 "checking for build gcc... $cc_build"
   321 	log 1 "checking for host gcc... $cc_host"
   324 	log 1 "checking for host gcc... $cc_host"
   322 
   325 
   323 	check_cxx
   326 	check_cxx_build
       
   327 	check_cxx_host
   324 	check_windres
   328 	check_windres
   325 	check_strip
   329 	check_strip
   326 	check_lipo
   330 	check_lipo
   327 	check_makedepend
   331 	check_makedepend
   328 
   332 
   533 		else
   537 		else
   534 			# First, are we a real OSX system, else we can't detect it
   538 			# First, are we a real OSX system, else we can't detect it
   535 			native=`LC_ALL=C uname | tr [:upper:] [:lower:] | grep darwin`
   539 			native=`LC_ALL=C uname | tr [:upper:] [:lower:] | grep darwin`
   536 			# If $host doesn't match $build , we are cross-compiling
   540 			# If $host doesn't match $build , we are cross-compiling
   537 			if [ -n "$native" ] && [ "$build" != "$host" ]; then
   541 			if [ -n "$native" ] && [ "$build" != "$host" ]; then
   538 				$cc_build $SRC_DIR/os/macosx/G5_detector.c -o G5_detector
   542 				$cc_build $SRC_DIR/os/macosx/G5_detector.cpp -o G5_detector
   539 				res=`./G5_detector`
   543 				res=`./G5_detector`
   540 				rm -f G5_detector
   544 				rm -f G5_detector
   541 				if [ -n "$res" ]; then
   545 				if [ -n "$res" ]; then
   542 					# This is G5, add flags for it
   546 					# This is G5, add flags for it
   543 					enable_osx_g5="2"
   547 					enable_osx_g5="2"
   979 	# By default the host is the build
   983 	# By default the host is the build
   980 	if [ -z "$host" ]; then host="$build"; fi
   984 	if [ -z "$host" ]; then host="$build"; fi
   981 	check_compiler "host system type" "cc_host" "$host" "$cc_host" "$CC" "gcc" "cc" "0" "-dumpmachine"
   985 	check_compiler "host system type" "cc_host" "$host" "$cc_host" "$CC" "gcc" "cc" "0" "-dumpmachine"
   982 }
   986 }
   983 
   987 
   984 check_cxx() {
   988 check_cxx_build() {
       
   989 	check_compiler "build g++" "cxx_build" "$build" "$cxx_build" "$CXX" "g++" "c++" 1 "-dumpmachine"
       
   990 }
       
   991 
       
   992 check_cxx_host() {
       
   993 	# By default the host is the build
       
   994 	if [ -z "$host" ]; then host="$build"; fi
   985 	check_compiler "host g++" "cxx_host" "$host" "$cxx_host" "$CXX" "g++" "c++" 1 "-dumpmachine"
   995 	check_compiler "host g++" "cxx_host" "$host" "$cxx_host" "$CXX" "g++" "c++" 1 "-dumpmachine"
   986 }
   996 }
   987 
   997 
   988 check_windres() {
   998 check_windres() {
   989 	if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
   999 	if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ]; then
  1582 	#  binaries are stored in there, and nowhere else.
  1592 	#  binaries are stored in there, and nowhere else.
  1583 	SRC_REPLACE="
  1593 	SRC_REPLACE="
  1584 		s#!!CC_HOST!!#$cc_host#g;
  1594 		s#!!CC_HOST!!#$cc_host#g;
  1585 		s#!!CXX_HOST!!#$cxx_host#g;
  1595 		s#!!CXX_HOST!!#$cxx_host#g;
  1586 		s#!!CC_BUILD!!#$cc_build#g;
  1596 		s#!!CC_BUILD!!#$cc_build#g;
       
  1597 		s#!!CXX_BUILD!!#$cxx_build#g;
  1587 		s#!!WINDRES!!#$windres#g;
  1598 		s#!!WINDRES!!#$windres#g;
  1588 		s#!!STRIP!!#$strip $strip_arg#g;
  1599 		s#!!STRIP!!#$strip $strip_arg#g;
  1589 		s#!!LIPO!!#$lipo#g;
  1600 		s#!!LIPO!!#$lipo#g;
  1590 		s#!!CC_CFLAGS!!#$CC_CFLAGS#g;
  1601 		s#!!CC_CFLAGS!!#$CC_CFLAGS#g;
  1591 		s#!!CFLAGS!!#$T_CFLAGS#g;
  1602 		s#!!CFLAGS!!#$T_CFLAGS#g;