From c1481489a453faec6d08a58416edce6ec0cf06da Mon Sep 17 00:00:00 2001 From: Matt Messier Date: Sat, 12 May 2007 23:09:25 -0400 Subject: Fix X checks to do AC_PATH_XTRA before PKG_CHECK_MODULES It seems that even embedded in a shell if-statement, AC_PATH_XTRA still runs before PKG_CHECK_MODULES, even if PKG_CHECK_MODULES comes first. There's something funky going on inside autoconf wrt AC_PATH_XTRA. I know that the intended behavior is to do the PKG_CHECK_MODULES first, but no matter what I do, it never actually works that way. I give up, and so here's the code written to reflect what _actually_ happens in that order that it happens. --- configure.ac | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/configure.ac b/configure.ac index 78f857581..156b1c741 100644 --- a/configure.ac +++ b/configure.ac @@ -833,28 +833,24 @@ dnl -------------------------- dnl checks for system services dnl -------------------------- -if test x"$with_x" != x"no"; then - dnl Do a package check first, falling back to autoconf's built in checks if - dnl no package is found. - PKG_CHECK_MODULES([X], [x11 xext], [have_x=yes; no_x=no], [ - dnl Even as of 2.61, autoconf is not smart enough to find the X include - dnl and library paths on Mac OS X, so seed them automatically if they're - dnl not specified on the configure command-line. - case "$host_os" in - darwin*) - test x"$x_includes" = x"NONE" && x_includes="/usr/X11R6/include" - test x"$x_libraries" = x"NONE" && x_libraries="/usr/X11R6/lib" - ;; - esac +dnl Even as of 2.61, autoconf is not smart enough to find the X include +dnl and library paths on Mac OS X, so seed them automatically if they're +dnl not specified on the configure command-line. +case "$host_os" in + darwin*) + test x"$x_includes" = x"NONE" && x_includes="/usr/X11R6/include" + test x"$x_libraries" = x"NONE" && x_libraries="/usr/X11R6/lib" + ;; +esac - dnl Check for Xwindows using the autoconf AC_PATH_XTRA macro, which is an - dnl extension of AC_PATH_X that sets X_CFLAGS and X_LIBS. It will also set - dnl X_EXTRA_LIBS and X_PRE_LIBS. - AC_PATH_XTRA - if test x"$no_x" != x"yes"; then - X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" - fi - ]) +dnl Check for Xwindows using the autoconf AC_PATH_XTRA macro, which is an +dnl extension of AC_PATH_X that sets X_CFLAGS and X_LIBS. It will also set +dnl X_EXTRA_LIBS and X_PRE_LIBS. +AC_PATH_XTRA +if test x"$no_x" != x"yes"; then + X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" +elif test x"$have_x" = x"no"; then + PKG_CHECK_MODULES([X], [x11 xext], [have_x=yes; no_x=no], [have_x=no; no_x=yes]) fi dnl Check for XShm support (required for xine X support) -- cgit v1.2.3