相关文章推荐
眼睛小的鞭炮  ·  北京航空航天大学·  2 年前    · 
被表白的围巾  ·  ASP.NET Core updates ...·  2 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

In a configure file (#!/bin/sh/) generated by autoconf, there is a paragraph inside like the following:

if ac_fn_cxx_try_compile "$LINENO"; then :
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
    succeeded=yes
    found_system=yes

And when I execute ./configure it tells me "syntax error near unexpected token `fi'" at that line. It is not the end of the file.

If you have nothing in else you get an error. Either delete else or put a : between else and fi. and get rid of the : after then. – David C. Rankin Sep 19, 2014 at 6:35 You bet, I get caught by something simple all the time. If it solved the problem, you can select the Answer as correct :) – David C. Rankin Sep 19, 2014 at 6:41
if ac_fn_cxx_try_compile "$LINENO"; then
    $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 
    $as_echo "yes" >&6;
    succeeded=yes
    found_system=yes
    ##  look nothing here !!
    ##  at least put a ':'
    ##  or delete else altogether

I ran into this error when compiling libtorrent with minGW. The problem was a m4 macro saved as a DOS file. Converting "ax_boost_base.m4" to linux file endings did the trick. I am almost sure I have misconfigured GIT on my windows: It converts all files to DOS which is no good idea.

Thank you so much. You and @cbear1985 just saved me a lot of time; I was trying to build libusb-compat in MSYS2, and I have enabled autocrlf in my git configuration, so those files had CRLF line endings when they got checked out during the build process. – David Grayson Dec 24, 2015 at 18:54

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.