Changeset - r11880:02a6568b43ea
[Not reviewed]
master
0 1 0
rubidium - 16 years ago 2009-05-12 20:52:12
rubidium@openttd.org
(svn r16285) -Change: give some warnings when unsupported characters are used in the path
1 file changed with 12 insertions and 0 deletions:
0 comments (0 inline, 0 general)
configure
Show inline comments
 
#!/bin/sh
 

	
 
check_path_characters() {
 
	if [ -n "`echo $ROOT_DIR | grep '[^-_A-Za-z0-9\/\\\.:]'`" ]; then
 
		echo "WARNING: The path contains a non-alphanumeric character that might cause"
 
		echo "         failures in subsequent build stages. Any failures with the build"
 
		echo "         will most likely be caused by this."
 
	fi
 
}
 

	
 
CONFIGURE_EXECUTABLE="$_"
 
# On *nix systems those two are equal when ./configure is done
 
if [ "$0" != "$CONFIGURE_EXECUTABLE" ]; then
 
	# On some systems, when ./configure is triggered from 'make'
 
	#  the $_ is filled with 'make'. So if that is true, skip 'make'
 
	#  and use $0 (and hope that is correct ;))
 
	if [ -n "`echo $CONFIGURE_EXECUTABLE | grep make`" ]; then
 
		CONFIGURE_EXECUTABLE="$0"
 
	else
 
		CONFIGURE_EXECUTABLE="$CONFIGURE_EXECUTABLE $0"
 
	fi
 
fi
 
# Find out where configure is (in what dir)
 
ROOT_DIR="`dirname $0`"
 
ROOT_DIR="`cd $ROOT_DIR && pwd`"
 

	
 
check_path_characters
 

	
 
PWD="`pwd`"
 
PREFIX="$PWD/bin"
 

	
 
. $ROOT_DIR/config.lib
 

	
 
# Set default dirs
 
OBJS_DIR="$PWD/objs"
 
BASE_SRC_OBJS_DIR="$OBJS_DIR"
 
LANG_OBJS_DIR="$OBJS_DIR/lang"
 
BIN_DIR="$PREFIX"
 
SRC_DIR="$ROOT_DIR/src"
 
LANG_DIR="$SRC_DIR/lang"
 
@@ -126,12 +136,14 @@ SRCS="`    echo \"$SRCS\" | $awk ' { ORS
 
# In makefiles, we always use -u for sort
 
if [ -z "$sort" ]; then
 
	sort="sed s~a~a~"
 
else
 
	sort="$sort -u"
 
fi
 

	
 
CONFIGURE_FILES="$ROOT_DIR/configure $ROOT_DIR/config.lib $ROOT_DIR/Makefile.in $ROOT_DIR/Makefile.lang.in $ROOT_DIR/Makefile.src.in $ROOT_DIR/Makefile.bundle.in"
 

	
 
generate_main
 
generate_lang
 
generate_src
 

	
 
check_path_characters
0 comments (0 inline, 0 general)