From: <hu...@us...> - 2006-11-29 15:18:56
|
Revision: 9474 http://svn.sourceforge.net/gphoto/?rev=9474&view=rev Author: hun Date: 2006-11-29 07:18:57 -0800 (Wed, 29 Nov 2006) Log Message: ----------- Fix --with-libfoo=PREFIX handling (either use libfoo.la or warn) Modified Paths: -------------- branches/libgphoto2-2_3/m4/gp-check-library.m4 Modified: branches/libgphoto2-2_3/m4/gp-check-library.m4 =================================================================== --- branches/libgphoto2-2_3/m4/gp-check-library.m4 2006-11-29 14:42:46 UTC (rev 9473) +++ branches/libgphoto2-2_3/m4/gp-check-library.m4 2006-11-29 15:18:57 UTC (rev 9474) @@ -245,10 +245,30 @@ elif test "x${[try_][$1]}" = "xno"; then : else - # These settings are given by the user and thus MUST be correct :-) - have_[$1]=yes - [$1][_LIBS]="-L${[try_][$1]}/lib -l$(echo "$2" | sed 's/^lib//')" - [$1][_CFLAGS]="-I${[try_][$1]}/include" + # We've been given a prefix to look in for library $2. + # We start looking for $2.la files first. + AC_MSG_CHECKING([for ][$2][.la file in ${[try_][$1]}]) + if test -f "${[try_][$1]}/lib/[$2].la"; then + [$1][_LIBS]="${[try_][$1]}/lib/[$2].la" + [$1][_CFLAGS]="-I${[try_][$1]}/include" + AC_MSG_RESULT([libtool file $][$1][_LIBS (good)]) + have_[$1]=yes + elif test -f "${[try_][$1]}/lib64/[$2].la"; then # HACK + [$1][_LIBS]="${[try_][$1]}/lib64/[$2].la" + [$1][_CFLAGS]="-I${[try_][$1]}/include" + AC_MSG_RESULT([libtool file $][$1][_LIBS (good)]) + have_[$1]=yes + else + AC_MSG_RESULT([wild guess that something is in $try_][$1]) + [$1][_LIBS]="-L${[try_][$1]}/lib -l$(echo "$2" | sed 's/^lib//')" + [$1][_CFLAGS]="-I${[try_][$1]}/include" + have_[$1]=yes + AC_MSG_WARN([ +* Warning: +* libtool file $2.la could not be found. +* We may be linking against the WRONG library. +]) + fi fi elif test "x${[$1][_LIBS]}" != "x" && test "x${[$1][_CFLAGS]}" != "x"; then AC_MSG_RESULT([user-defined]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |