diff -uprN vlc-0.9.0-svn/configure.ac vlc-0.9.0-svn.az/configure.ac --- vlc-0.9.0-svn/configure.ac 2007-10-04 18:10:23.000000000 +0200 +++ vlc-0.9.0-svn.az/configure.ac 2007-10-13 13:44:22.000000000 +0200 @@ -838,7 +838,7 @@ AC_CHECK_HEADERS(cthreads.h pthread.h ke fi # end "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" dnl Find where are the X headers and libraries -AC_PATH_XTRA() +AC_PATH_X() dnl it seems that autoconf do the pkg-config detection only for the first PKG_CHECK_MODULES in the configure.ac ( which is logical) but in our case it is nested in a if so it was not working if you're not on linux or have disable hal. diff -uprN vlc-0.9.0-svn/modules/genmf vlc-0.9.0-svn.az/modules/genmf --- vlc-0.9.0-svn/modules/genmf 2007-09-01 18:58:35.000000000 +0200 +++ vlc-0.9.0-svn.az/modules/genmf 2007-10-13 13:45:02.000000000 +0200 @@ -46,7 +46,7 @@ EXTRA_LTLIBRARIES = ${extra_ltlibs} include Modules.am if HAVE_PLUGINS -LTLIBVLC = -L\$(top_builddir)/src -lvlc +LTLIBVLC = \$(top_builddir)/src/libvlc.la AM_LDFLAGS = -rpath '\$(libvlcdir)' -avoid-version \\ -module -no-undefined -shrext \$(LIBEXT) diff -uprN vlc-0.9.0-svn/vlc-config.in.in vlc-0.9.0-svn.az/vlc-config.in.in --- vlc-0.9.0-svn/vlc-config.in.in 2007-07-17 13:05:30.000000000 +0200 +++ vlc-0.9.0-svn.az/vlc-config.in.in 2007-10-13 13:44:30.000000000 +0200 @@ -232,7 +232,30 @@ while test $# -gt 0; do shift done +is_builtin_gcc_libdir() { + local _libdir="$1" + local x + + for x in `${CC:-gcc} -print-search-dirs | \ + ${AWK:-awk} '/^libraries:/ { + sub(/^libraries:[^\/]*/, "", $0); + split($0, libs, ":"); + for (x in libs) + printf("%s ", libs[x]); + }'` + do + if cd "${x}" 1>/dev/null 2>&1 ; then + local _pwd=`pwd` + test "${_libdir}" = "-L${_pwd}" && return 0 + fi + done + + return 1 +} + libs="-L@libdir@" +# Only add -L$libdir if it is not in te default search path of CC +is_builtin_gcc_libdir "${libs}" && libs="" # # If a module was requested, use its name @@ -335,5 +358,11 @@ if test "${echo_libs}" = yes; then done register_flags "vlc" fi - echo "${libs} ${ldflags}" + new_libs="" + # Only add -L if it is not in te default search path of CC + for x in ${libs} ${ldflags} ; do + is_builtin_gcc_libdir "${x}" || new_libs="${new_libs} ${x}" + done + echo "${new_libs}" fi +