1 # libtoolize.at -- test libtoolize operation -*- Autotest -*-
3 # Copyright (C) 2005, 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.
26 AT_BANNER([Libtoolize operation.])
30 m4_define([_LT_CONFIGURE_AC],
31 [AT_DATA([configure.ac],
32 [[AC_INIT([libtoolize-demo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
33 AC_CONFIG_AUX_DIR([build-aux])
34 AC_CONFIG_MACRO_DIR([m4])
40 # _LT_LIBTOOLIZE_SETUP
41 # --------------------
42 m4_define([_LT_LIBTOOLIZE_SETUP],
45 test -d m4 || { rm -f m4 && mkdir m4; }
47 rm -f m4/libtool.m4 m4/ltoptions.m4 build-aux/ltmain.sh
49 AT_DATA([Makefile.am],
50 [[ACLOCAL_AMFLAGS = -I m4
53 # This file should be upgraded.
54 AT_DATA([m4/libtool.m4], [[
58 # This file has a very high serial number, and should be left unchanged
59 # until --force is passed.
60 AT_DATA([m4/ltoptions.m4], [[
61 # serial 99999 ltoptions.m4
64 test -d build-aux || { rm -f build-aux && mkdir build-aux; }
66 # This file has a very high serial number, and needs --force to be updated.
67 AT_DATA([build-aux/ltmain.sh], [[
68 package_revision=9999.9999
71 # This file has a very old serial number, but should be left unchanged
72 # unless the --install flag is invoked.
73 AT_DATA([build-aux/config.guess], [[
74 timestamp='1970-01-01'
76 ])# LT_LIBTOOLIZE_SETUP
79 ## ------------------- ##
80 ## Macro installation. ##
81 ## ------------------- ##
83 AT_SETUP([libtoolize macro installation])
88 [[libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
89 libtoolize: copying file `build-aux/ltmain.sh'
90 libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
91 libtoolize: copying file `m4/libtool.m4'
92 libtoolize: copying file `m4/ltoptions.m4'
93 libtoolize: copying file `m4/ltsugar.m4'
94 libtoolize: copying file `m4/ltversion.m4'
95 libtoolize: copying file `m4/lt~obsolete.m4'
96 libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
99 LT_AT_CHECK_LIBTOOLIZE([--copy], 0, expout)
104 ## ------------------------- ##
105 ## ACLOCAL_AMFLAGS mismatch. ##
106 ## ------------------------- ##
108 AT_SETUP([libtoolize macro directory mismatch error])
112 AT_DATA([Makefile.am],
113 [[ACLOCAL_AMFLAGS = -I me2
117 [[libtoolize: AC_CONFIG_MACRO_DIR([m4]) conflicts with ACLOCAL_AMFLAGS=-I me2.
120 LT_AT_CHECK_LIBTOOLIZE([--copy], 1, [ignore], experr)
128 AT_SETUP([libtoolize macro serial update])
134 ## -------------------------------------------------------------------- ##
135 ## First we try to update with some newer files in the destination dir. ##
136 ## -------------------------------------------------------------------- ##
139 [[libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
140 libtoolize: copying file `m4/libtool.m4'
141 libtoolize: copying file `m4/ltsugar.m4'
142 libtoolize: copying file `m4/ltversion.m4'
143 libtoolize: copying file `m4/lt~obsolete.m4'
147 [[libtoolize: `build-aux/ltmain.sh' is newer: use `--force' to overwrite
148 libtoolize: `m4/ltoptions.m4' is newer: use `--force' to overwrite
151 LT_AT_CHECK_LIBTOOLIZE([--copy], 0, expout, experr)
154 ## ---------------------------------------------------------- ##
155 ## Next, a second update attempt with everything now updated. ##
156 ## ---------------------------------------------------------- ##
161 [[libtoolize: `build-aux/ltmain.sh' is newer: use `--force' to overwrite
162 libtoolize: `m4/ltoptions.m4' is newer: use `--force' to overwrite
165 LT_AT_CHECK_LIBTOOLIZE([--copy], 0, expout, experr)
168 ## ----------------------------------------------------------- ##
169 ## Now, a forced update to downgrade files with newer serials. ##
170 ## ----------------------------------------------------------- ##
173 [[libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
174 libtoolize: copying file `build-aux/ltmain.sh'
175 libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
176 libtoolize: copying file `m4/libtool.m4'
177 libtoolize: copying file `m4/ltoptions.m4'
178 libtoolize: copying file `m4/ltsugar.m4'
179 libtoolize: copying file `m4/ltversion.m4'
180 libtoolize: copying file `m4/lt~obsolete.m4'
183 LT_AT_CHECK_LIBTOOLIZE([--copy --force], 0, expout)
186 ## ---------------------------------------------------------------- ##
187 ## A final update attempt with everything previously force updated. ##
188 ## ---------------------------------------------------------------- ##
192 LT_AT_CHECK_LIBTOOLIZE([--copy], 0, expout)
197 ## --------------- ##
198 ## --install flag. ##
199 ## --------------- ##
201 AT_SETUP([libtoolize config files serial update])
207 ## -------------------------------------------------------------------- ##
208 ## First we try to update with some newer files in the destination dir. ##
209 ## -------------------------------------------------------------------- ##
212 [[libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
213 libtoolize: copying file `build-aux/config.guess'
214 libtoolize: copying file `build-aux/config.sub'
215 libtoolize: copying file `build-aux/install-sh'
216 libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
217 libtoolize: copying file `m4/libtool.m4'
218 libtoolize: copying file `m4/ltsugar.m4'
219 libtoolize: copying file `m4/ltversion.m4'
220 libtoolize: copying file `m4/lt~obsolete.m4'
224 [[libtoolize: `build-aux/ltmain.sh' is newer: use `--force' to overwrite
225 libtoolize: `m4/ltoptions.m4' is newer: use `--force' to overwrite
228 LT_AT_CHECK_LIBTOOLIZE([--copy --install], 0, expout, experr)
231 ## ---------------------------------------------------------- ##
232 ## Next, a second update attempt with everything now updated. ##
233 ## ---------------------------------------------------------- ##
238 [[libtoolize: `build-aux/ltmain.sh' is newer: use `--force' to overwrite
239 libtoolize: `m4/ltoptions.m4' is newer: use `--force' to overwrite
242 LT_AT_CHECK_LIBTOOLIZE([--copy --install], 0, expout, experr)
245 ## ----------------------------------------------------------- ##
246 ## Now, a forced update to downgrade files with newer serials. ##
247 ## ----------------------------------------------------------- ##
250 [[libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
251 libtoolize: copying file `build-aux/config.guess'
252 libtoolize: copying file `build-aux/config.sub'
253 libtoolize: copying file `build-aux/install-sh'
254 libtoolize: copying file `build-aux/ltmain.sh'
255 libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
256 libtoolize: copying file `m4/libtool.m4'
257 libtoolize: copying file `m4/ltoptions.m4'
258 libtoolize: copying file `m4/ltsugar.m4'
259 libtoolize: copying file `m4/ltversion.m4'
260 libtoolize: copying file `m4/lt~obsolete.m4'
263 LT_AT_CHECK_LIBTOOLIZE([--copy --force --install], 0, expout)
266 ## ---------------------------------------------------------------- ##
267 ## A final update attempt with everything previously force updated. ##
268 ## ---------------------------------------------------------------- ##
272 LT_AT_CHECK_LIBTOOLIZE([--copy --install], 0, expout)
277 ## ----------------------------------------------------------------- ##
278 ## Ensure libtoolize works when LT_CONFIG_LTDL_DIR is not specified. ##
279 ## ----------------------------------------------------------------- ##
281 AT_SETUP([diagnose missing LT_CONFIG_LTDL_DIR])
284 [[libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
285 libtoolize: copying file `build-aux/config.guess'
286 libtoolize: copying file `build-aux/config.sub'
287 libtoolize: copying file `build-aux/install-sh'
288 libtoolize: copying file `build-aux/ltmain.sh'
289 libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
290 libtoolize: copying file `m4/argz.m4'
291 libtoolize: copying file `m4/libtool.m4'
292 libtoolize: copying file `m4/ltdl.m4'
293 libtoolize: copying file `m4/ltoptions.m4'
294 libtoolize: copying file `m4/ltsugar.m4'
295 libtoolize: copying file `m4/ltversion.m4'
296 libtoolize: copying file `m4/lt~obsolete.m4'
297 libtoolize: putting libltdl files in `ltdl'.
298 libtoolize: copying file `ltdl/COPYING.LIB'
299 libtoolize: copying file `ltdl/README'
300 libtoolize: copying file `ltdl/argz_.h'
301 libtoolize: copying file `ltdl/argz.c'
302 libtoolize: copying file `ltdl/loaders/dld_link.c'
303 libtoolize: copying file `ltdl/loaders/dlopen.c'
304 libtoolize: copying file `ltdl/loaders/dyld.c'
305 libtoolize: copying file `ltdl/loaders/load_add_on.c'
306 libtoolize: copying file `ltdl/loaders/loadlibrary.c'
307 libtoolize: copying file `ltdl/loaders/shl_load.c'
308 libtoolize: copying file `ltdl/lt__dirent.c'
309 libtoolize: copying file `ltdl/lt__strl.c'
310 libtoolize: copying file `ltdl/libltdl/lt__alloc.h'
311 libtoolize: copying file `ltdl/libltdl/lt__dirent.h'
312 libtoolize: copying file `ltdl/libltdl/lt__glibc.h'
313 libtoolize: copying file `ltdl/libltdl/lt__private.h'
314 libtoolize: copying file `ltdl/libltdl/lt__strl.h'
315 libtoolize: copying file `ltdl/libltdl/lt_dlloader.h'
316 libtoolize: copying file `ltdl/libltdl/lt_error.h'
317 libtoolize: copying file `ltdl/libltdl/lt_system.h'
318 libtoolize: copying file `ltdl/libltdl/slist.h'
319 libtoolize: copying file `ltdl/loaders/preopen.c'
320 libtoolize: copying file `ltdl/lt__alloc.c'
321 libtoolize: copying file `ltdl/lt_dlloader.c'
322 libtoolize: copying file `ltdl/lt_error.c'
323 libtoolize: copying file `ltdl/ltdl.c'
324 libtoolize: copying file `ltdl/ltdl.h'
325 libtoolize: copying file `ltdl/slist.c'
326 libtoolize: creating file `ltdl/Makefile.inc'
327 libtoolize: Remember to add `LT_CONFIG_LTDL_DIR([ltdl])' to `configure.ac'.
328 libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
331 AT_DATA([configure.ac],
332 [[AC_INIT([libtoolize-demo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
333 AC_CONFIG_AUX_DIR([build-aux])
334 AC_CONFIG_MACRO_DIR([m4])
336 LTDL_INIT([nonrecursive])
340 LT_AT_CHECK_LIBTOOLIZE([--copy --install --ltdl=ltdl], 0, expout)
345 ## ---------------------------- ##
346 ## Make sure ltdl.m4 is copied. ##
347 ## ---------------------------- ##
351 # Macro to generate data files common to several tests.
352 m4_pushdef([_LT_AT_LTDL_SETUP],
354 [[libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `ltdl/config'.
355 libtoolize: linking file `ltdl/config/compile'
356 libtoolize: linking file `ltdl/config/config.guess'
357 libtoolize: linking file `ltdl/config/config.sub'
358 libtoolize: linking file `ltdl/config/depcomp'
359 libtoolize: linking file `ltdl/config/install-sh'
360 libtoolize: linking file `ltdl/config/missing'
361 libtoolize: linking file `ltdl/config/ltmain.sh'
362 libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `ltdl/m4'.
363 libtoolize: linking file `ltdl/m4/argz.m4'
364 libtoolize: linking file `ltdl/m4/libtool.m4'
365 libtoolize: linking file `ltdl/m4/ltdl.m4'
366 libtoolize: linking file `ltdl/m4/ltoptions.m4'
367 libtoolize: linking file `ltdl/m4/ltsugar.m4'
368 libtoolize: linking file `ltdl/m4/ltversion.m4'
369 libtoolize: linking file `ltdl/m4/lt~obsolete.m4'
370 libtoolize: putting libltdl files in LT_CONFIG_LTDL_DIR, `ltdl'.
371 libtoolize: linking file `ltdl/COPYING.LIB'
372 libtoolize: linking file `ltdl/README'
373 libtoolize: linking file `ltdl/Makefile.am'
374 libtoolize: linking file `ltdl/configure.ac'
375 libtoolize: copying file `ltdl/aclocal.m4'
376 libtoolize: linking file `ltdl/Makefile.in'
377 libtoolize: linking file `ltdl/config-h.in'
378 libtoolize: linking file `ltdl/configure'
379 libtoolize: linking file `ltdl/argz_.h'
380 libtoolize: linking file `ltdl/argz.c'
381 libtoolize: linking file `ltdl/loaders/dld_link.c'
382 libtoolize: linking file `ltdl/loaders/dlopen.c'
383 libtoolize: linking file `ltdl/loaders/dyld.c'
384 libtoolize: linking file `ltdl/loaders/load_add_on.c'
385 libtoolize: linking file `ltdl/loaders/loadlibrary.c'
386 libtoolize: linking file `ltdl/loaders/shl_load.c'
387 libtoolize: linking file `ltdl/lt__dirent.c'
388 libtoolize: linking file `ltdl/lt__strl.c'
389 libtoolize: linking file `ltdl/libltdl/lt__alloc.h'
390 libtoolize: linking file `ltdl/libltdl/lt__dirent.h'
391 libtoolize: linking file `ltdl/libltdl/lt__glibc.h'
392 libtoolize: linking file `ltdl/libltdl/lt__private.h'
393 libtoolize: linking file `ltdl/libltdl/lt__strl.h'
394 libtoolize: linking file `ltdl/libltdl/lt_dlloader.h'
395 libtoolize: linking file `ltdl/libltdl/lt_error.h'
396 libtoolize: linking file `ltdl/libltdl/lt_system.h'
397 libtoolize: linking file `ltdl/libltdl/slist.h'
398 libtoolize: linking file `ltdl/loaders/preopen.c'
399 libtoolize: linking file `ltdl/lt__alloc.c'
400 libtoolize: linking file `ltdl/lt_dlloader.c'
401 libtoolize: linking file `ltdl/lt_error.c'
402 libtoolize: linking file `ltdl/ltdl.c'
403 libtoolize: linking file `ltdl/ltdl.h'
404 libtoolize: linking file `ltdl/slist.c'
407 AT_DATA([configure.ac],
408 [[AC_INIT([libtoolize-demo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
409 LT_CONFIG_LTDL_DIR([ltdl])
410 AC_CONFIG_AUX_DIR([ltdl/config])
411 AC_CONFIG_MACRO_DIR([ltdl/m4])
417 AT_DATA([Makefile.am],
418 [[ACLOCAL_AMFLAGS = -I ltdl/m4
420 ])# _LT_AT_LTDL_SETUP
422 ## ------------------------------------------------ ##
423 ## First we make sure libtoolize --ltdl is working. ##
424 ## ------------------------------------------------ ##
426 AT_SETUP([copy ltdl.m4 with shared macro directory])
430 LT_AT_CHECK_LIBTOOLIZE([--ltdl], 0, expout)
434 ## ----------------------------------------------------- ##
435 ## And also that libtoolize is taking note of LTDL_INIT. ##
436 ## ----------------------------------------------------- ##
438 AT_SETUP([correctly parse LTDL_INIT from configure.ac])
442 LT_AT_CHECK_LIBTOOLIZE([], 0, expout)
446 ## ----------------------------------------------------------- ##
447 ## And finally, that libtoolize diagnoses a missing LTDL_INIT. ##
448 ## ----------------------------------------------------------- ##
450 AT_SETUP([diagnose missing LTDL_INIT invocation])
453 [[libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `ltdl/config'.
454 libtoolize: copying file `ltdl/config/compile'
455 libtoolize: copying file `ltdl/config/config.guess'
456 libtoolize: copying file `ltdl/config/config.sub'
457 libtoolize: copying file `ltdl/config/depcomp'
458 libtoolize: copying file `ltdl/config/install-sh'
459 libtoolize: copying file `ltdl/config/missing'
460 libtoolize: copying file `ltdl/config/ltmain.sh'
461 libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `ltdl/m4'.
462 libtoolize: copying file `ltdl/m4/argz.m4'
463 libtoolize: copying file `ltdl/m4/libtool.m4'
464 libtoolize: copying file `ltdl/m4/ltdl.m4'
465 libtoolize: copying file `ltdl/m4/ltoptions.m4'
466 libtoolize: copying file `ltdl/m4/ltsugar.m4'
467 libtoolize: copying file `ltdl/m4/ltversion.m4'
468 libtoolize: copying file `ltdl/m4/lt~obsolete.m4'
469 libtoolize: putting libltdl files in LT_CONFIG_LTDL_DIR, `ltdl'.
470 libtoolize: copying file `ltdl/COPYING.LIB'
471 libtoolize: copying file `ltdl/README'
472 libtoolize: copying file `ltdl/Makefile.am'
473 libtoolize: copying file `ltdl/configure.ac'
474 libtoolize: copying file `ltdl/aclocal.m4'
475 libtoolize: copying file `ltdl/Makefile.in'
476 libtoolize: copying file `ltdl/config-h.in'
477 libtoolize: copying file `ltdl/configure'
478 libtoolize: copying file `ltdl/argz_.h'
479 libtoolize: copying file `ltdl/argz.c'
480 libtoolize: copying file `ltdl/loaders/dld_link.c'
481 libtoolize: copying file `ltdl/loaders/dlopen.c'
482 libtoolize: copying file `ltdl/loaders/dyld.c'
483 libtoolize: copying file `ltdl/loaders/load_add_on.c'
484 libtoolize: copying file `ltdl/loaders/loadlibrary.c'
485 libtoolize: copying file `ltdl/loaders/shl_load.c'
486 libtoolize: copying file `ltdl/lt__dirent.c'
487 libtoolize: copying file `ltdl/lt__strl.c'
488 libtoolize: copying file `ltdl/libltdl/lt__alloc.h'
489 libtoolize: copying file `ltdl/libltdl/lt__dirent.h'
490 libtoolize: copying file `ltdl/libltdl/lt__glibc.h'
491 libtoolize: copying file `ltdl/libltdl/lt__private.h'
492 libtoolize: copying file `ltdl/libltdl/lt__strl.h'
493 libtoolize: copying file `ltdl/libltdl/lt_dlloader.h'
494 libtoolize: copying file `ltdl/libltdl/lt_error.h'
495 libtoolize: copying file `ltdl/libltdl/lt_system.h'
496 libtoolize: copying file `ltdl/libltdl/slist.h'
497 libtoolize: copying file `ltdl/loaders/preopen.c'
498 libtoolize: copying file `ltdl/lt__alloc.c'
499 libtoolize: copying file `ltdl/lt_dlloader.c'
500 libtoolize: copying file `ltdl/lt_error.c'
501 libtoolize: copying file `ltdl/ltdl.c'
502 libtoolize: copying file `ltdl/ltdl.h'
503 libtoolize: copying file `ltdl/slist.c'
504 libtoolize: Remember to add `LTDL_INIT' to configure.ac.
505 libtoolize: Consider adding `-I ltdl/m4' to ACLOCAL_AMFLAGS in Makefile.am.
508 AT_DATA([configure.ac],
509 [[AC_INIT([libtoolize-demo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
510 LT_CONFIG_LTDL_DIR([ltdl])
511 AC_CONFIG_AUX_DIR([ltdl/config])
512 AC_CONFIG_MACRO_DIR([ltdl/m4])
517 LT_AT_CHECK_LIBTOOLIZE([--ltdl --copy], 0, expout)
521 m4_popdef([_LT_AT_LTDL_SETUP])
523 ## ------------------------------------------------------ ##
524 ## Creating an aclocal.m4 without in-tree libtool macros. ##
525 ## ------------------------------------------------------ ##
527 AT_SETUP([upgrading verbatim style aclocal.m4])
529 AT_DATA([configure.ac],
530 [[AC_INIT([libtoolize-demo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
531 AC_CONFIG_AUX_DIR([build-aux])
537 [[libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
538 libtoolize: copying file `build-aux/ltmain.sh'
539 libtoolize: You should add the contents of the following files to `aclocal.m4':
540 libtoolize: `/usr/local/share/aclocal/libtool.m4'
541 libtoolize: `/usr/local/share/aclocal/ltoptions.m4'
542 libtoolize: `/usr/local/share/aclocal/ltversion.m4'
543 libtoolize: `/usr/local/share/aclocal/ltsugar.m4'
544 libtoolize: `/usr/local/share/aclocal/lt~obsolete.m4'
545 libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
546 libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
547 libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
550 LT_AT_CHECK_LIBTOOLIZE([--copy], 0, expout)
553 ## --------------------------------------- ##
554 ## Upgrading a hand maintained aclocal.m4. ##
555 ## --------------------------------------- ##
557 AT_DATA([configure.ac],
558 [[AC_INIT([libtoolize-demo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
559 AC_CONFIG_AUX_DIR([build-aux])
560 AC_CONFIG_MACRO_DIR([m4])
565 AT_DATA([Makefile.am],
566 [[ACLOCAL_AMFLAGS = -I m4
569 AT_DATA([aclocal.m4],
570 [[# This should need upgrading:
575 # This is newer than the upgrade version:
576 # serial 99999 ltoptions.m4
578 # This is older than the upgrade version:
579 # serial 1 ltversion.m4
583 [[libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
584 libtoolize: copying file `m4/libtool.m4'
585 libtoolize: copying file `m4/ltoptions.m4'
586 libtoolize: copying file `m4/ltsugar.m4'
587 libtoolize: You should add the contents of `m4/ltsugar.m4' to `aclocal.m4'.
588 libtoolize: copying file `m4/ltversion.m4'
589 libtoolize: You should add the contents of `m4/ltversion.m4' to `aclocal.m4'.
590 libtoolize: copying file `m4/lt~obsolete.m4'
591 libtoolize: You should add the contents of `m4/lt~obsolete.m4' to `aclocal.m4'.
594 LT_AT_CHECK_LIBTOOLIZE([--copy], 0, expout)
597 ## ------------------------------------------- ##
598 ## Upgrading an aclocal maintained aclocal.m4. ##
599 ## ------------------------------------------- ##
601 LT_AT_ACLOCAL([-I m4])
603 rm -f m4/libtool.m4 m4/ltoptions.m4
605 # This file should be upgraded.
606 AT_DATA([m4/libtool.m4], [[
611 # This file has a very high serial number, and should be left unchanged.
612 AT_DATA([m4/ltoptions.m4], [[
613 # serial 99999 ltoptions.m4
617 [[libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
618 libtoolize: copying file `m4/libtool.m4'
622 [[libtoolize: `m4/ltoptions.m4' is newer: use `--force' to overwrite
625 LT_AT_CHECK_LIBTOOLIZE([--copy], 0, expout, experr)
627 ## ----------------------------------------------------------- ##
628 ## Now, a forced update to downgrade files with newer serials. ##
629 ## ----------------------------------------------------------- ##
632 [[libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
633 libtoolize: copying file `build-aux/ltmain.sh'
634 libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
635 libtoolize: copying file `m4/libtool.m4'
636 libtoolize: copying file `m4/ltoptions.m4'
637 libtoolize: copying file `m4/ltsugar.m4'
638 libtoolize: copying file `m4/ltversion.m4'
639 libtoolize: copying file `m4/lt~obsolete.m4'
642 LT_AT_CHECK_LIBTOOLIZE([--copy --force], 0, expout)
647 ## ------------------------------------------------------------------ ##
648 ## Ensure libtoolize works when AC_CONFIG_MACRO_DIR is not specified. ##
649 ## ------------------------------------------------------------------ ##
651 AT_SETUP([verbatim aclocal.m4 w/o AC_CONFIG_MACRO_DIR])
653 AT_DATA([configure.ac],
654 [[AC_INIT([libtoolize-demo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
659 AT_DATA([aclocal.m4],
660 [[# This should need upgrading:
665 # This is newer than the upgrade version:
666 # serial 99999 ltoptions.m4
668 # This is older than the upgrade version:
669 # serial 1 ltversion.m4
673 [[libtoolize: putting auxiliary files in `.'.
674 libtoolize: copying file `./ltmain.sh'
675 libtoolize: You should add the contents of the following files to `aclocal.m4':
676 libtoolize: `/usr/local/share/aclocal/libtool.m4'
677 libtoolize: `/usr/local/share/aclocal/ltversion.m4'
678 libtoolize: `/usr/local/share/aclocal/ltsugar.m4'
679 libtoolize: `/usr/local/share/aclocal/lt~obsolete.m4'
680 libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
681 libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
682 libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
685 LT_AT_CHECK_LIBTOOLIZE([--copy], 0, expout)
688 ## ----------------------------------------------------------------------- ##
689 ## Upgrading an aclocal maintained aclocal.m4 without AC_CONFIG_MACRO_DIR. ##
690 ## ----------------------------------------------------------------------- ##
692 LT_AT_ACLOCAL([-I $abs_top_srcdir/libltdl/m4])
694 ## The following code is adapted (and simplified) from libtoolize.m4sh
701 # func_grep expression filename
702 # Check whether EXPRESSION matches any line of FILENAME, without output.
705 $GREP "$1" "$2" >/dev/null 2>&1
708 # func_serial filename [macro_regex]
709 # Output the value of the serial number comment in FILENAME, where the
710 # comment line must also match MACRO_REGEX, if given.
716 /^# serial [1-9][0-9.]*[ ]*'"$my_macro_regex"'[ ]*$/ {
717 s,^# serial \([1-9][0-9.]*\).*$,\1,
722 # Search FILENAME and all the files it m4_includes for a serial number
723 # in the file that AC_DEFUNs MACRO_REGEX.
725 if test -z "$my_macro_regex" ||
726 test "$my_filename" = aclocal.m4 ||
727 test "$my_macro_regex" = `echo "$my_filename" | $SED "$basename"` ||
728 func_grep '^AC_DEFUN(\@<:@'"$my_macro_regex" "$my_filename"
730 my_serial=`$SED -e "$my_sed_serial" "$my_filename"`
733 # If the file has no serial number, something is badly wrong!
734 test -n "$my_serial" || exit 1
739 # Make the serial number in aclocal.m4 higher than installed ltoptions.m4,
740 # and the others match the macro files that libtoolize will compare against.
741 libtool_serial=`func_serial "$tst_aclocaldir/libtool.m4" LT_INIT`
742 ltversion_serial=`func_serial "$tst_aclocaldir/ltversion.m4" ltversion.m4`
743 ltsugar_serial=`func_serial "$tst_aclocaldir/ltsugar.m4" ltsugar.m4`
744 lt_obsolete_serial=`func_serial "$tst_aclocaldir/lt~obsolete.m4" lt~obsolete.m4`
745 $SED -e 's,^#.*serial.*ltoptions.m4$,# serial 99999 ltoptions.m4,' \
746 -e "s,^#.*serial.*libtool.m4\$,# serial $libtool_serial libtool.m4," \
747 -e "s,^#.*serial.*ltversion.m4\$,# serial $ltversion_serial ltversion.m4," \
748 -e "s,^#.*serial.*ltsugar.m4\$,# serial $ltsugar_serial ltsugar.m4," \
749 -e "s,^#.*serial.*lt~obsolete.m4\$,# serial $lt_obsolete_serial lt~obsolete.m4," \
750 < aclocal.m4 > aclocal.m4t
751 mv -f aclocal.m4t aclocal.m4
754 [[libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
755 libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
756 libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
759 LT_AT_CHECK_LIBTOOLIZE([--copy], 0, expout)
762 ## --------------------- ##
763 ## Now, a forced update. ##
764 ## --------------------- ##
767 [[libtoolize: putting auxiliary files in `.'.
768 libtoolize: copying file `./ltmain.sh'
769 libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
770 libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
771 libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
774 LT_AT_CHECK_LIBTOOLIZE([--copy --force], 0, expout)
779 ## ------------------------------------------------------------- ##
780 ## Check nonrecursive ltdl puts m4 files in AC_CONFIG_MACRO_DIR. ##
781 ## ------------------------------------------------------------- ##
783 AT_SETUP([nonrecursive ltdl with AC_CONFIG_MACRO_DIR])
786 [[libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
787 libtoolize: copying file `build-aux/config.guess'
788 libtoolize: copying file `build-aux/config.sub'
789 libtoolize: copying file `build-aux/install-sh'
790 libtoolize: copying file `build-aux/ltmain.sh'
791 libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
792 libtoolize: copying file `m4/argz.m4'
793 libtoolize: copying file `m4/libtool.m4'
794 libtoolize: copying file `m4/ltdl.m4'
795 libtoolize: copying file `m4/ltoptions.m4'
796 libtoolize: copying file `m4/ltsugar.m4'
797 libtoolize: copying file `m4/ltversion.m4'
798 libtoolize: copying file `m4/lt~obsolete.m4'
799 libtoolize: putting libltdl files in LT_CONFIG_LTDL_DIR, `ltdl'.
800 libtoolize: copying file `ltdl/COPYING.LIB'
801 libtoolize: copying file `ltdl/README'
802 libtoolize: copying file `ltdl/argz_.h'
803 libtoolize: copying file `ltdl/argz.c'
804 libtoolize: copying file `ltdl/loaders/dld_link.c'
805 libtoolize: copying file `ltdl/loaders/dlopen.c'
806 libtoolize: copying file `ltdl/loaders/dyld.c'
807 libtoolize: copying file `ltdl/loaders/load_add_on.c'
808 libtoolize: copying file `ltdl/loaders/loadlibrary.c'
809 libtoolize: copying file `ltdl/loaders/shl_load.c'
810 libtoolize: copying file `ltdl/lt__dirent.c'
811 libtoolize: copying file `ltdl/lt__strl.c'
812 libtoolize: copying file `ltdl/libltdl/lt__alloc.h'
813 libtoolize: copying file `ltdl/libltdl/lt__dirent.h'
814 libtoolize: copying file `ltdl/libltdl/lt__glibc.h'
815 libtoolize: copying file `ltdl/libltdl/lt__private.h'
816 libtoolize: copying file `ltdl/libltdl/lt__strl.h'
817 libtoolize: copying file `ltdl/libltdl/lt_dlloader.h'
818 libtoolize: copying file `ltdl/libltdl/lt_error.h'
819 libtoolize: copying file `ltdl/libltdl/lt_system.h'
820 libtoolize: copying file `ltdl/libltdl/slist.h'
821 libtoolize: copying file `ltdl/loaders/preopen.c'
822 libtoolize: copying file `ltdl/lt__alloc.c'
823 libtoolize: copying file `ltdl/lt_dlloader.c'
824 libtoolize: copying file `ltdl/lt_error.c'
825 libtoolize: copying file `ltdl/ltdl.c'
826 libtoolize: copying file `ltdl/ltdl.h'
827 libtoolize: copying file `ltdl/slist.c'
828 libtoolize: creating file `ltdl/Makefile.inc'
831 AT_DATA([configure.ac],
832 [[AC_INIT([libtoolize-demo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
833 LT_CONFIG_LTDL_DIR([ltdl])
834 AC_CONFIG_AUX_DIR([build-aux])
835 AC_CONFIG_MACRO_DIR([m4])
837 LTDL_INIT([nonrecursive])
841 AT_DATA([Makefile.am],
842 [[ACLOCAL_AMFLAGS = -I m4
845 LT_AT_CHECK_LIBTOOLIZE([--copy --install --ltdl=ltdl], 0, expout)
850 ## -------------------------------------------------------- ##
851 ## Check subproject ltdl with non-shared AC_CONFIG_.*_DIRs. ##
852 ## -------------------------------------------------------- ##
854 AT_SETUP([subproject ltdl with non-shared directories])
857 [[libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `build-aux'.
858 libtoolize: copying file `build-aux/config.guess'
859 libtoolize: copying file `build-aux/config.sub'
860 libtoolize: copying file `build-aux/install-sh'
861 libtoolize: copying file `build-aux/ltmain.sh'
862 libtoolize: putting auxiliary files in `build-aux'.
863 libtoolize: copying file `ltdl/config/compile'
864 libtoolize: copying file `ltdl/config/config.guess'
865 libtoolize: copying file `ltdl/config/config.sub'
866 libtoolize: copying file `ltdl/config/depcomp'
867 libtoolize: copying file `ltdl/config/install-sh'
868 libtoolize: copying file `ltdl/config/missing'
869 libtoolize: copying file `ltdl/config/ltmain.sh'
870 libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `acm4'.
871 libtoolize: copying file `acm4/argz.m4'
872 libtoolize: copying file `acm4/libtool.m4'
873 libtoolize: copying file `acm4/ltdl.m4'
874 libtoolize: copying file `acm4/ltoptions.m4'
875 libtoolize: copying file `acm4/ltsugar.m4'
876 libtoolize: copying file `acm4/ltversion.m4'
877 libtoolize: copying file `acm4/lt~obsolete.m4'
878 libtoolize: putting macros in `ltdl/m4'.
879 libtoolize: copying file `ltdl/m4/argz.m4'
880 libtoolize: copying file `ltdl/m4/libtool.m4'
881 libtoolize: copying file `ltdl/m4/ltdl.m4'
882 libtoolize: copying file `ltdl/m4/ltoptions.m4'
883 libtoolize: copying file `ltdl/m4/ltsugar.m4'
884 libtoolize: copying file `ltdl/m4/ltversion.m4'
885 libtoolize: copying file `ltdl/m4/lt~obsolete.m4'
886 libtoolize: putting libltdl files in LT_CONFIG_LTDL_DIR, `ltdl'.
887 libtoolize: copying file `ltdl/COPYING.LIB'
888 libtoolize: copying file `ltdl/README'
889 libtoolize: copying file `ltdl/Makefile.am'
890 libtoolize: copying file `ltdl/configure.ac'
891 libtoolize: copying file `ltdl/aclocal.m4'
892 libtoolize: copying file `ltdl/Makefile.in'
893 libtoolize: copying file `ltdl/config-h.in'
894 libtoolize: copying file `ltdl/configure'
895 libtoolize: copying file `ltdl/argz_.h'
896 libtoolize: copying file `ltdl/argz.c'
897 libtoolize: copying file `ltdl/loaders/dld_link.c'
898 libtoolize: copying file `ltdl/loaders/dlopen.c'
899 libtoolize: copying file `ltdl/loaders/dyld.c'
900 libtoolize: copying file `ltdl/loaders/load_add_on.c'
901 libtoolize: copying file `ltdl/loaders/loadlibrary.c'
902 libtoolize: copying file `ltdl/loaders/shl_load.c'
903 libtoolize: copying file `ltdl/lt__dirent.c'
904 libtoolize: copying file `ltdl/lt__strl.c'
905 libtoolize: copying file `ltdl/libltdl/lt__alloc.h'
906 libtoolize: copying file `ltdl/libltdl/lt__dirent.h'
907 libtoolize: copying file `ltdl/libltdl/lt__glibc.h'
908 libtoolize: copying file `ltdl/libltdl/lt__private.h'
909 libtoolize: copying file `ltdl/libltdl/lt__strl.h'
910 libtoolize: copying file `ltdl/libltdl/lt_dlloader.h'
911 libtoolize: copying file `ltdl/libltdl/lt_error.h'
912 libtoolize: copying file `ltdl/libltdl/lt_system.h'
913 libtoolize: copying file `ltdl/libltdl/slist.h'
914 libtoolize: copying file `ltdl/loaders/preopen.c'
915 libtoolize: copying file `ltdl/lt__alloc.c'
916 libtoolize: copying file `ltdl/lt_dlloader.c'
917 libtoolize: copying file `ltdl/lt_error.c'
918 libtoolize: copying file `ltdl/ltdl.c'
919 libtoolize: copying file `ltdl/ltdl.h'
920 libtoolize: copying file `ltdl/slist.c'
921 libtoolize: Consider using `AC_CONFIG_AUX_DIR([ltdl/config])' in configure.ac.
922 libtoolize: Consider using `AC_CONFIG_MACRO_DIR([ltdl/m4])' in configure.ac.
923 libtoolize: Consider adding `-I ltdl/m4' to ACLOCAL_AMFLAGS in Makefile.am.
926 AT_DATA([configure.ac],
927 [[AC_INIT([libtoolize-demo], ]AT_PACKAGE_VERSION[, ]AT_PACKAGE_BUGREPORT[)
928 LT_CONFIG_LTDL_DIR([ltdl])
929 AC_CONFIG_AUX_DIR([build-aux])
930 AC_CONFIG_MACRO_DIR([acm4])
932 LTDL_INIT([subproject])
936 LT_AT_CHECK_LIBTOOLIZE([--copy --install], 0, expout)
941 ## --------------------------- ##
942 ## Garbled LIBTOOLIZE_OPTIONS. ##
943 ## --------------------------- ##
945 AT_SETUP([LIBTOOLIZE_OPTIONS])
949 LIBTOOLIZE_OPTIONS="narf"
950 export LIBTOOLIZE_OPTIONS
953 [[libtoolize: garbled LIBTOOLIZE_OPTIONS near `narf'
954 libtoolize: Try `libtoolize --help' for more information.
957 LT_AT_CHECK_LIBTOOLIZE([--copy], 1, [ignore], experr)
960 ## --------------------------- ##
961 ## Unknown LIBTOOLIZE_OPTIONS. ##
962 ## --------------------------- ##
964 LIBTOOLIZE_OPTIONS=--no-such-option
965 export LIBTOOLIZE_OPTIONS
968 [[libtoolize: warning: unrecognized environment option `--no-such-option'
971 LT_AT_CHECK_LIBTOOLIZE([--copy], 0, [ignore], experr)
974 ## ----------------------------- ##
975 ## --no-warn environment option. ##
976 ## ----------------------------- ##
978 LIBTOOLIZE_OPTIONS=--no-warn,--no-such-option
979 export LIBTOOLIZE_OPTIONS
983 LT_AT_CHECK_LIBTOOLIZE([--copy], 0, [ignore], experr)
988 ## ------------------------------------------------------ ##
989 ## Remove file droppings from old libtoolize invocations. ##
990 ## ------------------------------------------------------ ##
992 AT_SETUP([cleanup old installation])
996 AT_DATA([Makefile.am],
997 [[ACLOCAL_AMFLAGS = -I m4
1000 AT_DATA([acinclude.m4],
1001 [[AC_DEFUN([LT_INIT],
1002 [: keep me, I might be hand maintained!]) # LT_INIT
1005 AT_DATA([libltdl/acinclude.m4],
1006 [[AC_DEFUN([LT_INIT],
1007 [: delete me, I was left here by on old libltdl build]) # LT_INIT
1010 LT_AT_CHECK_LIBTOOLIZE([--copy --force --ltdl], 0, [ignore])
1012 # check files are left as expected
1013 AT_CHECK([grep 'keep me' acinclude.m4], 0, [ignore])
1014 AT_CHECK([test -f libltdl/acinclude.m4], 1, [ignore], [ignore])