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.

  • 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 May 14 '15 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. – Danut Niculae May 14 '15 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 May 14 '15 at 17:44
  • My apologize. I have now edited again with the code from the configure file – Danut Niculae May 14 '15 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 May 14 '15 at 18:30
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
  • I have done so, yet even though now it only shows the unexpected token ")", the error still persists. – Danut Niculae May 14 '15 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? – Stephen Kitt May 14 '15 at 21:41
  • @Stephen Kitt: It shows #!/bin/bash – Danut Niculae May 14 '15 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 – Danut Niculae May 15 '15 at 12:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.