libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: test old m4 interface [280]


From: Gary V. Vaughan
Subject: FYI: test old m4 interface [280]
Date: Fri, 30 Sep 2005 01:48:23 +0100 (BST)
User-agent: mailnotify/0.7

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Applied to HEAD.

  * looking for address@hidden/libtool--devo--1.0--patch-299 to compare with
  * comparing to address@hidden/libtool--devo--1.0--patch-299
  A  tests/.arch-ids/old-m4-iface.at.id
  A  tests/old-m4-iface.at
  M  Makefile.am
  M  ChangeLog
  M  tests/testsuite.at
  
  * modified files
  
  Index: Changelog
  from  Gary V. Vaughan  <address@hidden>
  
        * tests/old-m4-iface.at: Start of a new test series for m4
        interface backwards compatibility.
        * tests/testsuite.at: Use it.
        (macrodir): Declare the location of uninstalled libtool m4 macros.
        * Makefile.am (TESTSUITE_AT): Depend on it.
  
  --- orig/Makefile.am
  +++ mod/Makefile.am
  @@ -470,6 +470,7 @@
                  tests/duplicate_members.at \
                  tests/inherited_flags.at \
                  tests/libtoolize.at \
  +               tests/old-m4-iface.at \
                  tests/standalone.at \
                  tests/stresstest.at \
                  tests/link-order.at \
  
  
  --- orig/tests/testsuite.at
  +++ mod/tests/testsuite.at
  @@ -22,9 +22,11 @@
   : ${LIBTOOLIZE="${abs_top_builddir}/libtoolize"}
   : ${LIBTOOL="${abs_top_builddir}/libtool"}
   : ${ACLOCAL=aclocal}
  +: ${AUTOHEADER=autoheader}
   : ${AUTOCONF=autoconf}
   : ${AUTORECONF=autoreconf}
  -export LIBTOOLIZE LIBTOOL ACLOCAL AUTOCONF AUTORECONF
  +export LIBTOOLIZE LIBTOOL ACLOCAL AUTOHEADER AUTOCONF AUTORECONF
  +macrodir="$abs_top_srcdir/libltdl/m4"
   eval `$LIBTOOL --config | grep ^EGREP=`
   eval `$LIBTOOL --config | $EGREP '^(host|host_os|build)='`
   m4_divert_pop([PREPARE_TESTS])dnl
  @@ -96,6 +98,8 @@
   m4_include([convenience.at])
   # link order test
   m4_include([link-order.at])
  +# Ensure our continued support for old interfaces.
  +m4_include([old-m4-iface.at])
   # Torturing subdir-objects builds
   m4_include([am-subdir.at])
   # standalone libltdl compilation
  
  
  
  * added files
  
  --- /dev/null
  +++ 
/Users/gary/devel/savannah/libtool--devo--1.0/,,address@hidden/new-files-archive/./tests/.arch-ids/old-m4-iface.at.id
  @@ -0,0 +1 @@
  +Gary V. Vaughan <address@hidden> Fri Sep 30 01:46:11 2005 7844.0
  --- /dev/null
  +++ 
/Users/gary/devel/savannah/libtool--devo--1.0/,,address@hidden/new-files-archive/./tests/old-m4-iface.at
  @@ -0,0 +1,192 @@
  +# Hand crafted tests for GNU Libtool.                         -*- Autotest 
-*-
  +# Copyright 2005 Free Software Foundation, Inc.
  +
  +# This program is free software; you can redistribute it and/or modify
  +# it under the terms of the GNU General Public License as published by
  +# the Free Software Foundation; either version 2, or (at your option)
  +# any later version.
  +
  +# This program is distributed in the hope that it will be useful,
  +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  +# GNU General Public License for more details.
  +
  +# You should have received a copy of the GNU General Public License
  +# along with this program; if not, write to the Free Software
  +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  +# 02110-1301, USA.
  +
  +
  +AT_BANNER([Support for older m4 interface.])
  +
  +########################################################################
  +##
  +## TODO:
  +##   test all the interfaces currently supported by AU_DEFUN/AU_ALIAS
  +##   test autoupdate on all of those tests' configure.in
  +##
  +########################################################################
  +
  +## -------------------------------------------------------- ##
  +## An overtly simple old-school AM_PROG_LIBTOOL invocation. ##
  +## -------------------------------------------------------- ##
  +
  +AT_SETUP([AM_PROG_LIBTOOL])
  +
  +AT_DATA([configure.in],
  +[[AC_INIT(old.c)
  +AM_PROG_LIBTOOL
  +AC_OUTPUT(Makefile)
  +]])
  +
  +AT_DATA([Makefile.in],
  +[[COMPILE = @CC@ @CPPFLAGS@ @CFLAGS@
  +LINK      = @CC@ @CFLAGS@ @LDFLAGS@ -o $@
  +SHELL     = @SHELL@
  +
  +all: address@hidden@
  +
  address@hidden@: address@hidden@
  +     $(LINK) address@hidden@
  +
  +.SUFFIXES:
  +.SUFFIXES: .c address@hidden@
  +
  address@hidden@:
  +     $(COMPILE) -c $<
  +]])
  +
  +
  +AT_DATA([old.c],
  +[[#include <stdio.h>
  +
  +int main (int argc, char **argv)
  +{
  +  printf ("Hello, World!");
  +  return 0;
  +}
  +]])
  +
  +test -f ltmain.sh  || LT_AT_LIBTOOLIZE([--install])
  +
  +# This is slightly bogus, since only libtool.m4 was required in aclocal.m4
  +# with libtool-1.5x...
  +test -f aclocal.m4 \
  +    || cat "$macrodir/libtool.m4" "$macrodir/ltoptions.m4" \
  +     "$macrodir/ltsugar.m4" "$macrodir/ltversion.m4" > aclocal.m4 \
  +    || exit 1
  +
  +test -f configure  || $AUTOCONF --force || exit 1
  +test -f Makefile   || ./configure       || exit 1
  +${MAKE-make}
  +
  +LT_AT_EXEC_CHECK([./old], 0, [Hello, World!])
  +
  +AT_CLEANUP
  +
  +
  +## --------------------------- ##
  +## An old style libltdl build. ##
  +## --------------------------- ##
  +
  +AT_SETUP([AC_WITH_LTDL])
  +
  +AT_DATA([configure.in],
  +[[AC_INIT(old.c)
  +AC_PROG_MAKE_SET
  +AM_PROG_LIBTOOL
  +AC_WITH_LTDL
  +AC_OUTPUT(Makefile)
  +]])
  +
  +AT_DATA([Makefile.in],
  +[[top_builddir       = .
  +COMPILE              = @CC@ @CPPFLAGS@ @INCLTDL@  @CFLAGS@
  +LTCOMPILE    = @LIBTOOL@ --mode=compile $(COMPILE)
  +LTLINK               = @LIBTOOL@ --mode=link @CC@ -no-undefined @CFLAGS@ 
@LDFLAGS@ -o $@
  +SHELL                = @SHELL@
  address@hidden@
  +
  +TARGETS    = libltdl/libltdlc.la module.la address@hidden@
  +
  +all: $(TARGETS)
  +
  +libltdl/libltdlc.la:
  +     cd libltdl && ./configure && $(MAKE)
  +
  +module.la: module.lo
  +     $(LTLINK) module.lo -module -avoid-version -rpath /dev/null
  +
  address@hidden@: address@hidden@
  +     $(LTLINK) address@hidden@ -dlopen module.la @LIBLTDL@
  +
  +.SUFFIXES:
  +.SUFFIXES: .c address@hidden@ .lo
  +
  address@hidden@:
  +     $(COMPILE) -c $<
  +
  +.c.lo:
  +     $(LTCOMPILE) -c -o $@ $<
  +]])
  +
  +AT_DATA([old.c],
  +[[#include <stdio.h>
  +#include "ltdl.h"
  +
  +int main (int argc, char **argv)
  +{
  +  lt_dlhandle module;
  +  const char *(*foo) (const char *) = 0;
  +  int status = 1;
  +
  +  LTDL_SET_PRELOADED_SYMBOLS();
  +  if (lt_dlinit() != 0) {
  +    fprintf (stderr, "error during initialisation: %s\n", lt_dlerror());
  +    return 1;
  +  }
  +
  +  module = lt_dlopen("module.la");
  +  if (!module) {
  +    fprintf (stderr, "error dlopening module.la: %s\n", lt_dlerror());
  +    goto finish;
  +  }
  +
  +  foo = (const char *(*)(const char *)) lt_dlsym (module, "foo");
  +  if (!foo) {
  +    fprintf (stderr, "error fetching func: %s\n", lt_dlerror());
  +    goto finish;
  +  }
  +
  +  printf ("%s", (*foo) ("foo bar"));
  +  status = 0;
  +
  +finish:
  +  if (lt_dlexit() != 0) {
  +    fprintf (stderr, "error during finalisation: %s\n", lt_dlerror());
  +    status = 1;
  +  }
  +
  +  return status;
  +}
  +]])
  +
  +AT_DATA([module.c],
  +[[const char *
  +foo (const char *str)
  +{
  +  while (*str++ != ' ')
  +    ;
  +  return str;
  +}
  +]])
  +
  +test -f ltmain.sh  || LT_AT_LIBTOOLIZE([--ltdl --install])
  +test -f aclocal.m4 || $ACLOCAL -I libltdl/m4 || exit 1
  +test -f configure  || $AUTOCONF --force      || exit 1
  +test -f Makefile   || ./configure            || exit 1
  +${MAKE-make}
  +
  +LT_AT_EXEC_CHECK([./old], 0, [bar])
  +
  +AT_CLEANUP
  
- -- 
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook
_________________________________________________________
This patch notification generated by tlaapply version 1.0
http://tkd.kicks-ass.net/arch/address@hidden/cvs-utils--tla--1.0
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFDPItVFRMICSmD1gYRAj6SAKCN5xERZchWDrfO5k/NbuvYCn5mVgCfVI6/
3UJL9wbS3OsglLmlq78OEhA=
=04pP
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]