diff options
author | Steve Huston <shuston@riverace.com> | 2004-07-22 21:40:14 +0000 |
---|---|---|
committer | Steve Huston <shuston@riverace.com> | 2004-07-22 21:40:14 +0000 |
commit | 5a43c7aa5c9382d5afbda02dd02c3c919d488771 (patch) | |
tree | 7d56a53f1fad051175727e4c37a5946d037412df | |
parent | e3629970ed5bee9483129a53985d3c16ec4f7521 (diff) | |
download | MPC-5a43c7aa5c9382d5afbda02dd02c3c919d488771.tar.gz |
ChangeLogTag:Thu Jul 22 17:39:41 2004 Steve Huston <shuston@riverace.com>
-rw-r--r-- | ChangeLog | 20 | ||||
-rw-r--r-- | modules/AutomakeWorkspaceCreator.pm | 60 | ||||
-rw-r--r-- | templates/automake.mpd | 12 |
3 files changed, 72 insertions, 20 deletions
@@ -1,3 +1,23 @@ +Thu Jul 22 17:39:41 2004 Steve Huston <shuston@riverace.com> + + * modules/AutomakeWorkspaceCreator.pm: When writing + configure.ac.Makefiles, insert entries for project-less directories + between project-containing directories. Allows the bootstrap + procedure to find and make the needed Makefiles to traverse the + entire build tree. + + * templates/automake.mpd: Changed _LIBADD to _LDADD for programs. + +Thu Jul 22 12:52:39 2004 Steve Huston <shuston@riverace.com> + + * modules/AutomakeWorkspaceCreator.pm: If there's no local project + info for the current Makefile.am, don't put the initial bin_PROGRAMS, + lib_LTLIBRARIES, etc. If there are local projects, add "." to the + SUBDIRS. + + * templates/automake.mpd: Add _LIBADD settings to pick up needed + libraries. + Wed Jul 21 19:34:46 2004 J.T. Conklin <jtc@acorntoolworks.com> * modules/AutomakeProjectCreator.pm: diff --git a/modules/AutomakeWorkspaceCreator.pm b/modules/AutomakeWorkspaceCreator.pm index a422d585..b46946a4 100644 --- a/modules/AutomakeWorkspaceCreator.pm +++ b/modules/AutomakeWorkspaceCreator.pm @@ -48,16 +48,7 @@ sub pre_workspace { '## this file will be lost the next time it is generated.', $crlf, '##', $crlf, '## MPC Command:', $crlf, - "## $0 @ARGV", $crlf, $crlf, - 'bin_PROGRAMS =', $crlf, - 'noinst_PROGRAMS =', $crlf, - 'noinst_HEADERS =', $crlf, - 'lib_LTLIBRARIES =', $crlf, - 'BUILT_SOURCES =', $crlf, - 'CLEANFILES =', $crlf, - 'TEMPLATE_FILES =', $crlf, - 'HEADER_FILES =', $crlf, - 'INLINE_FILES =', $crlf, $crlf; + "## $0 @ARGV", $crlf, $crlf; } @@ -91,7 +82,7 @@ sub write_comps { ## If we're writing a configure.ac.Makefiles file, every seen project ## goes into it. Since we only write this at the starting directory ## level, it'll include all projects processed at this level and below. - foreach my $dep (reverse @list) { + foreach my $dep (@list) { if ($mfh) { ## There should be a Makefile at each level, but it's not a project, ## it's a workspace; therefore, it's not in the list of projects. @@ -101,6 +92,23 @@ sub write_comps { my($dep_dir) = dirname($dep); if (!defined $proj_dir_seen{$dep_dir}) { $proj_dir_seen{$dep_dir} = 1; + ## If there are directory levels between project-containing + ## directories (for example, at this time in + ## ACE_wrappers/apps/JAWS/server, there are no projects at the + ## apps or apps/JAWS level) we need to insert the Makefile + ## entries for the levels without projects. They won't be listed + ## in @list but are needed for make to traverse intervening directory + ## levels down to where the project(s) to build are. + my(@dirs) = split /\//, $dep_dir; + my $inter_dir = ""; + foreach my $dep (@dirs) { + $inter_dir = "$inter_dir$dep"; + if (!defined $proj_dir_seen{$inter_dir}) { + $proj_dir_seen{$inter_dir} = 1; + print $mfh "AC_CONFIG_FILES([ $inter_dir" . "/Makefile ])$crlf"; + } + $inter_dir = "$inter_dir/"; + } print $mfh "AC_CONFIG_FILES([ $dep_dir" . "/Makefile ])$crlf"; } } @@ -124,10 +132,27 @@ sub write_comps { close($mfh); } - ## Print out the subdirectories + ## Print out the Makefile.am. If there are local projects in this directory, + ## put the boilerplate stuff first that lets us use += instead of = to + ## add project info to bin_PROGRAMS, etc. Also, if there are local projects, + ## insert "." as the first SUBDIR entry. + if (@locals) { + print $fh 'bin_PROGRAMS =', $crlf, + 'noinst_PROGRAMS =', $crlf, + 'noinst_HEADERS =', $crlf, + 'lib_LTLIBRARIES =', $crlf, + 'BUILT_SOURCES =', $crlf, + 'CLEANFILES =', $crlf, + 'TEMPLATE_FILES =', $crlf, + 'HEADER_FILES =', $crlf, + 'INLINE_FILES =', $crlf, $crlf; + } if (@dirs) { print $fh 'SUBDIRS ='; - foreach my $dir (@dirs) { + if (@locals) { + print $fh " \\$crlf ."; + } + foreach my $dir (reverse @dirs) { print $fh " \\$crlf $dir"; } print $fh $crlf, $crlf; @@ -160,11 +185,14 @@ sub write_comps { print $fh 'ACLOCAL_AMFLAGS = -I m4' . $crlf; } + ## If there's the possibility of any project info here, insert this summary. + if (@locals) { + print $fh $crlf; + print $fh 'pkginclude_HEADERS = $(TEMPLATE_FILES)', + ' $(INLINE_FILES) $(HEADER_FILES)', $crlf; + } ## Finish up with the cleanup specs. print $fh $crlf; - print $fh 'pkginclude_HEADERS = $(TEMPLATE_FILES)', - ' $(INLINE_FILES) $(HEADER_FILES)', $crlf; - print $fh $crlf; print $fh '## Clean up template repositories, etc.' . $crlf; print $fh 'clean-local:' . $crlf; print $fh "\t-rm -f *.bak *.rpo *.sym lib*.*_pure_* Makefile.old core" . $crlf; diff --git a/templates/automake.mpd b/templates/automake.mpd index 41a53a59..e8cbef0e 100644 --- a/templates/automake.mpd +++ b/templates/automake.mpd @@ -79,6 +79,14 @@ lib<%if(sharedname)%><%sharedname%><%else%><%staticname%><%endif%>_la_SOURCES = <%endfor%> <%endif%> +<%if(libs || pure_libs || lit_libs)%> +<%if(exename)%> +<%normalize(exename)%>_LDADD = \ +<%else%> +lib<%if(sharedname)%><%sharedname%><%else%><%staticname%><%endif%>_la_LIBADD = \<%endif%> +<%foreach(libs)%> -l<%lib%><%endfor%><%foreach(pure_libs)%> <%pure_lib%><%endfor%><%foreach(lit_libs)%> -l<%lit_lib%><%endfor%> +<%endif%> + <%if(exename)%> <%if(header_files)%> noinst_HEADERS += \ @@ -87,10 +95,6 @@ noinst_HEADERS += \ <%endfor%> <%endif%> <%else%> -lib<%if(sharedname)%><%sharedname%><%else%><%staticname%><%endif%>_la_LDFLAGS = $(X_LIBS) - -lib<%if(sharedname)%><%sharedname%><%else%><%staticname%><%endif%>_la_LIBADD = $(X_PRE_LIBS) $(<%if(sharedname)%><%sharedname%><%else%><%staticname%><%endif%>_XLIBS) $(X_EXTRA_LIBS) - <%if(template_files)%> TEMPLATE_FILES += \ <%foreach(template_files)%> |