This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH: fix DOS absolute path handling in configure



Why not just add the new case, instead of moving the code?

> @@ -571,6 +583,25 @@
>  	if [ "${pwd}" = "${srcpwd}" ] ; then
>  		srcdir=.
>  	fi
> +        ### Also set up makesrcdir
> +        case "${srcdir}" in
> +            ".")  # no -srcdir option.  We're building in place.
> +                   makesrcdir=. ;;
> +            /* | [A-Za-z]:[\\/]* ) # absolute path
> +                   makesrcdir=`echo ${srcdir}/${subdir} | sed -e 's|/\.$||'`
> +                   ;;
> +    	    [A-Za-z]:*) # Relative path with a drive letter
> +		   echo '***' "${progname}: source dir ${srcdir} is a relative path with drive letter" 1>&2
> +		   echo '***' "Please specify absolute path or relative one without drive letter" 1>&2
> +		   exit 1
> +		   ;;
> +            *) # otherwise relative
> +                   case "${subdir}" in
> +                     .) makesrcdir=${srcdir} ;;
> +                     *) makesrcdir=${invsubdir}${srcdir}/${subdir} ;;
> +                   esac
> +                   ;;
> +        esac
>  esac
>  
>  ### warn about some conflicting configurations.
> @@ -1092,20 +1123,6 @@
>      # ${invsubdir} is inverse of ${subdir), *with* trailing /, if needed.
>      invsubdir=`echo ${subdir}/ | sed -e 's|\./||g' -e 's|[^/]*/|../|g'`
>  
> -    ### figure out what to do with srcdir
> -    case "${srcdir}" in
> -        ".")  # no -srcdir option.  We're building in place.
> -                makesrcdir=. ;;
> -        /* | [A-Za-z]:[\\/]* ) # absolute path
> -                makesrcdir=`echo ${srcdir}/${subdir} | sed -e 's|/\.$||'`
> -                ;;
> -        *) # otherwise relative
> -                case "${subdir}" in
> -                .) makesrcdir=${srcdir} ;;
> -                *) makesrcdir=${invsubdir}${srcdir}/${subdir} ;;
> -                esac
> -                ;;
> -    esac
>  
>      if [ "${subdir}/" != "./" ] ; then
>          Makefile=${subdir}/Makefile

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]