1999-01-10 Tom Tromey <tromey@cygnus.com>
+ * automake.in (objc_extensions): New sub.
+ (handle_dependencies): Only generate dependency-tracking code for
+ ObjC when ObjC source seen.
+
+1998-12-22 Marcus G. Daniels <mgd@chama.santafe.edu>
+
+ * automake.in (handle_dependencies): Transform EXT & PFX in
+ Objective C case.
+
+1998-12-11 Marcus G. Daniels <mgd@chama.santafe.edu>
+
+ * automake.in: Register Objective C language.
+ (finish_languages): Consider Objective C to be non_c.
+ (lang_objc_rewrite, lang_objc_finish): New functions.
+ (resolve_linker): Recognize OBJCLINK before LINK.
+
+1999-01-10 Tom Tromey <tromey@cygnus.com>
+
* automake.in (handle_texinfo): Handle empty $config_aux_dir.
* automake.in (handle_texinfo): Set $conf_pat correctly when
DATA = $(pkgdata_DATA)
DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
-Makefile.in NEWS README-alpha THANKS TODO aclocal.in aclocal.m4 \
-ansi2knr.1 ansi2knr.c automake.in config.guess config.sub configure \
-configure.in elisp-comp install-sh mdate-sh missing mkinstalldirs \
-stamp-vti texinfo.tex version.texi ylwrap
+Makefile.in NEWS THANKS TODO aclocal.in aclocal.m4 ansi2knr.1 \
+ansi2knr.c automake.in config.guess config.sub configure configure.in \
+elisp-comp install-sh mdate-sh missing mkinstalldirs stamp-vti \
+texinfo.tex version.texi ylwrap
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
'c');
®ister_language ('cxx', 'CXXLINK', 0,
'c++', 'cc', 'cpp', 'cxx', 'C');
+®ister_language ('objc', 'OBJCLINK', 0,
+ 'm');
®ister_language ('header', '', 0,
'h', 'H', 'hxx', 'h++', 'hh', 'hpp', 'inc');
®ister_language ('yacc', '', 1,
$lang = $extension_map{$ext};
next if defined $done{$lang};
$done{$lang} = 1;
- $non_c = 0 if $lang !~ /(cxx|f77|ratfor)$/;
+ $non_c = 0 if $lang !~ /(objc|cxx|f77|ratfor)$/;
# Compute the function name of the finisher and then call it.
$name = 'lang_' . $lang . '_finish';
. 's/\@PFX\@//g;',
'depend2');
local ($ext);
+ foreach $ext (&objc_extensions)
+ {
+ $output_rules .=
+ &file_contents_with_transform ('s/\@EXT\@/' . $ext . '/g;'
+ . 's/\@PFX\@/OBJC/g;',
+ 'depend2');
+ }
foreach $ext (&cxx_extensions)
{
$output_rules .=
return 1;
}
+# Rewrite a single Objective C file.
+sub lang_objc_rewrite
+{
+ return 1;
+}
+
# The lang_X_finish functions are called after all source file
# processing is done. Each should handle defining rules for the
# language, etc. A finish function is only called if a source file of
}
}
+sub lang_objc_finish
+{
+ push (@suffixes, '.m');
+
+ local ($ltcompile, $ltlink) = &libtool_compiler;
+
+ &define_configure_variable ("OBJCFLAGS");
+ &define_variable ('OBJCCOMPILE', '$(OBJC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS)');
+ &define_variable ('LTOBJCCOMPILE',
+ $ltcompile . '$(OBJC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_OBJCFLAGS) $(OBJCFLAGS)')
+ if ($seen_libtool);
+
+ &define_variable ('OBJCLD', '$(OBJC)');
+ &define_variable ('OBJCLINK', $ltlink . '$(OBJCLD) $(AM_OBJCFLAGS) $(OBJCFLAGS) $(LDFLAGS) -o $@');
+
+ $output_rules .= (".m.o:\n"
+ . "\t\$(OBJCCOMPILE) -c \$<\n");
+ # FIXME: Using cygpath should be somehow conditional.
+ $output_rules .= (".m.obj:\n"
+ . "\t\$(OBJCCOMPILE) -c `cygpath -w \$<`\n")
+ if ($seen_objext);
+ $output_rules .= (".m.lo:\n"
+ . "\t\$(LTOBJCCOMPILE) -c \$<\n")
+ if ($seen_libtool);
+
+ if (! defined $configure_vars{'OBJC'})
+ {
+ &am_error ("Objective C source seen but \`OBJC' not defined in \`configure.in'");
+ }
+}
+
+# A helper which computes a sorted list of all ObjC extensions which
+# were seen.
+sub objc_extensions
+{
+ local ($key, @r);
+ foreach $key (sort keys %extension_seen)
+ {
+ push (@r, '.' . $key) if $extension_map{$key} eq 'objc';
+ }
+ return @r;
+}
+
# A helper which decides whether libtool is needed. Returns prefix
# for compiler and linker.
sub libtool_compiler
if defined $linkers{'CXXLINK'};
return 'F77LINK'
if defined $linkers{'F77LINK'};
+ return 'OBJCLINK'
+ if defined $linkers{'OBJCLINK'};
return 'LINK';
}