~ubuntu-branches/ubuntu/intrepid/plplot/intrepid

« back to all changes in this revision

Viewing changes to cf/acinclude.m4

  • Committer: Bazaar Package Importer
  • Author(s): Rafael Laboissiere
  • Date: 2006-11-04 10:19:34 UTC
  • mfrom: (2.1.8 edgy)
  • Revision ID: james.westby@ubuntu.com-20061104101934-mlirvdg4gpwi6i5q
Tags: 5.6.1-10
* Orphaning the package
* debian/control: Changed the maintainer to the Debian QA Group

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl $Id: acinclude.m4,v 1.7 2004/04/04 20:51:58 rlaboiss Exp $ --*-Autoconf-*--
 
1
dnl $Id: acinclude.m4,v 1.14 2005/11/01 23:44:17 airwin Exp $ --*-Autoconf-*--
2
2
dnl
3
3
dnl Local autoconf extensions.  These are based on the autoconf builtin
4
4
dnl macros, and you can do what you want with them.
24
24
dnl
25
25
dnl You should have received a copy of the GNU Library General Public License
26
26
dnl along with PLplot; if not, write to the Free Software
27
 
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
27
dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
28
28
dnl
29
29
dnl ------------------------------------------------------------------------
30
30
dnl Include macro which knows about the cf/ directory
42
42
dnl
43
43
AC_DEFUN([PL_ARG_ENABLE],[
44
44
  AC_ARG_ENABLE($1,
45
 
    AS_HELP_STRING([--enable-$1], [$2 @<:@default=$3@:>@]),
 
45
    AS_HELP_STRING([--enable-$1], [$2]m4_if($3,,[],[ @<:@default=$3@:>@])),
46
46
    [enable_[]translit($1, [-], [_])=$enableval],
47
47
    [enable_[]translit($1, [-], [_])=$3])])
48
48
dnl ------------------------------------------------------------------------
50
50
dnl
51
51
AC_DEFUN([PL_ARG_WITH],[
52
52
  AC_ARG_WITH($1,
53
 
    AS_HELP_STRING([--with-$1], [$2 @<:@default=$3@:>@]),
 
53
    AS_HELP_STRING([--with-$1], [$2]m4_if($3,,[],[ @<:@default=$3@:>@])),
54
54
    [with_[]translit($1, [-], [_])=$withval],
55
55
    [with_[]translit($1, [-], [_])=$3])])
56
56
dnl ------------------------------------------------------------------------
315
315
    echo "void f(void){}" > foo.c
316
316
    ../libtool --mode=compile $CC -c foo.c > /dev/null
317
317
    ../libtool --mode=link $CC foo.lo -rpath /usr/lib -version-info $2 \
318
 
        -o lib$1.la > /dev/null
 
318
        -o lib$1.la -no-undefined > /dev/null
319
319
    $3=`grep ^dlname= lib$1.la | sed "s/dlname='\(.*\)'/\1/"`
320
320
    cd ..
321
321
    rm -rf $TMP_DIR
324
324
])
325
325
dnl ------------------------------------------------------------------------
326
326
dnl Determine the dlname of a DLL to be installed by libtool
327
 
dnl This is a usefule variation of GET_DLNAME above for dynamically loaded
 
327
dnl This is a useful variation of GET_DLNAME above for dynamically loaded
328
328
dnl libraries (DLL's).
329
329
dnl     PL_GET_DLLNAME(STEM,VARIABLE)
330
330
dnl For a given DLL STEM determine the dlname of the
343
343
    echo "void f(void){}" > foo.c
344
344
    ../libtool --mode=compile $CC -c foo.c > /dev/null
345
345
    ../libtool --mode=link $CC foo.lo -rpath /usr/lib -avoid-version -module \
346
 
        -o $1.la > /dev/null
 
346
        -o $1.la -no-undefined > /dev/null
347
347
    $2=`grep ^dlname= $1.la | sed "s/dlname='\(.*\)'/\1/"`
348
348
    cd ..
349
349
    rm -rf $TMP_DIR
381
381
AC_DEFUN([PL_CONFIG_FILE_EXE],[
382
382
  AC_CONFIG_FILES([$1], [chmod +x $1])
383
383
])
 
384
dnl ------------------------------------------------------------------------
 
385
dnl PL_COMPARE_VERSIONS(version_string_1,version_string_2,
 
386
dnl       action_if_v1_lt_v2,action_if_v1_eq_v2,action_if_v1_gt_v2)
 
387
dnl
 
388
dnl Compare version strings, fields are separated by periods (".")
 
389
dnl
 
390
AC_DEFUN([PL_COMPARE_VERSIONS],[
 
391
  pl_verstr_1=$1
 
392
  pl_verstr_2=$2
 
393
  pl_cmp=eq
 
394
  while test -n "$pl_verstr_1" -o -n "$pl_verstr_2" ; do 
 
395
    pl_v1=`echo $pl_verstr_1 | cut -d. -f1`
 
396
    test -z "$pl_v1" && pl_v1=0
 
397
    pl_verstr_1=`echo $pl_verstr_1 | sed -e 's,^[[^\.]]*\.,,'`
 
398
    pl_v2=`echo $pl_verstr_2 | cut -d. -f1`
 
399
    test -z "$pl_v2" && pl_v2=0
 
400
    pl_verstr_2=`echo $pl_verstr_2 | sed -e 's,^[[^\.]]*\.,,'`
 
401
    if test "$pl_v1" -gt "$pl_v2" ; then
 
402
      pl_cmp=gt
 
403
      break;
 
404
    else 
 
405
      if test "$pl_v1" -lt "$pl_v2" ; then
 
406
        pl_cmp=lt
 
407
        break;
 
408
      fi
 
409
    fi
 
410
  done
 
411
  test $pl_cmp = lt && eval $3
 
412
  test $pl_cmp = eq && eval $4
 
413
  test $pl_cmp = gt && eval $5    
 
414
])