[patch] check pkg-config before xxx-config scripts
it's easier to manage pkg-config when cross-compiling, and libdvdread installs .pc files, so check those first -mike --- configure.ac (revision 1243) +++ configure.ac (working copy) @@ -89,6 +89,7 @@ AC_PROG_CC AC_PROG_MAKE_SET AC_PROG_INSTALL AC_PROG_LN_S +PKG_PROG_PKG_CONFIG dnl -------------------------------------------------------------- dnl Libtool @@ -185,15 +186,26 @@ AC_ARG_WITH([dvdread-config], [AS_HELP_STRING([--with-dvdread-config=PROG], [dvdread-config program to use @<:@default=from PATH@:>@])], [DVDREAD_CONFIG="$withval"], - [dnl User didn't specify program, search PATH - AC_PATH_PROG([DVDREAD_CONFIG], [dvdread-config], [no]) - test "x$DVDREAD_CONFIG" = xno && \ - AC_MSG_ERROR([dvdread-config required to link with libdvdread]) - ]) -DVDREAD_CFLAGS=`$DVDREAD_CONFIG --cflags` || \ - AC_MSG_ERROR([Could not get libdvdread CFLAGS from $DVDREAD_CONFIG]) -DVDREAD_LIBS=`$DVDREAD_CONFIG --libs` || \ - AC_MSG_ERROR([Could not get libdvdread LIBS from $DVDREAD_CONFIG]) + [DVDREAD_CONFIG=""]) + +dnl by default, search pkg-config, and then fall back to dvdread-config +DVDREAD_PKG_CONFIG="no" +if test "x$DVDREAD_CONFIG" = "x"; then + PKG_CHECK_MODULES([DVDREAD], [dvdread], + [DVDREAD_PKG_CONFIG="yes"], + [dnl User didn't specify program, search PATH + AC_PATH_PROG([DVDREAD_CONFIG], [dvdread-config], [no]) + test "x$DVDREAD_CONFIG" = xno && \ + AC_MSG_ERROR([dvdread-config required to link with libdvdread]) + ]) +fi +if test "x$DVDREAD_PKG_CONFIG" != "xyes"; then + DVDREAD_CFLAGS=`$DVDREAD_CONFIG --cflags` || \ + AC_MSG_ERROR([Could not get libdvdread CFLAGS from $DVDREAD_CONFIG]) + DVDREAD_LIBS=`$DVDREAD_CONFIG --libs` || \ + AC_MSG_ERROR([Could not get libdvdread LIBS from $DVDREAD_CONFIG]) +fi + AC_SUBST([DVDREAD_CFLAGS]) AC_SUBST([DVDREAD_LIBS])
On Fri, Mar 30, 2012 at 11:14 AM, Mike Frysinger <vapier@gentoo.org> wrote:
it's easier to manage pkg-config when cross-compiling, and libdvdread installs .pc files, so check those first
Would you mind rediffing from my github tree? I recognize that you might be super busy. If so, could you rediff after I have pushed by tree to svn? This might be a few months. Thanks for the patch. I am not much a autotools hacker, so if someone else could take a look, that would be helpful. E
-mike
--- configure.ac (revision 1243) +++ configure.ac (working copy) @@ -89,6 +89,7 @@ AC_PROG_CC AC_PROG_MAKE_SET AC_PROG_INSTALL AC_PROG_LN_S +PKG_PROG_PKG_CONFIG
dnl -------------------------------------------------------------- dnl Libtool @@ -185,15 +186,26 @@ AC_ARG_WITH([dvdread-config], [AS_HELP_STRING([--with-dvdread-config=PROG], [dvdread-config program to use @<:@default=from PATH@:>@])], [DVDREAD_CONFIG="$withval"], - [dnl User didn't specify program, search PATH - AC_PATH_PROG([DVDREAD_CONFIG], [dvdread-config], [no]) - test "x$DVDREAD_CONFIG" = xno && \ - AC_MSG_ERROR([dvdread-config required to link with libdvdread]) - ]) -DVDREAD_CFLAGS=`$DVDREAD_CONFIG --cflags` || \ - AC_MSG_ERROR([Could not get libdvdread CFLAGS from $DVDREAD_CONFIG]) -DVDREAD_LIBS=`$DVDREAD_CONFIG --libs` || \ - AC_MSG_ERROR([Could not get libdvdread LIBS from $DVDREAD_CONFIG]) + [DVDREAD_CONFIG=""]) + +dnl by default, search pkg-config, and then fall back to dvdread-config +DVDREAD_PKG_CONFIG="no" +if test "x$DVDREAD_CONFIG" = "x"; then + PKG_CHECK_MODULES([DVDREAD], [dvdread], + [DVDREAD_PKG_CONFIG="yes"], + [dnl User didn't specify program, search PATH + AC_PATH_PROG([DVDREAD_CONFIG], [dvdread-config], [no]) + test "x$DVDREAD_CONFIG" = xno && \ + AC_MSG_ERROR([dvdread-config required to link with libdvdread]) + ]) +fi +if test "x$DVDREAD_PKG_CONFIG" != "xyes"; then + DVDREAD_CFLAGS=`$DVDREAD_CONFIG --cflags` || \ + AC_MSG_ERROR([Could not get libdvdread CFLAGS from $DVDREAD_CONFIG]) + DVDREAD_LIBS=`$DVDREAD_CONFIG --libs` || \ + AC_MSG_ERROR([Could not get libdvdread LIBS from $DVDREAD_CONFIG]) +fi + AC_SUBST([DVDREAD_CFLAGS]) AC_SUBST([DVDREAD_LIBS])
_______________________________________________ DVDnav-discuss mailing list DVDnav-discuss@mplayerhq.hu https://lists.mplayerhq.hu/mailman/listinfo/dvdnav-discuss
-- Erik Hovland erik@hovland.org http://hovland.org/
On Tuesday 17 April 2012 15:02:54 Erik Hovland wrote:
On Fri, Mar 30, 2012 at 11:14 AM, Mike Frysinger <vapier@gentoo.org> wrote:
it's easier to manage pkg-config when cross-compiling, and libdvdread installs .pc files, so check those first
Would you mind rediffing from my github tree?
which is where ? http://dvdnav.mplayerhq.hu/ only talks about svn. -mike
It's easier to manage pkg-config when cross-compiling, and libdvdread installs .pc files, so check those first. Signed-off-by: Mike Frysinger <vapier@gentoo.org> --- configure.ac | 30 +++++++++++++++++++++--------- 1 files changed, 21 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 8857e2b..9ba3086 100644 --- a/configure.ac +++ b/configure.ac @@ -89,6 +89,7 @@ AC_PROG_CC AC_PROG_MAKE_SET AC_PROG_INSTALL AC_PROG_LN_S +PKG_PROG_PKG_CONFIG dnl -------------------------------------------------------------- dnl Libtool @@ -185,15 +186,26 @@ AC_ARG_WITH([dvdread-config], [AS_HELP_STRING([--with-dvdread-config=PROG], [dvdread-config program to use @<:@default=from PATH@:>@])], [DVDREAD_CONFIG="$withval"], - [dnl User didn't specify program, search PATH - AC_PATH_PROG([DVDREAD_CONFIG], [dvdread-config], [no]) - test "x$DVDREAD_CONFIG" = xno && \ - AC_MSG_ERROR([dvdread-config required to link with libdvdread]) - ]) -DVDREAD_CFLAGS=`$DVDREAD_CONFIG --cflags` || \ - AC_MSG_ERROR([Could not get libdvdread CFLAGS from $DVDREAD_CONFIG]) -DVDREAD_LIBS=`$DVDREAD_CONFIG --libs` || \ - AC_MSG_ERROR([Could not get libdvdread LIBS from $DVDREAD_CONFIG]) + [DVDREAD_CONFIG=""]) + +dnl by default, search pkg-config, and then fall back to dvdread-config +DVDREAD_PKG_CONFIG="no" +if test "x$DVDREAD_CONFIG" = "x"; then + PKG_CHECK_MODULES([DVDREAD], [dvdread], + [DVDREAD_PKG_CONFIG="yes"], + [dnl User didn't specify program, search PATH + AC_PATH_PROG([DVDREAD_CONFIG], [dvdread-config], [no]) + test "x$DVDREAD_CONFIG" = xno && \ + AC_MSG_ERROR([dvdread-config required to link with libdvdread]) + ]) +fi +if test "x$DVDREAD_PKG_CONFIG" != "xyes"; then + DVDREAD_CFLAGS=`$DVDREAD_CONFIG --cflags` || \ + AC_MSG_ERROR([Could not get libdvdread CFLAGS from $DVDREAD_CONFIG]) + DVDREAD_LIBS=`$DVDREAD_CONFIG --libs` || \ + AC_MSG_ERROR([Could not get libdvdread LIBS from $DVDREAD_CONFIG]) +fi + AC_SUBST([DVDREAD_CFLAGS]) AC_SUBST([DVDREAD_LIBS]) -- 1.7.8.5
On Tue, Apr 17, 2012 at 1:33 PM, Mike Frysinger <vapier@gentoo.org> wrote:
It's easier to manage pkg-config when cross-compiling, and libdvdread installs .pc files, so check those first.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Thanks, applied to my tree. I will push this to svn evetually. E -- Erik Hovland erik@hovland.org http://hovland.org/
On Friday, 30 March 2012 at 20:14, Mike Frysinger wrote:
it's easier to manage pkg-config when cross-compiling, and libdvdread installs .pc files, so check those first
Applied. Sorry it took so long. Regards, Dominik -- Fedora http://fedoraproject.org/wiki/User:Rathann RPMFusion http://rpmfusion.org | MPlayer http://mplayerhq.hu "Faith manages." -- Delenn to Lennier in Babylon 5:"Confessions and Lamentations"
participants (3)
-
Dominik 'Rathann' Mierzejewski -
Erik Hovland -
Mike Frysinger