[PATCH] JD_CHECK_FOR_LIBRARY: Improve splitting of include_and_lib

Jörg Sommer <[email protected]>
Newsgroups gmane.network.slrn.user
Message-ID <[email protected]>
The shell pattern is the easiest form to split the variable
include_and_lib in before‐comma and behind‐comma.

diff --git a/autoconf/aclocal.m4 b/autoconf/aclocal.m4
index 8628a3b..f2aebfc 100644
--- a/autoconf/aclocal.m4
+++ b/autoconf/aclocal.m4
@@ -895,8 +895,8 @@ AC_DEFUN(JD_CHECK_FOR_LIBRARY, dnl#{{{
       for include_and_lib in $inc_and_lib_dirs
       do
         # Yuk.  Is there a better way to set these variables??
-        xincdir=`echo $include_and_lib | tr ',' ' ' | awk '{print [$]1}'`
-       xlibdir=`echo $include_and_lib | tr ',' ' ' | awk '{print [$]2}'`
+        xincdir=${include_and_lib%%,*}
+       xlibdir=${include_and_lib##*,}
        found=0
        if test -r $xincdir/$xincfile
        then 
-- 
Macht besitzen und nicht ausüben ist wahre Größe.
                                                   (Friedl Beutelrock)

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.