fixed pkg-config requirements

master
Marc Wäckerlin 9 years ago
parent c8c8a700cc
commit 3686843431
  1. 33
      ax_check_qt.m4
  2. 17
      ax_init_standard_project.m4
  3. 82
      bootstrap.sh
  4. 14
      src/libpcscxx.pc.in

@ -104,12 +104,24 @@ AC_DEFUN([AX_CHECK_QT], [
MOC_FLAGS+=" -DHAVE_$1=1 ${[$1]5_CFLAGS}"
AM_CXXFLAGS+=" ${[$1]5_CFLAGS}"
LIBS+=" ${[$1]5_LIBS}"
modules=${qt_modules//Qt/Qt5}
if test -z "$PKG_REQUIREMENTS"; then
PKG_REQUIREMENTS="${modules// /, }"
else
PKG_REQUIREMENTS="${PKG_REQUIREMENTS}, ${modules// /, }"
fi
if test -n "${qt_modules_optional}"; then
PKG_CHECK_MODULES([$1]5_OPTIONAL, [${qt_modules_optional//Qt/Qt5}], [
AM_CPPFLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}"
MOC_FLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}"
AM_CXXFLAGS+=" ${[$1]5_OPTIONAL_CFLAGS}"
LIBS+=" ${[$1]5_OPTIONAL_LIBS}"
modules=${qt_modules_optional//Qt/Qt5}
if test -z "$PKG_REQUIREMENTS"; then
PKG_REQUIREMENTS="${modules// /, }"
else
PKG_REQUIREMENTS="${PKG_REQUIREMENTS}, ${modules// /, }"
fi
], [
AC_MSG_NOTICE([Not found: ${qt_modules_optional//Qt/Qt5}])
])
@ -122,12 +134,24 @@ AC_DEFUN([AX_CHECK_QT], [
MOC_FLAGS+=" -DHAVE_$1=1 ${$1_CFLAGS}"
AM_CXXFLAGS+=" ${$1_CFLAGS}"
LIBS+=" ${$1_LIBS}"
modules=${qt_modules}
if test -z "$PKG_REQUIREMENTS"; then
PKG_REQUIREMENTS="${modules// /, }"
else
PKG_REQUIREMENTS="${PKG_REQUIREMENTS}, ${modules// /, }"
fi
if test -n "$3"; then
PKG_CHECK_MODULES($1_OPTIONAL, [${qt_modules_optional}], [
AM_CPPFLAGS+=" ${$1_OPTIONAL_CFLAGS}"
MOC_FLAGS+=" ${$1_OPTIONAL_CFLAGS}"
AM_CXXFLAGS+=" ${$1_OPTIONAL_CFLAGS}"
LIBS+=" ${$1_OPTIONAL_LIBS}"
modules=${qt_modules_optional}
if test -z "$PKG_REQUIREMENTS"; then
PKG_REQUIREMENTS="${modules// /, }"
else
PKG_REQUIREMENTS="${PKG_REQUIREMENTS}, ${modules// /, }"
fi
], [
AC_MSG_NOTICE([Not found: ${qt_modules_optional}])
])
@ -139,6 +163,7 @@ AC_DEFUN([AX_CHECK_QT], [
AC_SUBST(AM_CPPFLAGS)
AC_SUBST(MOC_FLAGS)
AC_SUBST(AM_CXXFLAGS)
AC_SUBST(PKG_REQUIREMENTS)
AX_ADDITIONAL_QT_RULES_HACK='
ui_%.hxx: %.ui
$(UIC) -o [$][@] $<
@ -191,3 +216,11 @@ AC_DEFUN([AX_REQUIRE_QT], [
AC_MSG_ERROR([Required Qt modules not found: $2])
fi
])
# Omit Qt Keywords
# AX_QT_NO_KEYWORDS
AC_DEFUN([AX_QT_NO_KEYWORDS], [
AM_CPPFLAGS+=" -DQT_NO_KEYWORDS"
])

@ -399,6 +399,11 @@ AC_DEFUN([AX_PKG_REQUIRE], [
AM_CPPFLAGS+=" ${$1_CFLAGS}"
AM_CXXFLAGS+=" ${$1_CFLAGS}"
LIBS+=" ${$1_LIBS}"
if test -z "$PKG_REQUIREMENTS"; then
PKG_REQUIREMENTS="$2"
else
PKG_REQUIREMENTS="${PKG_REQUIREMENTS}, $2"
fi
], [
AC_MSG_WARN([Recommended package $2 for feature $1 not installed])
if test -n "$4"; then
@ -430,6 +435,11 @@ AC_DEFUN([AX_PKG_REQUIRE], [
AM_CPPFLAGS+=" ${$1_CFLAGS}"
AM_CXXFLAGS+=" ${$1_CFLAGS}"
LIBS+=" ${$1_LIBS}"
if test -z "$PKG_REQUIREMENTS"; then
PKG_REQUIREMENTS="$pkg"
else
PKG_REQUIREMENTS="${PKG_REQUIREMENTS}, $pkg"
fi
], [
AC_MSG_WARN([Recommended package $pkg for feature $1 not installed])
])
@ -438,6 +448,7 @@ AC_DEFUN([AX_PKG_REQUIRE], [
])
AC_SUBST(AM_CPPFLAGS)
AC_SUBST(AM_CXXFLAGS)
AC_SUBST(PKG_REQUIREMENTS)
if test -n "$3"; then
old_CPPFLAGS=${CPPFLAGS}
CPPFLAGS=" ${$1_CFLAGS} ${CPPFLAGS}"
@ -464,6 +475,11 @@ AC_DEFUN([AX_PKG_CHECK], [
AM_CPPFLAGS+=" ${$1_CFLAGS}"
AM_CXXFLAGS+=" ${$1_CFLAGS}"
LIBS+=" ${$1_LIBS}"
if test -z "$PKG_REQUIREMENTS"; then
PKG_REQUIREMENTS="m4_default([$2], [$1])"
else
PKG_REQUIREMENTS="${PKG_REQUIREMENTS}, m4_default([$2], [$1])"
fi
], [
HAVE_$1=0
])
@ -471,4 +487,5 @@ AC_DEFUN([AX_PKG_CHECK], [
AC_SUBST(HAVE_$1)
AC_SUBST(AM_CPPFLAGS)
AC_SUBST(AM_CXXFLAGS)
AC_SUBST(PKG_REQUIREMENTS)
])

@ -22,28 +22,31 @@ configure=0
build=0
overwrite=0
rebuild=0
rebuildfiles=()
while test $# -gt 0; do
case "$1" in
(--configure|-c) configure=1;;
(--build|-b) configure=1; build=1;;
(--overwrite|-o) overwrite=1;;
(--rebuild|-r) rebuild=1;;
(--rebuild-file|-f) shift; rebuildfiles+=("$1");;
(--version|-v)
echo "$Id$";
exit;;
(--help|-h) less <<EOF
SYNOPSIS
${MY_NAME} [--help|-h] [--configure|-c]
${MY_NAME} [--help|-h] [OPTIOS]
OPTIONS
--configure, -c call ./configure after initialization
--build, -c build, call ./configure && make after initialization
--overwrite, -o overwrite all basic files (bootstrap.sh, m4-macros)
--rebuild -r force rebuild of generated files, even if modified
--help, -h show this help
--version, -v show version and date of this file
--configure, -c call ./configure after initialization
--build, -c build, also call ./configure && make
--overwrite, -o overwrite all basic files (bootstrap.sh, m4-macros)
--rebuild, -r force rebuild of generated files, even if modified
--rebuild-file, -f <file> rebild specific file (can be added multiple times)
--help, -h show this help
--version, -v show version and date of this file
DESCRIPTION
@ -122,9 +125,15 @@ GENERATED FILES
REBUILDING FILES
To rebuild all these files, just run "${MY_NAME} -o". You can also
remove and rebuild a single file by removing it from subversion,
just call "svn rm <file>" and "${MY_NAME}" to rebuild file "<file>".
To rebuild all these files, just run "${MY_NAME} -r".
To copy only the files provided by this package, that means those
files you must never change, that means to update the build system
to the latest release, run "${MY_NAME} -o"
You can also rebuild a list of singleany list of specific file files
by adding option "${MY_NAME} -f <file>" to rebuild file
"<file>". You can add option "-f" more than once.
FILES TO EDIT
@ -256,6 +265,12 @@ testtag() {
egrep -q '^ *'"$1" configure.ac
}
contains() {
local e
for e in "${@:2}"; do [[ "$e" == "$1" ]] && return 0; done
return 1
}
checkdir() {
if ! test -d "$1"; then # create path
run mkdir -p "$1"
@ -285,8 +300,10 @@ to() {
esac
shift;
done
if checkfile "$1" && test $rebuild -eq 0; then # file already exists
return
if checkfile "$1" && test $rebuild -eq 0 \
&& ! contains "$1" "${rebuildfiles[@]}"; then
# file already exists and must not be rebuilt
return 1
fi
checkdir "$(dirname ${1})"
echo -en "\e[1m-> generating:\e[0m $1 ..."
@ -307,10 +324,13 @@ to() {
run svn add "$1"
run svn propset svn:keywords "Id" "$1"
fi
return 0
}
copy() {
if checkfile "$1" && test $overwrite -eq 0; then
if checkfile "$1" && test $overwrite -eq 0 \
&& ! contains "$1" "${rebuildfiles[@]}"; then
# file already exists and must not be rebuilt
return
fi
run cp "${0%/*}/$1" "$1"
@ -348,8 +368,8 @@ copy ax_init_standard_project.m4
copy ax_cxx_compile_stdcxx_11.m4
copy ax_check_qt.m4
copy AUTHORS
if ! test -f configure.ac; then
to configure.ac <<EOF
to configure.ac <<EOF && \
( echo "please edit configure.ac, then rerun $0"; exit 0 )
${HEADER}m4_define(x_package_name, ${DEFAULT_PROJECT_NAME}) # project's name
m4_define(x_major, 0) # project's major version
m4_define(x_minor, 0) # project's minor version
@ -370,14 +390,11 @@ AX_INIT_STANDARD_PROJECT
# qt features, uncomment, what you need:
#AX_CHECK_QT([QT], [QtCore QtGui QtNetwork], [QtWidgets])
#AM_CPPFLAGS="${AM_CPPFLAGS} -DQT_NO_KEYWORDS"
#AX_QT_NO_KEYWORDS
# create output
AC_OUTPUT
EOF
echo "please edit configure.ac, then rerun $0"
exit 0
fi
PACKAGE_NAME=$(sed -n 's/.*m4_define *( *x_package_name *, *\([^ ]*\) *).*/\1/p' configure.ac)
echo "${HEADER}MAINTAINERCLEANFILES = makefile.in" | to --condition AX_USE_CXX src/makefile.am
to --condition AX_USE_CXX src/version.hxx <<EOF
@ -473,10 +490,14 @@ LDADD = -l${PACKAGE_NAME}
MAINTAINERCLEANFILES = makefile.in
EOF
if testtag AX_USE_DOXYGEN && ! test -f doc/doxyfile.in; then
if testtag AX_USE_DOXYGEN && \
( ! checkfile doc/doxyfile.in || \
contains doc/doxyfile.in "${rebuildfiles[@]}" ); then
run doxygen -g doc/doxyfile.in
run svn add doc/doxyfile.in
run svn propset svn:keywords "Id" doc/doxyfile.in
if test $exists -eq 0; then
run svn add doc/doxyfile.in
run svn propset svn:keywords "Id" doc/doxyfile.in
fi
doxyreplace PROJECT_NAME "@PACKAGE_NAME@"
doxyreplace PROJECT_NUMBER "@PACKAGE_VERSION@"
doxyreplace PROJECT_BRIEF "@DESCRIPTION@"
@ -595,13 +616,15 @@ ${HEADER}%:
EOF
echo 7 | to debian/compat
fi
if ! test -f makefile.am; then
SUBDIRS=""
for d in src test scripts doc examples; do
test -d $d && SUBDIRS="${SUBDIRS} $d"
done
echo "${HEADER}SUBDIRS =${SUBDIRS}\n\nMAINTAINERCLEANFILES = makefile.in" | to makefile.am
fi
SUBDIRS=""
for d in src test scripts doc examples; do
test -d $d && SUBDIRS="${SUBDIRS} $d"
done
to makefile.am<<EOF
${HEADER}SUBDIRS =${SUBDIRS}
MAINTAINERCLEANFILES = makefile.in
EOF
to --condition AX_USE_LIBTOOL src/${PACKAGE_NAME}.pc.in <<EOF
${HEADER}prefix=@prefix@
exec_prefix=@exec_prefix@
@ -613,6 +636,7 @@ Description: @DESCRIPTION@
Version: @VERSION@
Libs: -L\${libdir} -l@PACKAGE_NAME@ @LDFLAGS@
Cflags: -I\${includedir} @CPPFLAGS@
Requires: @PKG_REQUIREMENTS@
EOF
#### Cleanup If Makefile Exists ####

@ -1,11 +1,19 @@
## @id $Id$
#
# This file has been added by bootstrap.sh on Sat, 09 May 2015 11:21:56 +0200
# Feel free to change it or even remove and rebuild it, up to your needs
#
## 1 2 3 4 5 6 7 8
## 45678901234567890123456789012345678901234567890123456789012345678901234567890
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: @PACKAGE_NAME@
Description: C++ wrappers around pcsc-lite, cryptoki, openssh
Description: @DESCRIPTION@
Version: @VERSION@
Libs: -L${libdir} -lpcscxx -lcrypto -lpcsclite -lssl @LDFLAGS@
Libs.private:
Libs: -L${libdir} -l@PACKAGE_NAME@ @LDFLAGS@
Cflags: -I${includedir} @CPPFLAGS@
Requires: @PKG_REQUIREMENTS@

Loading…
Cancel
Save