configure
changeset 3305 36d30ac4dde5
parent 3302 1987d02ff237
child 3306 6ade9fea6148
equal deleted inserted replaced
3304:4b396d9a06d1 3305:36d30ac4dde5
    39 	echo " --libpng-config    Where is your libpng-config         [libpng-config]"
    39 	echo " --libpng-config    Where is your libpng-config         [libpng-config]"
    40 	echo " "
    40 	echo " "
    41 }
    41 }
    42 
    42 
    43 function handle() {
    43 function handle() {
    44 	PARAM="$PARAM $1=`awk 'BEGIN { FS="="; $0="'$2'"; print $2;}'`"
    44 	PARAM="$PARAM \"$1=`awk 'BEGIN { FS="="; $0="'"$2"'"; print $2;}'`\""
    45 }
    45 }
    46 
    46 
    47 # The things you can use inside this case:
    47 # The things you can use inside this case:
    48 #  handle NAME VALUE - Sets the value to give the 'make upgradeconf'
    48 #  handle NAME VALUE - Sets the value to give the 'make upgradeconf'
    49 #                         Value is in form: tag=REAL_VALUE
    49 #                         Value is in form: tag=REAL_VALUE
    60 		--debug)
    60 		--debug)
    61 			DEBUG_SET=1
    61 			DEBUG_SET=1
    62 			ITEM="DEBUG"
    62 			ITEM="DEBUG"
    63 			;;
    63 			;;
    64 		--debug=*)
    64 		--debug=*)
    65 			handle "DEBUG" $n
    65 			handle "DEBUG" "$n"
    66 			;;
    66 			;;
    67 		--profile)
    67 		--profile)
    68 			PARAM="$PARAM PROFILE=1"
    68 			PARAM="$PARAM PROFILE=1"
    69 			;;
    69 			;;
    70 		--dedicated)
    70 		--dedicated)
    71 			PARAM="$PARAM DEDICATED=1"
    71 			PARAM="$PARAM DEDICATED=1"
    72 			;;
    72 			;;
    73 		--revision=*)
    73 		--revision=*)
    74 			RELEASE=`awk 'BEGIN { FS="="; $0="'$n'"; print $2;}'`
    74 			RELEASE=`awk 'BEGIN { FS="="; $0="'"$n"'"; print $2;}'`
    75 			;;
    75 			;;
    76 		--revision)
    76 		--revision)
    77 			SITEM="RELEASE"
    77 			SITEM="RELEASE"
    78 			;;
    78 			;;
    79 		--target-cc=*)
    79 		--target-cc=*)
    80 			handle "CC_TARGET" $n
    80 			handle "CC_TARGET" "$n"
    81 			;;
    81 			;;
    82 		--target-cc)
    82 		--target-cc)
    83 			ITEM="CCTARGET"
    83 			ITEM="CC_TARGET"
    84 			;;
    84 			;;
    85 		--target-cxx=*)
    85 		--target-cxx=*)
    86 			TARGET_CXX=`awk 'BEGIN { FS="="; $0="'$n'"; print $2;}'`
    86 			echo "$n"
       
    87 			TARGET_CXX=`awk 'BEGIN { FS="="; $0="'"$n"'"; print $2;}'`
    87 			;;
    88 			;;
    88 		--target-cxx)
    89 		--target-cxx)
    89 			SITEM="TARGET_CXX"
    90 			SITEM="TARGET_CXX"
    90 			;;
    91 			;;
    91 		--host-cc=*)
    92 		--host-cc=*)
    92 			handle CC_HOST $n
    93 			handle CC_HOST "$n"
    93 			;;
    94 			;;
    94 		--host-cc)
    95 		--host-cc)
    95 			ITEM="CC_HOST"
    96 			ITEM="CC_HOST"
    96 			;;
    97 			;;
    97 		--os=*)
    98 		--os=*)
    98 			TARGET_OS=`awk 'BEGIN { FS="="; $0="'$n'"; print $2;}'`
    99 			TARGET_OS=`awk 'BEGIN { FS="="; $0="'"$n"'"; print $2;}'`
    99 			;;
   100 			;;
   100 		--os)
   101 		--os)
   101 			SITEM="TARGET_OS"
   102 			SITEM="TARGET_OS"
   102 			;;
   103 			;;
   103 		--windres=*)
   104 		--windres=*)
   104 			handle WINDRES $n
   105 			handle WINDRES "$n"
   105 			;;
   106 			;;
   106 		--windres)
   107 		--windres)
   107 			ITEM="WINDRES"
   108 			ITEM="WINDRES"
   108 			;;
   109 			;;
   109 		--force-le)
   110 		--force-le)
   148 			;;
   149 			;;
   149 		--without-cocoa)
   150 		--without-cocoa)
   150 			PARAM="$PARAM WITH_COCOA="
   151 			PARAM="$PARAM WITH_COCOA="
   151 			;;
   152 			;;
   152 		--static-zlib-path=*)
   153 		--static-zlib-path=*)
   153 			handle STATIC_ZLIB_PATH $n
   154 			handle STATIC_ZLIB_PATH "$n"
   154 			;;
   155 			;;
   155 		--static-zlib-path)
   156 		--static-zlib-path)
   156 			ITEM="STATIC_ZLIB_PATH"
   157 			ITEM="STATIC_ZLIB_PATH"
   157 			;;
   158 			;;
   158 		--sdl-config=*)
   159 		--sdl-config=*)
   159 			handle SDL-CONFIG $n
   160 			handle SDL-CONFIG "$n"
   160 			;;
   161 			;;
   161 		--sdl-config)
   162 		--sdl-config)
   162 			ITEM="SDL-CONFIG"
   163 			ITEM="SDL-CONFIG"
   163 			;;
   164 			;;
   164 		--libpng-config=*)
   165 		--libpng-config=*)
   165 			handle LIBPNG-CONFIG $n
   166 			handle LIBPNG-CONFIG "$n"
   166 			;;
   167 			;;
   167 		--lib-png-config)
   168 		--lib-png-config)
   168 			ITEM="LIBPNG-CONFIG"
   169 			ITEM="LIBPNG-CONFIG"
   169 			;;
   170 			;;
   170 
   171 
   171 		--*=*)
   172 		--*=*)
   172 			echo -n "Unknown switch "
   173 			echo -n "Unknown switch "
   173 			echo `awk 'BEGIN { FS="="; $0="'$n'"; print $1;}'`
   174 			echo `awk 'BEGIN { FS="="; $0="'"$n"'"; print $1;}'`
   174 			exit 1
   175 			exit 1
   175 			;;
   176 			;;
   176 		-*)
   177 		-*)
   177 			echo "Unknown switch $n"
   178 			echo "Unknown switch $n"
   178 			exit 1
   179 			exit 1
   179 			;;
   180 			;;
   180 
   181 
   181 		*)
   182 		*)
   182 			if ! test -z "$ITEM"
   183 			if ! test -z "$ITEM"
   183 			then
   184 			then
   184 				PARAM="$PARAM $ITEM=$n"
   185 				PARAM="$PARAM $ITEM=\"$n\""
   185 				ITEM="";
   186 				ITEM="";
   186 			elif ! test -z "$SITEM"
   187 			elif ! test -z "$SITEM"
   187 			then
   188 			then
   188 				export $SITEM=$n
   189 				export $SITEM="$n"
   189 				SITEM=""
   190 				SITEM=""
   190 			else
   191 			else
   191 				echo "Unknown switch $n"
   192 				echo "Unknown switch $n"
   192 				exit 1
   193 				exit 1
   193 			fi
   194 			fi
   247 if test -e "Makefile.config"
   248 if test -e "Makefile.config"
   248 then
   249 then
   249 	rm -f Makefile.config
   250 	rm -f Makefile.config
   250 fi
   251 fi
   251 
   252 
   252 make upgradeconf $PARAM
   253 echo "make upgradeconf $PARAM" > Makefile.run
       
   254 . Makefile.run
       
   255 rm -f Makefile.run
   253 
   256 
   254 # Makefile.config currently doesn't support custom CXX, so, we add the line
   257 # Makefile.config currently doesn't support custom CXX, so, we add the line
   255 #  ourself!
   258 #  ourself!
   256 
   259 
   257 if ! test -z "$TARGET_CXX"
   260 if ! test -z "$TARGET_CXX"