* libltdl/m4/libtool.m4 (_LT_PROG_FC): Undo commit - bad idea.
[libtool.git] / Makefile.am
blob771c8efe3550411f466556280eee743f054537d9
1 ## Makefile.am -- Process this file with automake to produce Makefile.in
2 ##
3 ##   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008  Free Software
4 ##   Foundation, Inc.
5 ##   Written by Gary V. Vaughan, 2003
6 ##
7 ##   This file is part of GNU Libtool.
8 ##
9 ## GNU Libtool is free software; you can redistribute it and/or
10 ## modify it under the terms of the GNU General Public License as
11 ## published by the Free Software Foundation; either version 2 of
12 ## the License, or (at your option) any later version.
14 ## GNU Libtool is distributed in the hope that it will be useful,
15 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 ## GNU General Public License for more details.
19 ## You should have received a copy of the GNU General Public License
20 ## along with GNU Libtool; see the file COPYING.  If not, a copy
21 ## can be downloaded from  http://www.gnu.org/licenses/gpl.html,
22 ## or obtained by writing to the Free Software Foundation, Inc.,
23 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #####
26 ACLOCAL_AMFLAGS         = -I libltdl/m4
28 AM_CPPFLAGS             =
29 AM_LDFLAGS              =
31 DIST_SUBDIRS            = .
32 EXTRA_DIST              =
34 BUILT_SOURCES           = libtool
36 CLEANFILES              =
37 MOSTLYCLEANFILES        =
38 DISTCLEANFILES          =
40 include_HEADERS         =
41 noinst_LTLIBRARIES      =
42 lib_LTLIBRARIES         =
43 EXTRA_LTLIBRARIES       =
45 auxdir                  = libltdl/config
46 m4dir                   = libltdl/m4
48 # Using `cd' in backquotes may print the directory name, use this instead:
49 lt__cd          = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
51 MKSTAMP = $(SHELL) $(srcdir)/$(auxdir)/mkstamp
53 timestamp = set dummy `$(MKSTAMP) < $(srcdir)/ChangeLog`; shift; \
54         case $(VERSION) in \
55           *[acegikmoqsuwy]) TIMESTAMP=" $$1 $$2 $$3" ;; \
56           *) TIMESTAMP="" ;; \
57         esac
59 rebuild = rebuild=:; $(timestamp); correctver=$$1
62 ## ---------------- ##
63 ## Libtool scripts. ##
64 ## ---------------- ##
66 # The libtool distributor and the standalone libtool script.
67 bin_SCRIPTS = libtoolize libtool
69 libtoolize: $(srcdir)/libtoolize.in $(top_builddir)/config.status
70         rm -f libtoolize.tmp libtoolize
71         $(timestamp); \
72         input="libtoolize.m4sh"; \
73         $(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" \
74                 -e 's,@aclocal_DATA\@,$(aclocalfiles),g' \
75                 -e "s,@pkgltdl_files\@,$(ltdldatafiles),g" \
76                 -e "s,@pkgconfig_files\@,$(auxfiles),g" \
77                 $(srcdir)/libtoolize.in > libtoolize.tmp
78         chmod a+x libtoolize.tmp
79         chmod a-w libtoolize.tmp
80         mv -f libtoolize.tmp libtoolize
82 # Use `$(srcdir)' for the benefit of non-GNU makes: this is
83 # how libtoolize.in appears in our dependencies.
84 EXTRA_DIST += libtoolize.m4sh
85 $(srcdir)/libtoolize.in: $(sh_files) libtoolize.m4sh Makefile.am
86         cd $(srcdir); \
87         rm -f libtoolize.in; \
88         $(M4SH) -B $(auxdir) libtoolize.m4sh > libtoolize.in
90 # We used to do this with a 'stamp-vcl' file, but non-gmake builds
91 # would rerun configure on every invocation, so now we manually
92 # check the version numbers from the build rule when necessary.
93 libtool: $(top_builddir)/config.status $(srcdir)/$(auxdir)/ltmain.sh ChangeLog
94         @target=libtool; $(rebuild); \
95         if test -f "$$target"; then \
96           set dummy `./$$target --version | sed 1q`; actualver="$$5"; \
97           test "$$actualver" = "$$correctver" && rebuild=false; \
98         fi; \
99         for prereq in $?; do \
100           case $$prereq in *ChangeLog);; *) rebuild=:;; esac; \
101         done; \
102         if $$rebuild; then \
103           echo $(SHELL) ./config.status $$target; \
104           cd $(top_builddir) && $(SHELL) ./config.status $$target; \
105         fi
107 .PHONY: configure-subdirs
108 configure-subdirs distdir: $(DIST_MAKEFILE_LIST)
109 @DIST_MAKEFILE_LIST@:
110         dir=`echo $@ | sed 's,^[^/]*$$,.,;s,/[^/]*$$,,'`; \
111         test -d $$dir || mkdir $$dir || exit 1; \
112         abs_srcdir=`$(lt__cd) $(srcdir) && pwd`; \
113         (cd $$dir && $$abs_srcdir/$$dir/configure --with-dist) || exit 1
116 # ---------- #
117 # Bootstrap. #
118 # ---------- #
120 edit = sed \
121         -e 's,@EGREP\@,$(EGREP),g' \
122         -e 's,@FGREP\@,$(FGREP),g' \
123         -e 's,@GREP\@,$(GREP),g' \
124         -e 's,@LN_S\@,$(LN_S),g' \
125         -e 's,@MACRO_VERSION\@,$(VERSION),g' \
126         -e 's,@PACKAGE\@,$(PACKAGE),g' \
127         -e 's,@PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
128         -e 's,@PACKAGE_NAME\@,$(PACKAGE),g' \
129         -e 's,@PACKAGE_STRING\@,$(PACKAGE) $(VERSION),g' \
130         -e 's,@PACKAGE_TARNAME\@,$(PACKAGE),g' \
131         -e 's,@PACKAGE_VERSION\@,$(VERSION),g' \
132         -e 's,@SED\@,$(SED),g' \
133         -e 's,@VERSION\@,$(VERSION),g' \
134         -e 's,@aclocaldir\@,$(aclocaldir),g' \
135         -e 's,@datadir\@,$(datadir),g' \
136         -e 's,@pkgdatadir\@,$(pkgdatadir),g' \
137         -e 's,@host_triplet\@,$(host_triplet),g' \
138         -e 's,@prefix\@,$(prefix),g' \
139         -e "s,@configure_input\@,Generated from $$input.,g"
141 sh_files        = $(auxdir)/general.m4sh $(auxdir)/getopt.m4sh
142 EXTRA_DIST     += bootstrap $(srcdir)/libtoolize.in $(auxdir)/ltmain.m4sh \
143                   $(auxdir)/mkstamp $(sh_files) \
144                   ChangeLog.1996 ChangeLog.1997 ChangeLog.1998 \
145                   ChangeLog.1999 ChangeLog.2000 ChangeLog.2001 \
146                   ChangeLog.2002 ChangeLog.2003 ChangeLog.2004 \
147                   ChangeLog.2005 ChangeLog.2006 ChangeLog.2007
148 CLEANFILES     += libtool libtoolize libtoolize.tmp \
149                   $(auxdir)/ltmain.tmp $(m4dir)/ltversion.tmp
151 ## We build ltversion.m4 here, instead of from config.status,
152 ## because config.status is rerun each time one of configure's
153 ## dependencies change and ltversion.m4 happens to be a configure
154 ## dependency.  configure and ltversion.m4 would be rebuilt in
155 ## a loop otherwise.
156 ## We used to do this with a 'stamp-vcl' file, but non-gmake builds
157 ## would rerun configure on every invocation, so now we manually
158 ## check the version numbers from the build rule when necessary.
159 ## Use `$(srcdir)/m4' for the benefit of non-GNU makes: this is
160 ## how ltversion.m4 appears in our dependencies.
161 EXTRA_DIST += $(m4dir)/ltversion.in $(srcdir)/$(m4dir)/ltversion.m4
162 $(srcdir)/$(m4dir)/ltversion.m4: $(m4dir)/ltversion.in configure.ac ChangeLog
163         @target='$(srcdir)/$(m4dir)/ltversion.m4'; $(rebuild); \
164         if test -f "$$target"; then \
165           set dummy `sed -n '/^# serial /p' "$$target"`; shift; \
166           actualver=1.$$3; \
167           test "$$actualver" = "$$correctver" && rebuild=false; \
168         fi; \
169         for prereq in $?; do \
170           case $$prereq in *ChangeLog | *configure.ac);; *) rebuild=:;; esac; \
171         done; \
172         if $$rebuild; then \
173           cd $(srcdir); \
174           rm -f $(m4dir)/ltversion.tmp; \
175           serial=`echo "$$correctver" | sed 's,^1[.],,g'`; \
176           input="ltversion.in"; \
177           echo $(edit) -e "s,@MACRO_REVISION\@,$$correctver,g" \
178             -e "s,@MACRO_SERIAL\@,$$serial,g" \
179             $(srcdir)/$(m4dir)/ltversion.in \> $(srcdir)/$(m4dir)/ltversion.m4; \
180           $(edit) -e "s,@MACRO_REVISION\@,$$correctver,g" \
181                   -e "s,@MACRO_SERIAL\@,$$serial,g" \
182                   $(m4dir)/ltversion.in > $(m4dir)/ltversion.tmp; \
183           chmod a-w $(m4dir)/ltversion.tmp; \
184           mv -f $(m4dir)/ltversion.tmp $(m4dir)/ltversion.m4; \
185         fi
187 ## And for similar reasons, ltmain.sh can't be built from config.status.
188 ## We used to do this with a 'stamp-vcl' file, but non-gmake builds
189 ## would rerun configure on every invocation, so now we manually
190 ## check the version numbers from the build rule when necessary.
191 ## !WARNING! If you edit this rule to change the contents of ltmain.sh,
192 ##           you must `touch $(srcdir)/$(auxdir)/ltmain.in' from the
193 ##           shell if you need ltmain.sh to be regenerated.  Ideally, we
194 ##           should make this rule depend on Makefile but that will break
195 ##           distcheck (at least) by rebuilding ltmain.sh in the source
196 ##           tree whenever config.status regenerates the Makefile.
197 EXTRA_DIST += $(srcdir)/$(auxdir)/ltmain.sh
198 $(srcdir)/$(auxdir)/ltmain.sh: $(sh_files) $(auxdir)/ltmain.m4sh configure.ac ChangeLog
199         @target='$(srcdir)/$(auxdir)/ltmain.sh'; $(rebuild); \
200         if test -f "$$target"; then \
201           eval `sed -n '/^package_revision=/p' "$$target"`; \
202           actualver=$$package_revision; \
203           test "$$actualver" = "$$correctver" && rebuild=false; \
204         fi; \
205         for prereq in $?; do \
206           case $$prereq in *ChangeLog);; *) rebuild=:;; esac; \
207         done; \
208         if $$rebuild; then \
209           cd $(srcdir); \
210           rm -f $(auxdir)/ltmain.in $(auxdir)/ltmain.tmp \
211             $(auxdir)/ltmain.sh; \
212           echo $(M4SH) -B $(auxdir) $(auxdir)/ltmain.m4sh \
213             \> $(auxdir)/ltmain.in; \
214           $(M4SH) -B $(auxdir) $(auxdir)/ltmain.m4sh \
215             > $(auxdir)/ltmain.in; \
216           input="ltmain.m4sh"; \
217           echo $(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" \
218             -e "s,@package_revision\@,$$correctver," \
219             $(srcdir)/$(auxdir)/ltmain.in "> $$target"; \
220           $(edit) -e "s,@TIMESTAMP\@,$$TIMESTAMP,g" \
221                 -e "s,@package_revision\@,$$1,g" \
222                 $(auxdir)/ltmain.in > $(auxdir)/ltmain.tmp; \
223           rm -f $(auxdir)/ltmain.in; \
224           chmod a-w $(auxdir)/ltmain.tmp; \
225           mv -f $(auxdir)/ltmain.tmp $(auxdir)/ltmain.sh; \
226         fi
228 $(srcdir)/libltdl/Makefile.am: $(srcdir)/libltdl/Makefile.inc
229         cd $(srcdir); \
230         in=libltdl/Makefile.inc; out=libltdl/Makefile.am; \
231         rm -f $$out; \
232         ( $(SED) -n '1,/^.. DO NOT REMOVE THIS LINE -- /p' $$in; \
233         { echo 'ACLOCAL_AMFLAGS = -I m4'; \
234           echo 'AUTOMAKE_OPTIONS = foreign'; \
235           echo 'AM_CPPFLAGS ='; \
236           echo 'AM_LDFLAGS ='; \
237           echo 'BUILT_SOURCES ='; \
238           echo 'include_HEADERS ='; \
239           echo 'noinst_LTLIBRARIES ='; \
240           echo 'lib_LTLIBRARIES ='; \
241           echo 'EXTRA_LTLIBRARIES ='; \
242           echo 'EXTRA_DIST ='; \
243           echo 'CLEANFILES ='; \
244           echo 'MOSTLYCLEANFILES ='; \
245         }; \
246         $(SED) -n '/^.. DO NOT REMOVE THIS LINE -- /,$$p' $$in | \
247         $(SED) -e 's,libltdl_,,; s,libltdl/,,; s,: libltdl/,: ,' \
248                -e 's,\$$(libltdl_,$$(,' \
249         ) | \
250         $(SED) -e '/^.. DO NOT REMOVE THIS LINE -- /d' \
251                -e '1s,^\(.. Makefile.\)inc.*,\1am -- Process this file with automake to produce Makefile.in,' > $$out;
252         chmod a-w $(srcdir)/libltdl/Makefile.am
255 ## Unfortunately, all this bogeyness means that we have to manually
256 ## keep the generated files in libltdl up to date.
257 all-local: $(srcdir)/libltdl/aclocal.m4 \
258         $(srcdir)/libltdl/stamp-mk \
259         $(srcdir)/libltdl/configure \
260         $(srcdir)/libltdl/config-h.in
262 EXTRA_DIST += $(srcdir)/libltdl/stamp-mk $(m4dir)/lt~obsolete.m4
264 $(srcdir)/libltdl/Makefile.in: $(srcdir)/libltdl/Makefile.am \
265             $(srcdir)/libltdl/aclocal.m4 
266         cd $(srcdir)/libltdl && $(AUTOMAKE) Makefile
268 $(srcdir)/libltdl/stamp-mk: $(srcdir)/libltdl/Makefile.in
269         cd $(srcdir)/libltdl && \
270         sed -e 's,config/mdate-sh,,' -e 's,config/texinfo.tex,,' \
271             -e 's,config/mkinstalldirs,,' \
272             < Makefile.in > Makefile.inT && \
273         mv -f Makefile.inT Makefile.in
274         echo stamp > $@
276 sub_aclocal_m4_deps = \
277         $(srcdir)/libltdl/configure.ac \
278         $(m4dir)/libtool.m4 \
279         $(m4dir)/ltoptions.m4 \
280         $(m4dir)/ltdl.m4 \
281         $(srcdir)/$(m4dir)/ltversion.m4 \
282         $(m4dir)/ltsugar.m4 \
283         $(m4dir)/argz.m4 \
284         $(m4dir)/lt~obsolete.m4
286 sub_configure_deps = $(sub_aclocal_m4_deps) $(srcdir)/libltdl/aclocal.m4
288 $(srcdir)/libltdl/aclocal.m4: $(sub_aclocal_m4_deps)
289         cd $(srcdir)/libltdl && $(ACLOCAL) -I m4
291 $(srcdir)/libltdl/configure: $(sub_configure_deps)
292         cd $(srcdir)/libltdl && $(AUTOCONF)
294 $(srcdir)/libltdl/config-h.in: $(sub_configure_deps)
295         cd $(srcdir)/libltdl && $(AUTOHEADER)
296         touch $@
299 ## -------- ##
300 ## Libltdl. ##
301 ## -------- ##
303 include libltdl/Makefile.inc
305 if ! LTDL_SUBDIR_LIBOBJS
306 ## workaround for Autoconf 2.59, Automake 1.9.6:
307 ## we include these files twice, because of missing LIBOBJDIR support.
308 EXTRA_DIST += \
309         argz.c libltdl/argz.c \
310         lt__dirent.c libltdl/lt__dirent.c \
311         lt__strl.c libltdl/lt__strl.c
312 endif
315 ## -------------- ##
316 ## Documentation. ##
317 ## -------------- ##
319 info_TEXINFOS           = doc/libtool.texi
320 doc_libtool_TEXINFOS    = doc/PLATFORMS doc/fdl.texi doc/notes.texi
321 EXTRA_DIST             += $(srcdir)/doc/notes.txt
322 ## Workaround for a texinfo bug described here:
323 ## http://thread.gmane.org/gmane.comp.tex.texinfo.bugs/3930
324 DISTCLEANFILES         += libtool.dvi
326 all-local: $(srcdir)/doc/notes.txt
328 $(srcdir)/doc/notes.txt: $(srcdir)/doc/notes.texi
329         cd $(srcdir)/doc && \
330           $(MAKEINFO) --no-headers $(MAKEINFOFLAGS) -o notes.txt notes.texi
333 ## ------------- ##
334 ## Installation. ##
335 ## ------------- ##
337 # These are required by libtoolize and must be executable when installed.
338 # The timestamps on these files must be preserved carefully so we install,
339 # uninstall and set executable with custom rules here.
340 auxexefiles     = config/compile config/config.guess config/config.sub \
341                   config/depcomp config/install-sh config/missing
342 auxfiles        = $(auxexefiles) config/ltmain.sh
344 # Everything that gets picked up by aclocal is automatically distributed,
345 # this is the list of macro files we install on the user's system.
346 aclocalfiles    = m4/argz.m4 m4/libtool.m4 m4/ltdl.m4 m4/ltoptions.m4 \
347                   m4/ltsugar.m4 m4/ltversion.m4 m4/lt~obsolete.m4
349 ## These are installed as a subdirectory of pkgdatadir so that
350 ## libtoolize --ltdl can find them later:
351 ltdldatafiles   = libltdl/COPYING.LIB \
352                   libltdl/README \
353                   libltdl/Makefile.inc \
354                   libltdl/Makefile.am \
355                   libltdl/configure.ac \
356                   libltdl/aclocal.m4 \
357                   libltdl/Makefile.in \
358                   libltdl/config-h.in \
359                   libltdl/configure \
360                   libltdl/argz_.h \
361                   libltdl/argz.c \
362                   libltdl/loaders/dld_link.c \
363                   libltdl/loaders/dlopen.c \
364                   libltdl/loaders/dyld.c \
365                   libltdl/loaders/load_add_on.c \
366                   libltdl/loaders/loadlibrary.c \
367                   libltdl/loaders/shl_load.c \
368                   libltdl/lt__dirent.c \
369                   libltdl/lt__strl.c \
370                   $(libltdl_libltdl_la_SOURCES)
372 install-data-local: libltdl/Makefile.in
373         @$(NORMAL_INSTALL)
374 ## Don't install over the top of an old pkgdatadir
375         -rm -rf $(DESTDIR)$(pkgdatadir)/*
376 ## To avoid spurious reconfiguration when the user installs these files
377 ## with libtoolize, we have to install them in the correct order:
378 ## First, put a copy of the libtool m4 macros in the aclocal dir
379         $(mkinstalldirs) $(DESTDIR)$(aclocaldir)
380         @list='$(aclocalfiles)'; for p in $$list; do \
381           f=`echo "$$p" | sed 's|^.*/||'`; \
382           echo " $(INSTALL_DATA) '$(srcdir)/$(m4dir)/$$f' '$(DESTDIR)$(aclocaldir)/$$f'"; \
383           $(INSTALL_DATA) "$(srcdir)/$(m4dir)/$$f" "$(DESTDIR)$(aclocaldir)/$$f"; \
384         done
385 ## install the helper scripts
386         $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
387         $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/config
388         @list='$(auxfiles)' && for p in $$list; do \
389           echo " $(INSTALL_SCRIPT) '$(srcdir)/libltdl/$$p' '$(DESTDIR)$(pkgdatadir)/$$p'"; \
390           $(INSTALL_SCRIPT) "$(srcdir)/libltdl/$$p" "$(DESTDIR)$(pkgdatadir)/$$p"; \
391         done
392 ## install the libltdl files
393         $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/libltdl
394         $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/libltdl/libltdl
395         $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/libltdl/loaders
396         @list='$(ltdldatafiles)' && for p in $$list; do \
397           echo " $(INSTALL_DATA) '$(srcdir)/$$p' '$(DESTDIR)$(pkgdatadir)/$$p'"; \
398           $(INSTALL_DATA) "$(srcdir)/$$p" "$(DESTDIR)$(pkgdatadir)/$$p"; \
399         done
400         -chmod a+x $(DESTDIR)$(pkgdatadir)/libltdl/configure
403 ## ------------- ##
404 ## Distribution. ##
405 ## ------------- ##
407 uninstall-hook:
408         @$(NORMAL_UNINSTALL)
409         @list='$(ltdldatafiles) $(auxfiles)'; for f in $$list; do \
410           echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \
411           rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \
412         done
413         @for p in $(aclocalfiles); do \
414           f=`echo "$$p" | sed 's|^.*/||'`; \
415           echo " rm -f '$(DESTDIR)$(aclocaldir)/$$f'"; \
416           rm -f "$(DESTDIR)$(aclocaldir)/$$f"; \
417         done
419 dist-hook:
420 ## Ship README.alpha only in alpha release, but renamed to README
421         @if test -f $(srcdir)/README.alpha; then \
422         case $(VERSION) in \
423           *[a-z]) cp -p $(srcdir)/README.alpha $(distdir)/README ;; \
424         esac; else :; fi
427 ## ----------- ##
428 ## Test suite. ##
429 ## ----------- ##
431 # The testsuite files are evaluated in the order given here.
432 TESTSUITE       = tests/testsuite
433 TESTSUITE_AT    = tests/testsuite.at \
434                   tests/libtoolize.at \
435                   tests/duplicate_members.at \
436                   tests/duplicate_conv.at \
437                   tests/duplicate_deps.at \
438                   tests/inherited_flags.at \
439                   tests/convenience.at \
440                   tests/link-order.at \
441                   tests/link-order2.at \
442                   tests/fail.at \
443                   tests/shlibpath.at \
444                   tests/runpath-in-lalib.at \
445                   tests/static.at \
446                   tests/export.at \
447                   tests/search-path.at \
448                   tests/indirect_deps.at \
449                   tests/archive-in-archive.at \
450                   tests/execute-mode.at \
451                   tests/destdir.at \
452                   tests/old-m4-iface.at \
453                   tests/am-subdir.at \
454                   tests/lt_dlexit.at \
455                   tests/lt_dladvise.at \
456                   tests/need_lib_prefix.at \
457                   tests/standalone.at \
458                   tests/subproject.at \
459                   tests/nonrecursive.at \
460                   tests/recursive.at \
461                   tests/template.at \
462                   tests/ctor.at \
463                   tests/early-libtool.at \
464                   tests/deplibs-ident.at \
465                   tests/configure-iface.at \
466                   tests/stresstest.at \
467                   tests/cmdline_wrap.at
469 EXTRA_DIST     += $(srcdir)/$(TESTSUITE) $(TESTSUITE_AT) $(srcdir)/tests/package.m4
471 # Be sure to reexport important environment variables:
472 TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
473         CPP="$(CPP)" CPPFLAGS="$(CPPFLAGS)" LD="$(LD)" LDFLAGS="$(LDFLAGS)" \
474         LIBS="$(LIBS)" LN_S="$(LN_S)" NM="$(NM)" RANLIB="$(RANLIB)" \
475         STRIP="$(STRIP)" \
476         OBJEXT="$(OBJEXT)" EXEEXT="$(EXEEXT)" \
477         SHELL="$(SHELL)" CONFIG_SHELL="$(SHELL)" \
478         CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" CXXCPP="$(CXXCPP)" \
479         F77="$(F77)" FFLAGS="$(FFLAGS)" \
480         FC="$(FC)" FCFLAGS="$(FCFLAGS)" \
481         GCJ="$(GCJ)" GCJFLAGS="$(GCJFLAGS)"
483 BUILDCHECK_ENVIRONMENT = _lt_pkgdatadir="$(abs_top_srcdir)" \
484         LIBTOOLIZE="$(abs_top_builddir)/libtoolize" \
485         LIBTOOL="$(abs_top_builddir)/libtool" \
486         tst_aclocaldir="$(abs_top_srcdir)/libltdl/m4"
488 INSTALLCHECK_ENVIRONMENT = \
489         LIBTOOLIZE="$(bindir)/`echo libtoolize | sed '$(program_transform_name)'`" \
490         LIBTOOL="$(bindir)/`echo libtool | sed '$(program_transform_name)'`" \
491         LTDLINCL="-I$(includedir)" \
492         LIBLTDL="$(libdir)/libltdl.la" \
493         tst_aclocaldir="$(aclocaldir)"
495 # Use `$(srcdir)' for the benefit of non-GNU makes: this is
496 # how `testsuite' appears in our dependencies.
497 $(srcdir)/$(TESTSUITE): $(srcdir)/tests/package.m4 $(TESTSUITE_AT) Makefile.am
498         cd $(srcdir)/tests && \
499         $(AUTOTEST) `echo $(TESTSUITE_AT) | sed 's,tests/,,g'` -o testsuite.tmp && \
500         mv -f testsuite.tmp testsuite
502 $(srcdir)/tests/package.m4: $(srcdir)/configure.ac
503         { \
504           echo '# Signature of the current package.'; \
505           echo 'm4_define([AT_PACKAGE_NAME],      [@PACKAGE_NAME@])'; \
506           echo 'm4_define([AT_PACKAGE_TARNAME],   [@PACKAGE_TARNAME@])'; \
507           echo 'm4_define([AT_PACKAGE_VERSION],   [@PACKAGE_VERSION@])'; \
508           echo 'm4_define([AT_PACKAGE_STRING],    [@PACKAGE_STRING@])'; \
509           echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
510         } | $(edit) > $(srcdir)/tests/package.m4
512 tests/atconfig: $(top_builddir)/config.status
513         $(SHELL) ./config.status tests/atconfig
515 DISTCLEANFILES += tests/atconfig
517 CD_TESTDIR      = abs_srcdir=`$(lt__cd) $(srcdir) && pwd`; cd tests
519 # Hook the test suite into the check rule
520 check-local: tests/atconfig $(srcdir)/$(TESTSUITE) libltdl/libltdlc.la $(bin_SCRIPTS)
521         $(CD_TESTDIR); \
522         CONFIG_SHELL="$(SHELL)" $(SHELL) $$abs_srcdir/$(TESTSUITE) \
523           $(TESTS_ENVIRONMENT) $(BUILDCHECK_ENVIRONMENT) $(TESTSUITEFLAGS)
525 # Run the test suite on the *installed* tree.
526 installcheck-local:
527         $(CD_TESTDIR); \
528         CONFIG_SHELL="$(SHELL)" $(SHELL) $$abs_srcdir/$(TESTSUITE) \
529           $(TESTS_ENVIRONMENT) $(INSTALLCHECK_ENVIRONMENT) $(TESTSUITEFLAGS) \
530           AUTOTEST_PATH="$(exec_prefix)/bin"
532 # We need to remove any file droppings left behind by testsuite
533 clean-local: clean-local-legacy
534         -$(CD_TESTDIR); \
535         test -f $$abs_srcdir/$(TESTSUITE) && \
536             $(SHELL) $$abs_srcdir/$(TESTSUITE) --clean
539 ## ------------- ##
540 ## Legacy tests. ##
541 ## ------------- ##
543 # !WARNING! Don't add any new tests here, we are migrating to an
544 #           Autotest driven framework, please add new test cases
545 #           using the new framework above.  When the migration is
546 #           complete this section should be removed.
548 CXX_TESTS = \
549         tests/tagdemo-static.test tests/tagdemo-make.test \
550         tests/tagdemo-exec.test tests/tagdemo-conf.test \
551         tests/tagdemo-make.test tests/tagdemo-exec.test \
552         tests/tagdemo-shared.test tests/tagdemo-make.test \
553         tests/tagdemo-exec.test tests/tagdemo-undef.test \
554         tests/tagdemo-make.test tests/tagdemo-exec.test
556 F77_TESTS = \
557         tests/f77demo-static.test tests/f77demo-make.test \
558         tests/f77demo-exec.test tests/f77demo-conf.test \
559         tests/f77demo-make.test tests/f77demo-exec.test \
560         tests/f77demo-shared.test tests/f77demo-make.test \
561         tests/f77demo-exec.test
563 FC_TESTS = \
564         tests/fcdemo-static.test tests/fcdemo-make.test \
565         tests/fcdemo-exec.test tests/fcdemo-conf.test \
566         tests/fcdemo-make.test tests/fcdemo-exec.test \
567         tests/fcdemo-shared.test tests/fcdemo-make.test \
568         tests/fcdemo-exec.test
570 COMMON_TESTS = \
571         tests/link.test tests/link-2.test tests/nomode.test \
572         tests/objectlist.test tests/quote.test tests/sh.test \
573         tests/suffix.test tests/tagtrace.test \
574         tests/cdemo-static.test tests/cdemo-make.test tests/cdemo-exec.test \
575         tests/demo-static.test tests/demo-make.test tests/demo-exec.test \
576         tests/demo-inst.test tests/demo-unst.test \
577         tests/depdemo-static.test tests/depdemo-make.test \
578         tests/depdemo-exec.test tests/depdemo-inst.test \
579         tests/depdemo-unst.test \
580         tests/mdemo-static.test tests/mdemo-make.test tests/mdemo-exec.test \
581         tests/mdemo-inst.test tests/mdemo-unst.test \
582         tests/cdemo-conf.test tests/cdemo-make.test tests/cdemo-exec.test \
583         tests/demo-conf.test tests/demo-make.test tests/demo-exec.test \
584         tests/demo-inst.test tests/demo-unst.test tests/demo-deplibs.test \
585         tests/depdemo-conf.test tests/depdemo-make.test \
586         tests/depdemo-exec.test tests/depdemo-inst.test \
587         tests/depdemo-unst.test \
588         tests/mdemo-conf.test tests/mdemo-make.test tests/mdemo-exec.test \
589         tests/mdemo-inst.test tests/mdemo-unst.test tests/mdemo-dryrun.test \
590         tests/mdemo2-conf.test tests/mdemo2-make.test tests/mdemo2-exec.test \
591         tests/pdemo-conf.test tests/pdemo-make.test tests/pdemo-exec.test \
592         tests/pdemo-inst.test \
593         tests/demo-nofast.test tests/demo-make.test tests/demo-exec.test \
594         tests/demo-inst.test tests/demo-unst.test \
595         tests/depdemo-nofast.test tests/depdemo-make.test \
596         tests/depdemo-exec.test tests/depdemo-inst.test \
597         tests/depdemo-unst.test \
598         tests/demo-pic.test tests/demo-make.test tests/demo-exec.test \
599         tests/demo-nopic.test tests/demo-make.test tests/demo-exec.test \
600         tests/cdemo-shared.test tests/cdemo-make.test tests/cdemo-exec.test \
601         tests/demo-shared.test tests/demo-make.test tests/demo-exec.test \
602         tests/demo-inst.test tests/demo-hardcode.test tests/demo-relink.test \
603         tests/demo-noinst-link.test tests/demo-unst.test \
604         tests/depdemo-shared.test tests/depdemo-make.test \
605         tests/depdemo-exec.test tests/depdemo-inst.test \
606         tests/depdemo-relink.test tests/depdemo-unst.test \
607         tests/mdemo-shared.test tests/mdemo-make.test tests/mdemo-exec.test \
608         tests/mdemo-inst.test tests/mdemo-unst.test \
609         tests/cdemo-undef.test tests/cdemo-make.test tests/cdemo-exec.test
611 TESTS = $(COMMON_TESTS)
612 if HAVE_CXX
613 TESTS += $(CXX_TESTS)
614 endif
615 if HAVE_F77
616 TESTS += $(F77_TESTS)
617 endif
618 if HAVE_FC
619 TESTS += $(FC_TESTS)
620 endif
622 tests/demo-conf.test: libtool
624 EXTRA_DIST     += $(srcdir)/tests/defs.in tests/defs.m4sh \
625                   $(COMMON_TESTS) $(CXX_TESTS) $(F77_TESTS) $(FC_TESTS)
626 DIST_SUBDIRS   += $(CONF_SUBDIRS)
628 # The defs script shouldn't be recreated whenever the Makefile is
629 # regenerated since the source tree can be read-only.
630 check-recursive: tests/defs
631 tests/defs: $(srcdir)/tests/defs.in
632         rm -f tests/defs.tmp tests/defs; \
633         input="defs.m4sh"; \
634         $(edit) $(srcdir)/tests/defs.in > tests/defs.tmp; \
635         mv -f tests/defs.tmp tests/defs
637 # Use `$(srcdir)/tests' for the benefit of non-GNU makes: this is
638 # how defs.in appears in our dependencies.
639 $(srcdir)/tests/defs.in: $(auxdir)/general.m4sh tests/defs.m4sh Makefile.am
640         cd $(srcdir); \
641         rm -f tests/defs.in; \
642         $(M4SH) -B $(auxdir) tests/defs.m4sh > tests/defs.in
644 # We need to remove any files that the above tests created.
645 clean-local-legacy:
646         -cd tests; \
647         for dir in cdemo demo depdemo f77demo fcdemo mdemo mdemo2 pdemo tagdemo; \
648         do \
649             test -f $$dir/Makefile && ( cd $$dir && $(MAKE) distclean; ); \
650         done
651         rm -rf _inst
653 $(TESTS): tests/defs
654 DISTCLEANFILES += tests/defs