1.1 --- a/common/autoconf/basics.m4 Tue Jun 25 13:47:00 2013 -0700 1.2 +++ b/common/autoconf/basics.m4 Thu Jun 27 09:27:06 2013 +0200 1.3 @@ -43,6 +43,16 @@ 1.4 fi 1.5 ]) 1.6 1.7 +# Appends a string to a path variable, only adding the : when needed. 1.8 +AC_DEFUN([BASIC_APPEND_TO_PATH], 1.9 +[ 1.10 + if test "x[$]$1" = x; then 1.11 + $1="$2" 1.12 + else 1.13 + $1="[$]$1:$2" 1.14 + fi 1.15 +]) 1.16 + 1.17 # This will make sure the given variable points to a full and proper 1.18 # path. This means: 1.19 # 1) There will be no spaces in the path. On posix platforms, 1.20 @@ -351,7 +361,10 @@ 1.21 AC_SUBST(SYS_ROOT) 1.22 1.23 AC_ARG_WITH([tools-dir], [AS_HELP_STRING([--with-tools-dir], 1.24 - [search this directory for compilers and tools (for cross-compiling)])], [TOOLS_DIR=$with_tools_dir]) 1.25 + [search this directory for compilers and tools (for cross-compiling)])], 1.26 + [TOOLS_DIR=$with_tools_dir 1.27 + BASIC_FIXUP_PATH([TOOLS_DIR]) 1.28 + ]) 1.29 1.30 AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit], 1.31 [use this directory as base for tools-dir and sys-root (for cross-compiling)])], 1.32 @@ -359,17 +372,14 @@ 1.33 if test "x$with_sys_root" != x; then 1.34 AC_MSG_ERROR([Cannot specify both --with-devkit and --with-sys-root at the same time]) 1.35 fi 1.36 - if test "x$with_tools_dir" != x; then 1.37 - AC_MSG_ERROR([Cannot specify both --with-devkit and --with-tools-dir at the same time]) 1.38 - fi 1.39 - TOOLS_DIR=$with_devkit/bin 1.40 + BASIC_FIXUP_PATH([with_devkit]) 1.41 + BASIC_APPEND_TO_PATH([TOOLS_DIR],$with_devkit/bin) 1.42 if test -d "$with_devkit/$host_alias/libc"; then 1.43 SYS_ROOT=$with_devkit/$host_alias/libc 1.44 elif test -d "$with_devkit/$host/sys-root"; then 1.45 SYS_ROOT=$with_devkit/$host/sys-root 1.46 fi 1.47 ]) 1.48 - 1.49 ]) 1.50 1.51 AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],