2

I have been trying to update Python 3.4.3 from source, but each time, during the ./configure command, I get an error in the configure.status

> configure: checking for device files checking for /dev/ptmx... yes
> checking for /dev/ptc... no checking for %lld and %llu printf() format
> support... yes checking for %zd printf() format support... yes
> checking for socklen_t... yes checking for broken mbstowcs... no
> checking for --with-computed-gotos... no value specified checking
> whether gcc -pthread supports computed gotos... yes checking for build
> directories... done checking for -O2... yes checking for glibc
> _FORTIFY_SOURCE/memmove bug... no checking for gcc ipa-pure-const bug... no checking for ensurepip... upgrade configure: creating
> ./config.status ./config.status: line 480: syntax error near
> unexpected token `)' ./config.status: line 480: `    *\'*)
> ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;'

This is a paste of the config file

     # Handling of the options.
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
    ac_cs_recheck=: ;;
  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
    $as_echo "$ac_cs_version"; exit ;;
  --config | --confi | --conf | --con | --co | --c )
    $as_echo "$ac_cs_config"; exit ;;
  --debug | --debu | --deb | --de | --d | -d )
    debug=: ;;
  --file | --fil | --fi | --f )
    $ac_shift
    as_fn_append CONFIG_FILES " '$ac_optarg'"
    ac_need_defaults=false;;
--header | --heade | --head | --hea )
    $ac_shift
    case $ac_optarg in
    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; # problem line
    esac
    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
    ac_need_defaults=false;;
  --he | --h)
    # Conflict between --help and --header
    as_fn_error $? "ambiguous option: \`$1'

I am running Linux Mint 17.1, with Python 2.7 and 3.4 installed on my system. I believe I have all dependencies resolved, but I am not sure why I always get that error.

8
  • It would be interesting to see a bit of context around that line. This could give clues as to why invalid syntax got generated there.
    – dhag
    Commented May 14, 2015 at 17:14
  • I have edited my previous post to include more details. If it will be helpful, I can post the entire log file. Commented May 14, 2015 at 17:41
  • Oh sorry, I should have been clearer; I meant that it would be useful to see line 480 (and perhaps a few before and after) of configure, not just its output.
    – dhag
    Commented May 14, 2015 at 17:44
  • My apologize. I have now edited again with the code from the configure file Commented May 14, 2015 at 17:52
  • Interesting. I have the same code in my copy of the configure script (but at line 16120), and it seems to be correct syntax (for bash sh, at least) on my system. Is there a chance that your /bin/sh (as in the shebang line) is something different that doesn't support the same quoting syntax?
    – dhag
    Commented May 14, 2015 at 18:30

1 Answer 1

1

This appears to be related to the default shell, which is dash not bash.

ls -l /bin/sh

Based on this answer given by @Gilles, you could try changing the first line of your configure script.

Change this

#!/bin/sh

to

#!/bin/bash

See also this from the Linux Mint forums.

You can verify the default shell with this command.

readlink -f /bin/sh

EDIT:

Please try this from the command prompt:

CONFIG_SHELL=/bin/bash; export CONFIG_SHELL
$CONFIG_SHELL ./configure
4
  • I have done so, yet even though now it only shows the unexpected token ")", the error still persists. Commented May 14, 2015 at 20:45
  • The script causing trouble isn't ./configure (which works fine with dash) but ./config.status. What does head -n 1 config.status show? Commented May 14, 2015 at 21:41
  • @Stephen Kitt: It shows #!/bin/bash Commented May 14, 2015 at 21:44
  • @TimothyMartin: still the problem persists even after the Config_shell swtiched to bash. The error that I am getting is checking for ensurepip... upgrade configure: creating ./config.status ./config.status: 480: ./config.status: Syntax error: ")" unexpected Commented May 15, 2015 at 12:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .