开发者

Having trouble with configure.ac syntax using AC_SEARCH_LIBS

开发者 https://www.devze.com 2023-02-05 01:05 出处:网络
I\'m trying to use AC_SEARCH_LIBS to find the location of the X libraries on my system. Some older systems (RH4) have the libraries in /usr/X11, while most current systems just put them in /usr/lib.

I'm trying to use AC_SEARCH_LIBS to find the location of the X libraries on my system. Some older systems (RH4) have the libraries in /usr/X11, while most current systems just put them in /usr/lib.

I tried the following hoping that it would add -L/usr/X11R6 to LDFLAGS only if needed:

AC_SEARCH_LIBS([XFree], [X11], [], [
  LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -L/usr/X11R6/lib64"开发者_Python百科
  AC_MSG_CHECKING["Looking for XFree in /usr/X11R6"]
  AC_SEARCH_LIBS([XFree], [X11], [], [
    AC_MSG_FAILURE(["Cannot find X11. Try setting LDFLAGS -L"], [-1])
  ])
])

but I get syntax errors from the generated configure script:

./configure: line 15546: syntax error near unexpected token `fi'
./configure: line 15546: `fi'

What the heck am I doing wrong?

Any help is apreciated.


I would advise you to look at line 15546 of configure first thing. The error is often immediately obvious, even if you're not that good at shell script.

That said, I'd guess that it was the lack of parentheses after AC_MSG_CHECKING, try this:

AC_MSG_CHECKING([Looking for XFree in /usr/X11R6])
0

精彩评论

暂无评论...
验证码 换一张
取 消