From 7a7e17ae3d4a8d26b6282342459ce9224832075d Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 29 Mar 1996 06:20:17 +0000 Subject: [PATCH] Preliminary libtool support --- ChangeLog | 10 +++++++++ Makefile.am | 2 +- Makefile.in | 2 +- NEWS | 1 + TODO | 34 +++++++++++------------------ automake.in | 54 ++++++++++++++++++++++++++++++++++++++++++---- lib/am/Makefile.am | 2 +- libraries-vars.am | 19 ---------------- 8 files changed, 77 insertions(+), 47 deletions(-) delete mode 100644 libraries-vars.am diff --git a/ChangeLog b/ChangeLog index 26bee5d3..419d4fcf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ Thu Mar 28 08:33:21 1996 Tom Tromey + * automake.in (require_conf_file_with_conf_line): Yet another + function of this form. + (libtool_line): New variable. + (handle_libraries): Handle libtool. + + * libraries-vars.am: Removed. + + * automake.in (seen_libtool): New variable. + (scan_configure): Look for gm_PROG_LIBTOOL or AC_PROG_LIBTOOL. + * automake.in (handle_dist_worker): Handle dist-local. * Makefile.am (maintainer-check): Do "make check" after all syntax diff --git a/Makefile.am b/Makefile.am index f8ed73e7..32a3e3cb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,7 +14,7 @@ info_TEXINFOS = automake.texi pkgdata_DATA = clean-kr.am clean.am compile-kr.am compile-vars.am \ compile.am data.am depend.am \ dist-vars.am footer.am header.am header-vars.am \ -kr-vars.am libraries-vars.am \ +kr-vars.am \ libraries.am library.am mans-vars.am \ program.am programs.am remake-hdr.am \ remake-subd.am remake.am scripts.am subdirs.am tags.am tags-subd.am \ diff --git a/Makefile.in b/Makefile.in index 7f8ec9e7..250d3984 100644 --- a/Makefile.in +++ b/Makefile.in @@ -52,7 +52,7 @@ info_TEXINFOS = automake.texi pkgdata_DATA = clean-kr.am clean.am compile-kr.am compile-vars.am \ compile.am data.am depend.am \ dist-vars.am footer.am header.am header-vars.am \ -kr-vars.am libraries-vars.am \ +kr-vars.am \ libraries.am library.am mans-vars.am \ program.am programs.am remake-hdr.am \ remake-subd.am remake.am scripts.am subdirs.am tags.am tags-subd.am \ diff --git a/NEWS b/NEWS index acd5f1a5..1e9b1194 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ New in 0.32: * AC_ARG_PROGRAM only required when an actual program exists * dist-local target now run before distribution packaged up; idea from Dieter Baron. +* Preliminary (unfinished) support for libtool New in 0.31: * Bug fixes diff --git a/TODO b/TODO index 2cb39453..c40c77a7 100644 --- a/TODO +++ b/TODO @@ -6,18 +6,18 @@ Other priorities: This will allow the callers to be a little smarter. * Rewrite clean targets. * Must rewrite error handling code. Right now it is a real mess + Should fix up require_file junk at the same time + +Things to finish libtool support: +* Handle grody compilation issue +* Handle install changes +* Handle clean changes +* New definition for LINK Currently gettext requires @INTLSUB@ and @POSUB@ in SUBDIRS. In the future this will be just intl and po. When that happens, re-enable warnings in handle_subdirs. -Consider supporting guile-style PLUGIN directories automatically? - -Consider allowing eg "foo/bar" to appear in EXTRA_DIST, and generating -code to make directory foo at dist time - -Consider putting ansi2knr in AC_CONFIG_AUX_DIR - Check to make sure various scripts are executable (IE when looking for them in a directory) @@ -72,7 +72,7 @@ It should be possible to have ansi2knr in just one place in a package. Jim Meyering says just rely on configure to make links as appropriate. Maybe introduce syntax like this: AUTOMAKE_OPTIONS = ../ansi2knr -? +? Consider putting it into AC_CONFIG_AUX_DIR Lex, yacc support: * It would be nice to automatically support using bison's better features @@ -153,6 +153,11 @@ some support for this. Here are some of the issues: * Should handle AC_CONFIG_SUBDIRS, ie must handle configure.in in subdirs * Must handle SUBDIRS in subdir Makefile.am's +These can both be handled via dist-local: +. Consider supporting guile-style PLUGIN directories automatically? +. Consider allowing eg "foo/bar" to appear in EXTRA_DIST, and generating + code to make directory foo at dist time + ================================================================ Document: @@ -197,19 +202,6 @@ Libraries: * Should support standalone library along with subdir library in same Makefile.am. Maybe: turn off "standalone" mode if library's Makefile.am is not only one specd? [ add an option for this ] -* Need a way to handle shared libraries. - It would be really interesting to be able to easily (as the end-user) - make many different versions of the library: shared, static, profiling, - debug, optimized... - How does Perl handle this? How does glibc handle this? - This needs autoconf support - -Some examples to keep in mind while doing this: -* readline -* kpathsea - -Gord Matzigkeit is doing work on this issue, mostly from the Autoconf -side of things. ================================================================ diff --git a/automake.in b/automake.in index cfadbf53..06a9607f 100755 --- a/automake.in +++ b/automake.in @@ -141,6 +141,10 @@ $seen_ranlib = 0; # TRUE if we've seen AC_ARG_PROGRAM. $seen_arg_prog = 0; +# TRUE if we've seen gm_PROG_LIBTOOL or AC_PROG_LIBTOOL. +$seen_libtool = 0; +$libtool_line = 0; + # Charsets used by maintainer and in distribution. MAINT_CHARSET is # handled in a funny way: if seen in the top-level Makefile.am, it is # used for every directory which does not specify a different value. @@ -669,13 +673,20 @@ sub handle_libraries 'lib', 'pkglib', 'noinst', 'check'); return if ! @liblist; - if (! $seen_ranlib) + if ($seen_libtool) + { + # libtool requires some files. + &require_conf_file_with_conf_line ($libtool_line, $FOREIGN, + 'config.sub', 'config.guess', + 'libtool'); + } + elsif (! $seen_ranlib) { # FIXME need am_line_error here. But we don't know which # variable exists. Must add a loop... No. Must have # am_install_var return a hash. Otherwise the user could add # install directories that we'd never find. - &am_error ("building a library but \`AC_PROG_RANLIB' not in configure.in"); + &am_error ("library requires either \`AC_PROG_RANLIB' or `gm_PROG_LIBTOOL' in configure.in"); # Only get this error once. $seen_ranlib = 1; } @@ -727,7 +738,19 @@ sub handle_libraries { &pretty_print ('LIBFILES = ', "", @liblist); } - $output_vars .= &file_contents ('libraries-vars'); + + if ($seen_libtool) + { + $output_vars .= ('AR = $(LIBTOOL) archive' . "\n" + . 'RANLIB = $(LIBTOOL) ranlib' . "\n" + . 'LCOMPILE = $(LIBTOOL) compile $(DEFS) $(INCLUDES)' + . ' $(CPPFLAGS) $(CFLAGS)' . "\n"); + } + else + { + $output_vars .= ('AR = ar' . "\n" + . 'RANLIB = @RANLIB@' . "\n"); + } } # Handle scripts. @@ -1923,6 +1946,12 @@ sub scan_configure $seen_prog_install = 2 if ! $seen_prog_install && /fp_PROG_INSTALL/; $seen_arg_prog = 1 if /AC_ARG_PROGRAM/; $seen_ranlib = 1 if /AC_PROG_RANLIB/; + + if (/AC_PROG_LIBTOOL/ || /gm_PROG_LIBTOOL/) + { + $seen_libtool = 1; + $libtool_line = $.; + } } # Set input files if not specified by user. @@ -2718,8 +2747,25 @@ sub require_config_file } } -# Assumes that the line number is in configure.in. +# Assumes that the line number is in Makefile.am. sub require_conf_file_with_line +{ + @require_file_paths = @config_aux_path; + &require_file_internal (0, @_); + local ($dir) = $require_file_paths[0]; + @config_aux_path = @require_file_paths; + if ($dir eq '.') + { + $config_aux_dir = '.'; + } + else + { + $config_aux_dir = '$(top_srcdir)/' . $dir; + } +} + +# Assumes that the line number is in Makefile.am. +sub require_conf_file_with_conf_line { @require_file_paths = @config_aux_path; &require_file_internal (1, @_); diff --git a/lib/am/Makefile.am b/lib/am/Makefile.am index f8ed73e7..32a3e3cb 100644 --- a/lib/am/Makefile.am +++ b/lib/am/Makefile.am @@ -14,7 +14,7 @@ info_TEXINFOS = automake.texi pkgdata_DATA = clean-kr.am clean.am compile-kr.am compile-vars.am \ compile.am data.am depend.am \ dist-vars.am footer.am header.am header-vars.am \ -kr-vars.am libraries-vars.am \ +kr-vars.am \ libraries.am library.am mans-vars.am \ program.am programs.am remake-hdr.am \ remake-subd.am remake.am scripts.am subdirs.am tags.am tags-subd.am \ diff --git a/libraries-vars.am b/libraries-vars.am deleted file mode 100644 index 59afbe0f..00000000 --- a/libraries-vars.am +++ /dev/null @@ -1,19 +0,0 @@ -## automake - create Makefile.in from Makefile.am -## Copyright (C) 1994, 1995, 1996 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., 59 Temple Place - Suite 330, Boston, MA -## 02111-1307, USA. -AR = ar -RANLIB = @RANLIB@ -- 2.43.5