1 # early-libtool.at -- early libtool script generation -*- Autotest -*-
3 # Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
4 # Written by Gary V. Vaughan, 2005
6 # This file is part of GNU Libtool.
8 # GNU Libtool is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; either version 2 of
11 # the License, or (at your option) any later version.
13 # GNU Libtool is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with GNU Libtool; see the file COPYING. If not, a copy
20 # can be downloaded from http://www.gnu.org/licenses/gpl.html,
21 # or obtained by writing to the Free Software Foundation, Inc.,
22 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 AT_BANNER([libtool script generation.])
28 ## --------------------------------------------- ##
29 ## Building libtool normally from config.status. ##
30 ## --------------------------------------------- ##
32 AT_SETUP([config.status])
34 AT_DATA([configure.ac],
35 [[AC_INIT([libtool-demo], ]]AT_PACKAGE_VERSION[[, ]]AT_PACKAGE_BUGREPORT[[)
36 AC_CONFIG_MACRO_DIR([m4])
38 AC_CONFIG_FILES([Makefile])
42 AT_DATA([Makefile.in],
47 DEFAULT_INCLUDES = -I. -I@srcdir@
56 COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) $(DEFAULT_INCLUDES)
57 LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CPPFLAGS) $(CFLAGS) $(DEFAULT_INCLUDES)
58 LINK = $(LIBTOOL) --mode=link --tag=CC $(CC) $(CFLAGS) $(LDFLAGS) -o $@
63 $(LINK) -rpath $(libdir) hello.lo
64 hell$(EXEEXT): main.$(OBJEXT) libhello.la
65 $(LINK) main.$(OBJEXT) libhello.la
68 .SUFFIXES: .c .$(OBJEXT) .lo
73 $(LTCOMPILE) -c -o $@ $<
82 printf ("** This is not GNU Hello. There is no built-in mail reader. **\n");
89 extern void hello (void);
94 printf ("Welcome to GNU Hell!\n");
108 LT_AT_LIBTOOLIZE([--copy --verbose --install])
109 LT_AT_ACLOCAL([-I m4])
110 LT_AT_AUTOCONF([--force])
114 LT_AT_EXEC_CHECK([./hell], [0], [stdout])
115 AT_CHECK([grep 'Welcome to GNU Hell' stdout], [], [ignore])
116 AT_CHECK([grep 'This is not GNU Hello.' stdout],
122 ## ------------------------------------------ ##
123 ## Building and using libtool from config.lt. ##
124 ## ------------------------------------------ ##
126 AT_SETUP([config.lt])
128 AT_DATA([configure.ac],
129 [[AC_INIT([libtool-demo], ]]AT_PACKAGE_VERSION[[, ]]AT_PACKAGE_BUGREPORT[[)
130 AC_CONFIG_MACRO_DIR([m4])
140 printf ("** This is not GNU Hello. There is no built-in mail reader. **\n");
144 # Prove that we can run libtool from inside configure:
145 $SHELL ./libtool --mode=compile --tag=CC $CC $CPPFLAGS $CFLAGS \
146 -I. -I$srcdir -c -o hello.lo hello.c || exit 1
147 $SHELL ./libtool --mode=link --tag=CC $CC $CFLAGS $LDFLAGS \
148 -o libhello.la -rpath /notexist hello.lo || exit 1
150 AC_CONFIG_FILES([Makefile])
154 AT_DATA([Makefile.in],
159 DEFAULT_INCLUDES = -I. -I@srcdir@
164 CPPFLAGS = @CPPFLAGS@
168 COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS) $(DEFAULT_INCLUDES)
169 LINK = $(LIBTOOL) --mode=link --tag=CC $(CC) $(CFLAGS) $(LDFLAGS) -o $@
173 hell$(EXEEXT): main.$(OBJEXT) libhello.la
174 $(LINK) main.$(OBJEXT) libhello.la
177 .SUFFIXES: .c .$(OBJEXT)
189 printf ("** This is not GNU Hello. There is no built-in mail reader. **\n");
196 extern void hello (void);
199 main (int argc, char *argv[])
201 printf ("Welcome to GNU Hell!\n");
215 LT_AT_LIBTOOLIZE([--copy --verbose --install])
216 LT_AT_ACLOCAL([-I m4])
217 LT_AT_AUTOCONF([--force])
221 LT_AT_EXEC_CHECK([./hell], [0], [stdout])
222 AT_CHECK([grep 'Welcome to GNU Hell' stdout], [], [ignore])
223 AT_CHECK([grep 'This is not GNU Hello.' stdout], [], [ignore])
225 # Make sure config.status --recheck updates the libtool script
227 AT_CHECK([$SHELL ./config.status --recheck],[0],[ignore],[ignore])