Pkg_check_modules Syntax Error Mac
Contents |
Sign in Pricing Blog Support Search GitHub This repository Watch 14 Star 91 Fork 40 vcftools/vcftools Code Issues 16 Pull requests 4 Projects 0 Pulse Graphs New issue configure error pkg_check_modules unexpected token #16 Closed Griffan opened this Issue Aug 21, 2015 · 11 comments Projects pkg_check_modules not found None yet Labels None yet Milestone No milestone Assignees No one assigned 8 participants Griffan commented Aug
Syntax Error Near Unexpected Token Libusb
21, 2015 ./configure: line 4634: syntax error near unexpected token `ZLIB,' auton1 commented Aug 21, 2015 Can you be a bit more detailed with regard to the issue? wookietreiber commented Aug 21, 2015
Autoconf Pkg_check_modules
Did you generate this configure script? If so, which autoconf version do you have? Would you please paste the failing version of the generated configure script to some pastebin, gist or other service? Griffan commented Aug 21, 2015 I use git clone to download code, then use the autogen.sh, then use configure --prefix=/my/install/dir. After a while, it stopped with this information prompted. autoconf (GNU Autoconf) 2.69 syntax error near unexpected token glib snap of the configure file: ... 4616 pmdir_relative_path=\
4617 $PERL -MConfig \
4618 -wle '($_ = $Config{installsitelib})
4619 =~ s!^\Q$Config{siteprefix}/!!; \
4620 print' 4621 4622 4623 # Check whether --with-pmdir was given. 4624 if test "${with_pmdir+set}" = set; then : 4625 withval=$with_pmdir; PMDIR=${withval} 4626 else 4627 PMDIR='${prefix}'/"$pmdir_relative_path" 4628 fi 4629 4630 4631 4632 4633 # Checks for libraries. 4634 PKG_CHECK_MODULES(ZLIB, zlib) 4635 4636 # Checks for header files. 4637 4638 4639 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 4640 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } 4641 if ${ac_cv_path_GREP+:} false; then : 4642 $as_echo_n "(cached) " >&6 4643 else ... wookietreiber commented Aug 22, 2015 Ok, I see where the problem is: The pkg-config check has not been translated from your configure.ac to configure, it has just been copied. I suppose that is because you either don't have pkg-config installed or it is installed incorrectly so that autoconf can not translate that line of the script. You need to correctly install pkg-config. The real problem here is, that the autoconf stage during ./autogen.sh does not complain that there is no pkg-config. It just copies PKG_CHEC
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company
Install Pkg-config
Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs pkg_prog_pkg_config Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, pkg_check_modules cmake just like you, helping each other. Join them; it only takes a minute: Sign up Using the pkg-config macro PKG_CHECK_MODULES failing up vote 9 down vote favorite I'm sure this is a fairly simple problem. I have https://github.com/vcftools/vcftools/issues/16 a very simple configure.ac file which I am using to just learn how autoconf & pkg-config work together. The confgure.ac file looks like: AC_PREREQ(2.61) AC_INIT(autoconf_test, 1.0, nowhere@dev.null) PKG_CHECK_MODULES(libusbmuxd, libusbmuxd >= 0.1.4) I can then execute autoconf from the command line and it does produce a configure script. However, when I run the configure script, I get the following error: ./configure: line 1618: syntax error near unexpected token `libusbmuxd,' ./configure: line 1618: `PKG_CHECK_MODULES(libusbmuxd, libusbmuxd >= http://stackoverflow.com/questions/8578181/using-the-pkg-config-macro-pkg-check-modules-failing 0.1.4)' If I use the pkg-config program from the command line to check to see whether it can find this library, it succeeds. /usr/lib/pkgconfig $pkg-config --libs --cflags --modversion libusbmuxd 1.0.7 -I/usr/local/Cellar/usbmuxd/1.0.7/include -L/usr/local/Cellar/usbmuxd/1.0.7/lib -lusbmuxd So, it seems clear that for some reason the PGK_CHECK_MODULE macro cannot be located and I am not sure why. This probably isn't OS specific, but I am using Mac OS X 10.6.8. osx osx-snow-leopard autoconf automake pkg-config share|improve this question edited May 6 at 12:35 vaxquis 5,83552541 asked Dec 20 '11 at 15:54 ericgorr 4,2062647 1 The macro is in a file pkg.m4 if I'm not wrong. Can you find this file somewhere in /usr/share/aclocal or a similar directory? –ptomato Dec 20 '11 at 21:48 3 Use 'aclocal --print' to determine the directory in which to look for pkg.m4 –William Pursell Dec 21 '11 at 11:39 How did you install pkg-config, and how did you install the autotools? –Jack Kelly Dec 25 '11 at 3:51 add a comment| 2 Answers 2 active oldest votes up vote 14 down vote accepted When you are bootstrapping (ie, running autoreconf), aclocal is unable to find pkg.m4. This is because pkg-config was either not installed or has been installed somewhere that aclocal does not know about. (ie, it was installed with a different prefix than autom
problem with compiling my Glib application under Mac OS X. I knew that everything worked before on Debian and the problem had http://codica.pl/2008/08/31/problem-with-pkg_check_modules-under-mac-os-x/ to be one of this darwin-specific. Just to make myself clear. Here is the error I got after executing: ./configure
checking for pkg-config... pkg-config
./configure: line 3489: syntax error near unexpected token `GLIB,'
./configure: line 3489: `PKG_CHECK_MODULES(GLIB, glib-2.0)'
It seemed that there was some problem with PKG_CHECK_MODULES - autoconf's macro responsible for detecting syntax error if a given library or module was installed in the system (basing on pkg-config). In fact it came out that the macro was not defined at all. Normally after running aclocal command it should be generated in the file aclocal.m4. But in my situation there was no such entry. Why did that occur? At that time I could syntax error near not answer that question but at least I had some starting point. You may probably know that aclocal is one of the tools of Autotools package. It creates a file named aclocal.m4 which includes a number of Autoconf macros that can be used later by configure. (one of these macros is of course PKG_CHECK_MODULES) After reading the aclocal info page I found out that the aclocal.m4 file content was based on some external .m4 files and my configure.ac. I read that the PKG_CHECK_MODULES macro should be defined inside pkg.m4 file, and I really could find it there in my directory /opt/local/share/aclocal . And here the answer came. I installed pkg-config and Glib using darwin ports, where the default prefix for packages was /opt/local. But on the other hand all the Autotools programs were located in /usr/bin. It was obvious that the prefix was different, so that aclocal could not detect pkg.m4 file and define PKG_CHECK_MODULES macro. The only missing thing was to inform aclocal about the path of pkg.m4 and all other e