Open GoogleCodeExporter opened 9 years ago
"If you look through the autoconf mailing list archive, you will see this
debated ad-nauseum. I'm not saying that you should avoid using pkg-config
(although I do believe it is best to do so), but please be aware that many
people to recommend avoiding it completely."
http://stackoverflow.com/questions/8578181/using-the-pkg-config-macro-pkg-check-
modules-failing
Please replace pkg-config with something else.
Original comment by tilo...@gmail.com
on 3 Jul 2014 at 5:51
I search the documentation and it looks like it is not easy to make ./configure
fail with a clear message when pkg-config is not found (using
PKG_PROG_PKG_CONFIG).
In the ./configure output you had:
checking for pkg-config... no
checking for LIBNFC... no
configure: error: libnfc >= 1.7.0 is mandatory.
I agree it is not obvious that the line "checking for pkg-config... no" is
important.
If you have a better solution than pkg-config please provide it.
Original comment by ludovic....@gmail.com
on 4 Jul 2014 at 3:57
Yes
Here you are
http://stackoverflow.com/questions/592620/how-to-check-if-a-program-exists-from-
a-bash-script
$ command -v pkg-config >/dev/null 2>&1 || { echo >&2 "I require foo but it's
not installed. Aborting."; exit 1; }
OR
$ type pkg-config >/dev/null 2>&1 || { echo >&2 "I require foo but it's not
installed. Aborting."; exit 1; }
OR
$ hash pkg-config 2>/dev/null || { echo >&2 "I require foo but it's not
installed. Aborting."; exit 1; }
Many thanks
Original comment by tilo...@gmail.com
on 4 Jul 2014 at 5:52
I propose the attach patch.
It would be better to not fail if libnfc is not found by pkg-config and try to
link with libnfc using $LIBNFC_LIBS and only fail if nothing works. This is
what I do for PCSC in my CCID driver for example.
Original comment by ludovic....@gmail.com
on 6 Jul 2014 at 4:59
Attachments:
Output WITHOUT pkg-config installed:
checking for pkg-config... no
checking for LIBNFC... no
configure: error: libnfc >= 1.7.0 is mandatory.
Does not work.
Bear in mind that "set | grep pkg" does not return anything even after
pkg-config installation. Checking for path variable is not reliable in this
case.
Original comment by tilo...@gmail.com
on 6 Jul 2014 at 7:58
I would suggest using the:
command -v pkg-config >/dev/null 2>&1 || { echo >&2 "I require pkg-config but
it's not installed. Aborting."; exit 1; }
Original comment by tilo...@gmail.com
on 6 Jul 2014 at 8:18
For your comment #5 I guess you have not applied my proposed patch or you have
not regenerated the ./configure script.
Original comment by ludovic....@gmail.com
on 7 Jul 2014 at 7:27
Yes you are right. Sorry for that.
The output without pkg-config is:
checking openssl/rand.h usability... yes
checking openssl/rand.h presence... yes
checking for openssl/rand.h... yes
checking for pkg-configx... no
configure: error: Please install pkg-config
:) Works
Original comment by tilo...@gmail.com
on 7 Jul 2014 at 11:02
Does not work. I installed pkg-config and output is:
checking openssl/rand.h usability... yes
checking openssl/rand.h presence... yes
checking for openssl/rand.h... yes
checking for pkg-configx... no
configure: error: Please install pkg-config
[root@alarmpi libfreefare-0.4.0]# pkg-config
Must specify package names on the command line
Original comment by tilo...@gmail.com
on 7 Jul 2014 at 11:08
This is output of set command on my system with pkg-config installed:
[root@alarmpi libfreefare-0.4.0]# set
BASH=/bin/bash
BASHOPTS=cmdhist:complete_fullquote:expand_aliases:extquote:force_fignore:hostco
mplete:interactive_comments:login_shell:progcomp:promptvars:sourcepath
BASH_ALIASES=()
BASH_ARGC=()
BASH_ARGV=()
BASH_CMDS=()
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="4" [1]="3" [2]="18" [3]="1" [4]="release"
[5]="armv6l-unknown-linux-gnueabihf")
BASH_VERSION='4.3.18(1)-release'
COLUMNS=127
DIRSTACK=()
EUID=0
GROUPS=()
HISTFILE=/root/.bash_history
HISTFILESIZE=500
HISTSIZE=500
HOME=/root
HOSTNAME=alarmpi
HOSTTYPE=armv6l
IFS=$' \t\n'
LANG=C
LINES=44
LOGNAME=root
MACHTYPE=armv6l-unknown-linux-gnueabihf
MAIL=/var/spool/mail/root
MAILCHECK=60
OLDPWD=/root
OPTERR=1
OPTIND=1
OSTYPE=linux-gnueabihf
PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/core_perl
PIPESTATUS=([0]="1")
PPID=328
PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}"
"${PWD/#$HOME/\~}"'
PS1='[\u@\h \W]\$ '
PS2='> '
PS3='> '
PS4='+ '
PWD=/root/libfreefare-0.4.0
SHELL=/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:moni
tor
SHLVL=1
SSH_CLIENT='192.168.0.2 8741 22'
SSH_CONNECTION='192.168.0.2 8741 192.168.0.7 22'
SSH_TTY=/dev/pts/0
TERM=xterm
UID=0
USER=root
XDG_RUNTIME_DIR=/run/user/0
XDG_SESSION_ID=c1
_=--prefix=/usr
Original comment by tilo...@gmail.com
on 7 Jul 2014 at 11:19
My patch is bogus. Replace "pkg-configx" by "pkg-config"
Original comment by ludovic....@gmail.com
on 7 Jul 2014 at 11:52
[deleted comment]
I tried that but it didn't work either.
[root@alarmpi ~]# pkg-config --version
0.28
[root@alarmpi ~]# whereis pkg-config
pkg-config: /usr/bin/pkg-config /usr/share/man/man1/pkg-config.1.gz
[root@alarmpi ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/core_perl
configure.ac line 61 changed to <<AC_CHECK_PROG(PKG_CONFIG, pkg-config)>>
[root@alarmpi libfreefare-0.4.0]# autoconf configure.ac > configure
[root@alarmpi libfreefare-0.4.0]# ./configure --prefix=/usr
... snip ...
checking for pkg-config... no
configure: error: Please install pkg-config
Original comment by tilo...@gmail.com
on 7 Jul 2014 at 12:14
Wrong patch again. Try with the attached one.
Original comment by ludovic....@gmail.com
on 9 Jul 2014 at 10:21
Attachments:
Original issue reported on code.google.com by
tilo...@gmail.com
on 3 Jul 2014 at 5:45