Skip to content

Commit

Permalink
Check for pkg-config m4 macros
Browse files Browse the repository at this point in the history
Fixes #12
  • Loading branch information
arkq committed Jul 9, 2017
1 parent 0048177 commit a665afa
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ AC_PROG_CC
AC_PROG_INSTALL
AM_PROG_CC_C_O

# testing presence of pkg-config
AC_MSG_CHECKING([pkg-config m4 macros])
if test m4_ifdef([PKG_CHECK_MODULES], [yes], [no]) == yes; then
AC_MSG_RESULT([yes]);
else
AC_MSG_RESULT([no]);
AC_MSG_ERROR([pkg-config is required. See pkg-config.freedesktop.org])
fi

# support for debugging
AC_ARG_ENABLE([debug],
AS_HELP_STRING([--enable-debug], [enable debugging support]))
Expand Down

3 comments on commit a665afa

@nihilismus
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, with this commit I am getting the next error:

+ autoreconf -fi
+ ./configure --prefix=$HOME/.local
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking pkg-config m4 macros... ./configure: 3729: test: yes: unexpected operator
no
configure: error: pkg-config is required. See pkg-config.freedesktop.org

As a workaround I am editing configure.ac with sed:

+ sed -i 's/== yes/= yes/' configure.ac
+ autoreconf -fi
+ ./configure --prefix=$HOME/.local
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking pkg-config m4 macros... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
...

Any idea what is going on? :-)

@arkq
Copy link
Owner Author

@arkq arkq commented on a665afa Jul 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What OS are you using and what shell? It seems that your test does not handle "non-standard" equals operator. I will fix that anyway, however I'm curious why I'm not able to reproduce it. I've checked on FreeBDS, OpenSUSE and Gentoo. I was able to "crash" test "abc" == "abc" in the zsh, however running ./configure has passed (in the zsh environment) without any errors... strange.

@nihilismus
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am using CRUX Linux and bash but here /bin/sh is not (a symlink to) /bin/bash. Maybe that is the reason why I can also successfully build cmusfm with:

+ sed -i s:/bin/sh:/bin/bash: configure.ac
+ autoreconf -fi
+ ./configure --prefix=$HOME/.local
...

Please sign in to comment.