aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Prebuild/src/data/autotools.xml
diff options
context:
space:
mode:
authorJeff Ames2008-03-17 20:55:21 +0000
committerJeff Ames2008-03-17 20:55:21 +0000
commit79209c429705beb57ad9b787718856ab2c9fd37c (patch)
tree6f459e172985bce8ffbfc09a5b9a4594dd881a62 /Prebuild/src/data/autotools.xml
parent* More almost completely unproductive log message fiddling (diff)
downloadopensim-SC-79209c429705beb57ad9b787718856ab2c9fd37c.zip
opensim-SC-79209c429705beb57ad9b787718856ab2c9fd37c.tar.gz
opensim-SC-79209c429705beb57ad9b787718856ab2c9fd37c.tar.bz2
opensim-SC-79209c429705beb57ad9b787718856ab2c9fd37c.tar.xz
Merged changes in Prebuild trunk up to r258 into OpenSim's Prebuild.
Hopefully this should make merging upstream easier. Building with NAnt should still work, but Visual Studio is untested.
Diffstat (limited to '')
-rw-r--r--Prebuild/src/data/autotools.xml790
1 files changed, 790 insertions, 0 deletions
diff --git a/Prebuild/src/data/autotools.xml b/Prebuild/src/data/autotools.xml
new file mode 100644
index 0000000..ee4b064
--- /dev/null
+++ b/Prebuild/src/data/autotools.xml
@@ -0,0 +1,790 @@
1<?xml version="1.0" encoding="utf-8" ?>
2<Autotools>
3 <ProjectAutogenSh>
4 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5 xmlns:dnpb="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd"
6 exclude-result-prefixes="dnpb"
7 >
8 <xsl:template match="/"><xsl:text disable-output-escaping="yes">#!/bin/sh
9# Run this to generate all the initial makefiles, etc.
10# Ripped off from Mono, which ripped off from GNOME macros version
11
12DIE=0
13
14srcdir=`dirname $0`
15test -z "$srcdir" &amp;&amp; srcdir=.
16
17if [ -n "$MONO_PATH" ]; then
18 # from -> /mono/lib:/another/mono/lib
19 # to -> /mono /another/mono
20 for i in `echo ${MONO_PATH} | tr ":" " "`; do
21 i=`dirname ${i}`
22 if [ -n "{i}" -a -d "${i}/share/aclocal" ]; then
23 ACLOCAL_FLAGS="-I ${i}/share/aclocal $ACLOCAL_FLAGS"
24 fi
25 if [ -n "{i}" -a -d "${i}/bin" ]; then
26 PATH="${i}/bin:$PATH"
27 fi
28 done
29 export PATH
30fi
31
32(autoconf --version) &lt; /dev/null > /dev/null 2>&amp;1 || {
33 echo
34 echo "**Error**: You must have \`autoconf' installed to compile Mono."
35 echo "Download the appropriate package for your distribution,"
36 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
37 DIE=1
38}
39
40if [ -z "$LIBTOOL" ]; then
41 LIBTOOL=`which glibtool 2>/dev/null`
42 if [ ! -x "$LIBTOOL" ]; then
43 LIBTOOL=`which libtool`
44 fi
45fi
46
47(grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) &amp;&amp; {
48 ($LIBTOOL --version) &lt; /dev/null > /dev/null 2>&amp;1 || {
49 echo
50 echo "**Error**: You must have \`libtool' installed to compile Mono."
51 echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
52 echo "(or a newer version if it is available)"
53 DIE=1
54 }
55}
56
57grep "^AM_GNU_GETTEXT" $srcdir/configure.ac >/dev/null &amp;&amp; {
58 grep "sed.*POTFILES" $srcdir/configure.ac >/dev/null || \
59 (gettext --version) &lt; /dev/null > /dev/null 2>&amp;1 || {
60 echo
61 echo "**Error**: You must have \`gettext' installed to compile Mono."
62 echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
63 echo "(or a newer version if it is available)"
64 DIE=1
65 }
66}
67
68(automake --version) &lt; /dev/null > /dev/null 2>&amp;1 || {
69 echo
70 echo "**Error**: You must have \`automake' installed to compile Mono."
71 echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
72 echo "(or a newer version if it is available)"
73 DIE=1
74 NO_AUTOMAKE=yes
75}
76
77# if no automake, don't bother testing for aclocal
78test -n "$NO_AUTOMAKE" || (aclocal --version) &lt; /dev/null > /dev/null 2>&amp;1 || {
79 echo
80 echo "**Error**: Missing \`aclocal'. The version of \`automake'"
81 echo "installed doesn't appear recent enough."
82 echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
83 echo "(or a newer version if it is available)"
84 DIE=1
85}
86
87if test "$DIE" -eq 1; then
88 exit 1
89fi
90
91if test -z "$NOCONFIGURE"; then
92
93if test -z "$*"; then
94 echo "**Warning**: I am going to run \`configure' with no arguments."
95 echo "If you wish to pass any to it, please specify them on the"
96 echo \`$0\'" command line."
97 echo
98fi
99
100fi
101
102case $CC in
103xlc )
104 am_opt=--include-deps;;
105esac
106
107
108if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
109 if test -z "$NO_LIBTOOLIZE" ; then
110 echo "Running libtoolize..."
111 ${LIBTOOL}ize --force --copy
112 fi
113fi
114
115echo "Running aclocal $ACLOCAL_FLAGS ..."
116aclocal $ACLOCAL_FLAGS || {
117 echo
118 echo "**Error**: aclocal failed. This may mean that you have not"
119 echo "installed all of the packages you need, or you may need to"
120 echo "set ACLOCAL_FLAGS to include \"-I \$prefix/share/aclocal\""
121 echo "for the prefix where you installed the packages whose"
122 echo "macros were not found"
123 exit 1
124}
125
126if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then
127 echo "Running autoheader..."
128 autoheader || { echo "**Error**: autoheader failed."; exit 1; }
129fi
130
131echo "Running automake --gnu $am_opt ..."
132automake --add-missing --gnu $am_opt ||
133 { echo "**Error**: automake failed."; exit 1; }
134echo "Running autoconf ..."
135autoconf || { echo "**Error**: autoconf failed."; exit 1; }
136
137conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
138
139if test x$NOCONFIGURE = x; then
140 echo Running $srcdir/configure $conf_flags "$@" ...
141 $srcdir/configure $conf_flags "$@" \
142 &amp;&amp; echo Now type \`make\' to compile $PKG_NAME || exit 1
143else
144 echo Skipping configure process.
145fi
146</xsl:text>
147 </xsl:template>
148 </xsl:stylesheet>
149 </ProjectAutogenSh>
150
151 <ProjectConfigureAc>
152<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
153 xmlns:dnpb="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd"
154 exclude-result-prefixes="dnpb"
155 xml:space="preserve"
156 >
157 <!-- Removes the xml version header in the generated file -->
158 <xsl:output method="text"/>
159 <xsl:param name="solutionName" />
160 <xsl:param name="projectName" />
161 <xsl:param name="projectVersion" />
162 <xsl:param name="assemblyName" />
163 <xsl:variable name="lcProjectName"><xsl:value-of select="translate($projectName, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/></xsl:variable>
164 <xsl:template match="/">
165 <xsl:for-each select="//dnpb:Solution[@name=$solutionName]/dnpb:Project[@name=$projectName]"
166>AC_INIT([<xsl:value-of select="$projectName" />],[<xsl:value-of select="$projectVersion" />])
167
168AC_PREREQ(2.60)
169AC_CANONICAL_SYSTEM
170AC_CONFIG_AUX_DIR(.)
171AM_INIT_AUTOMAKE([1.9 tar-ustar foreign])
172AM_MAINTAINER_MODE
173dnl AC_PROG_INTLTOOL([0.25])
174AC_PROG_INSTALL
175
176ASSEMBLY_NAME=<xsl:value-of select="$assemblyName" />
177PROJECT_NAME=<xsl:value-of select="$projectName" />
178PROJECT_VERSION=$VERSION
179PROJECT_DESCRIPTION="<xsl:value-of select="dnpb:Description/text()" />"
180PROJECT_TYPE="<xsl:value-of select="@type" />"
181
182AC_SUBST(ASSEMBLY_NAME)
183AC_SUBST(PROJECT_NAME)
184AC_SUBST(PROJECT_VERSION)
185AC_SUBST(DESCRIPTION)
186
187AC_MSG_CHECKING([assembly type])
188case $PROJECT_TYPE in
189 *Exe)
190 ASSEMBLY_EXTENSION=exe
191 ;;
192 *Library)
193 ASSEMBLY_EXTENSION=dll
194 ;;
195 *)
196 AC_MSG_ERROR([*** Please add support for project type $PROJECT_TYPE to configure.ac checks!])
197 ;;
198esac
199AC_MSG_RESULT([$PROJECT_TYPE])
200
201AC_SUBST(ASSEMBLY_EXTENSION)
202
203AC_MSG_CHECKING([whether we're compiling from an RCS])
204if test -f "$srcdir/.cvs_version" ; then
205 from_rcs=cvs
206else
207 if test -f "$srcdir/.svn/entries" ; then
208 from_rcs=svn
209 else
210 from_rcs=no
211 fi
212fi
213
214AC_MSG_RESULT($from_rcs)
215
216MONO_REQUIRED_VERSION=1.1
217<xsl:text disable-output-escaping="yes">
218PKG_CHECK_MODULES(MONO_DEPENDENCY, mono >= $MONO_REQUIRED_VERSION, has_mono=true, has_mono=false)
219</xsl:text>
220if test "x$has_mono" = "xtrue"; then
221 AC_PATH_PROG(RUNTIME, mono, no)
222 AC_PATH_PROG(CSC, gmcs, no)
223 AC_PATH_PROG(RESGEN, resgen2, no)
224 if test `uname -s` = "Darwin"; then
225 LIB_PREFIX=
226 LIB_SUFFIX=.dylib
227 else
228 LIB_PREFIX=.so
229 LIB_SUFFIX=
230 fi
231else
232 AC_PATH_PROG(CSC, csc.exe, no)
233 if test x$CSC = "xno"; then
234 AC_MSG_ERROR([You need to install either mono or .Net])
235 else
236 RUNTIME=
237 LIB_PREFIX=
238 LIB_SUFFIX=
239 fi
240fi
241
242AC_PATH_PROG(GACUTIL, gacutil)
243if test "x$GACUTIL" = "xno" ; then
244 AC_MSG_ERROR([No gacutil tool found])
245fi
246
247GACUTIL_FLAGS='/package <xsl:value-of select="$assemblyName" /> /gacdir $(DESTDIR)$(prefix)/lib'
248AC_SUBST(GACUTIL_FLAGS)
249
250AC_SUBST(PATH)
251AC_SUBST(LD_LIBRARY_PATH)
252
253AC_SUBST(LIB_PREFIX)
254AC_SUBST(LIB_SUFFIX)
255AC_SUBST(RUNTIME)
256AC_SUBST(CSC)
257AC_SUBST(RESGEN)
258AC_SUBST(GACUTIL)
259
260AC_SUBST(BASE_DEPENDENCIES_CFLAGS)
261AC_SUBST(BASE_DEPENDENCIES_LIBS)
262
263dnl Find monodoc
264MONODOC_REQUIRED_VERSION=1.0
265AC_SUBST(MONODOC_REQUIRED_VERSION)
266<xsl:text disable-output-escaping="yes">
267PKG_CHECK_MODULES(MONODOC_DEPENDENCY, monodoc >= $MONODOC_REQUIRED_VERSION, enable_monodoc=yes, enable_monodoc=no)
268</xsl:text>
269if test "x$enable_monodoc" = "xyes"; then
270 AC_PATH_PROG(MONODOC, monodoc, no)
271 if test x$MONODOC = xno; then
272 enable_monodoc=no
273 fi
274else
275 MONODOC=
276fi
277
278AC_SUBST(MONODOC)
279AM_CONDITIONAL(ENABLE_MONODOC, test "x$enable_monodoc" = "xyes")
280
281winbuild=no
282case "$host" in
283 *-*-mingw*|*-*-cygwin*)
284 winbuild=yes
285 ;;
286esac
287AM_CONDITIONAL(WINBUILD, test x$winbuild = xyes)
288
289<xsl:if test="@type='Exe' or @type='WinExe'">AC_CONFIG_FILES(<xsl:value-of select="$lcProjectName" />)</xsl:if>
290<xsl:if test="@type='Library'">AC_CONFIG_FILES(<xsl:value-of select="$projectName" />.pc)</xsl:if>
291
292AC_CONFIG_FILES(Makefile)
293AC_OUTPUT
294
295echo "==="
296echo ""
297echo "Project configuration summary"
298echo ""
299echo " * Installation prefix: $prefix"
300echo " * compiler: $CSC"
301echo " * Documentation: $enable_monodoc ($MONODOC)"
302echo " * Project Name: $PROJECT_NAME"
303echo " * Version: $PROJECT_VERSION"
304echo ""
305echo "==="
306
307</xsl:for-each>
308</xsl:template>
309</xsl:stylesheet>
310 </ProjectConfigureAc>
311
312 <ProjectMakefileAm>
313<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
314 xmlns:dnpb="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd"
315 exclude-result-prefixes="dnpb"
316 xml:space="preserve"
317 >
318<xsl:param name="projectName" />
319<xsl:param name="solutionName" />
320<xsl:param name="assemblyName" />
321<xsl:variable name="lcProjectName"><xsl:value-of select="translate($projectName, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/></xsl:variable>
322<xsl:param name="embeddedFiles" />
323<xsl:param name="compiledFiles" />
324<xsl:param name="contentFiles" />
325<xsl:param name="extraDistFiles" />
326<xsl:param name="pkgLibs" />
327<xsl:param name="binaryLibs" />
328<xsl:param name="systemLibs" />
329<xsl:param name="localCopyTargets" />
330<xsl:param name="hasAssemblyConfig" />
331
332<xsl:template match="/">
333<xsl:for-each select="//dnpb:Solution[@name=$solutionName]/dnpb:Project[@name=$projectName]">
334<xsl:variable name="lcType"><xsl:value-of select="translate(@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')" /></xsl:variable>
335
336ASSEMBLY=$(ASSEMBLY_NAME).$(ASSEMBLY_EXTENSION)
337<!--
338 If the project is an application, create targets for the wrapper script
339 -->
340<xsl:if test="@type='Exe' or @type='WinExe'">
341<xsl:value-of select="$lcProjectName" />dir = $(prefix)/lib/<xsl:value-of select="$lcProjectName" />
342<xsl:value-of select="$lcProjectName" />_DATA = $(ASSEMBLY)<xsl:if test="$hasAssemblyConfig='true'"> $(ASSEMBLY).config</xsl:if>
343
344bin_SCRIPTS=<xsl:value-of select="$lcProjectName" />
345</xsl:if><xsl:if test="@type='Library'">
346pkgconfigdir = $(prefix)/lib/pkgconfig
347pkgconfig_DATA = <xsl:value-of select="$projectName" />.pc
348<xsl:if test="$hasAssemblyConfig='true'">
349<xsl:value-of select="translate($lcProjectName, '.', '_')" />dir = $(prefix)/lib/mono/<xsl:value-of select="$projectName" />
350<xsl:value-of select="translate($lcProjectName, '.', '_')" />_DATA = $(ASSEMBLY).config
351</xsl:if>
352noinst_DATA = $(ASSEMBLY)
353</xsl:if>
354
355PACKAGES =<xsl:value-of select="$pkgLibs" />
356BINARY_LIBS =<xsl:value-of select="$binaryLibs" />
357SYSTEM_LIBS =<xsl:value-of select="$systemLibs" />
358RESOURCES_SRC =<xsl:value-of select="$embeddedFiles" />
359RESOURCES = $(RESOURCES_SRC:.resx=.resources)
360SOURCES =<xsl:value-of select="$compiledFiles" />
361
362EXTRA_DIST=$(SOURCES) $(BINARY_LIBS) $(RESOURCES_SRC) install-sh missing <xsl:value-of select="$extraDistFiles" />
363
364CLEANFILES=$(ASSEMBLY)
365
366<xsl:value-of select="$localCopyTargets" />
367
368<xsl:for-each select="//dnpb:Solution[@name=$solutionName]/dnpb:Project[@name=$projectName]/dnpb:Configuration">
369<xsl:variable name="outputPath"><xsl:value-of select="dnpb:Options/dnpb:OutputPath/text()" /></xsl:variable>
370<xsl:variable name="keyFile"><xsl:value-of select="dnpb:Options/dnpb:KeyFile/text()" /></xsl:variable>
371<xsl:variable name="docFile"><xsl:value-of select="dnpb:Options/dnpb:XmlDocFile/text()" /></xsl:variable>
372<xsl:value-of select="$outputPath"/>/$(ASSEMBLY): $(srcdir)/$(ASSEMBLY).response $(RESOURCES) $(SOURCES) $(BINARY_LIBS) <xsl:call-template name="substring-after-last-mod"><xsl:with-param name="input" select="$keyFile" /><xsl:with-param name="substr" select="'/'" /></xsl:call-template>
373 <xsl:if test="$docFile!=''">mkdir -p doc <xsl:text disable-output-escaping="yes">&amp;&amp;</xsl:text> </xsl:if>mkdir -p <xsl:value-of select="$outputPath" /> <xsl:text disable-output-escaping="yes">&amp;&amp;</xsl:text> $(CSC) /out:$@ \
374 /target:<xsl:value-of select="$lcType" /> \<xsl:if test="$embeddedFiles!=''">
375 $(addprefix /resource:$(srcdir)/, $(RESOURCES)) \</xsl:if><xsl:if test="$pkgLibs!=''">
376 $(addprefix /pkg:, $(PACKAGES)) \</xsl:if><xsl:if test="$systemLibs!=''">
377 $(addprefix /r:, $(SYSTEM_LIBS)) \</xsl:if><xsl:if test="$binaryLibs!=''">
378 $(addprefix /r:$(srcdir)/, $(BINARY_LIBS)) \</xsl:if>
379 @$(srcdir)/$(ASSEMBLY).response \<xsl:if test="$docFile!=''">
380 /doc:doc/<xsl:value-of select="$docFile" /> \</xsl:if><xsl:if test="$keyFile!=''">
381 /keyfile:$(srcdir)/<xsl:call-template name="substring-after-last-mod"><xsl:with-param name="input" select="$keyFile" /><xsl:with-param name="substr" select="'/'" /></xsl:call-template> \</xsl:if><xsl:if test="dnpb:Options/dnpb:AllowUnsafe/text()='true'">
382 /unsafe \</xsl:if><xsl:text disable-output-escaping="yes">
383 &amp;&amp; rm -f $(ASSEMBLY) \
384 &amp;&amp; ln $@ $(ASSEMBLY)</xsl:text>
385
386CLEANFILES+=<xsl:value-of select="$outputPath"/>/$(ASSEMBLY)
387
388<!-- if this project config has a KeyFile -->
389<xsl:if test="$keyFile!=''">EXTRA_DIST+=<xsl:call-template name="substring-after-last-mod"><xsl:with-param name="input" select="$keyFile" /><xsl:with-param name="substr" select="'/'" /></xsl:call-template></xsl:if>
390
391<xsl:value-of select="@name" />: <xsl:value-of select="$outputPath"/>/$(ASSEMBLY)<xsl:text disable-output-escaping="yes">
392 rm -f $(ASSEMBLY) \
393 &amp;&amp;</xsl:text> ln <xsl:value-of select="$outputPath"/>/$(ASSEMBLY) $(ASSEMBLY)
394<!-- If the project is a library, create library-specific targets -->
395<xsl:if test="//dnpb:Solution[@name=$solutionName]/dnpb:Project[@name=$projectName]/@type='Library'">
396<xsl:choose>
397<!--
398 If the project has a keyfile, make a gac install/uninstall target
399 -->
400 <xsl:when test="dnpb:Options/dnpb:KeyFile/text()!=''">
401<xsl:value-of select="@name" />_install-data-local: <xsl:value-of select="$outputPath"/>/$(ASSEMBLY)
402 echo "$(GACUTIL) /i $(ASSEMBLY) /f $(GACUTIL_FLAGS)"; \
403 $(GACUTIL) /i $(ASSEMBLY) /f $(GACUTIL_FLAGS) || exit 1;
404
405<xsl:value-of select="@name" />_uninstall-local:
406 if [`gacutil -l <xsl:value-of select="$projectName" /> | grep "Number" | awk -F= '{print $$2}'` -gt "0" ] ; \
407 then \
408 echo "$(GACUTIL) /u $(ASSEMBLY_NAME) $(GACUTIL_FLAGS)"; \
409 $(GACUTIL) /u $(ASSEMBLY_NAME) $(GACUTIL_FLAGS) || exit 1; \
410 fi
411 </xsl:when>
412<!--
413 If there is no keyfile for the project, define a filesystem
414 install target
415 -->
416 <xsl:otherwise>
417noinst_<xsl:value-of select="@name" />_<xsl:value-of select="translate($lcProjectName, '.', '_')" />dir = $(prefix)/lib/mono/<xsl:value-of select="$projectName" />
418noinst_<xsl:value-of select="@name" />_<xsl:value-of select="translate($lcProjectName, '.', '_')" />_DATA = <xsl:value-of select="$outputPath"/>/$(ASSEMBLY)
419 </xsl:otherwise>
420</xsl:choose>
421</xsl:if>
422</xsl:for-each>
423
424<xsl:variable name="defaultConfig"><xsl:value-of select="//dnpb:Solution[@name=$solutionName]/dnpb:Project[@name=$projectName]/dnpb:Configuration/@name" /></xsl:variable>
425$(ASSEMBLY): <xsl:value-of select="$defaultConfig" />
426
427<xsl:text disable-output-escaping="yes">
428$(srcdir)/$(ASSEMBLY).response: $(srcdir)/Makefile
429 echo "$(addprefix $(srcdir)/, $(SOURCES))" &gt; $@
430</xsl:text>
431
432all: $(ASSEMBLY)
433
434# rule to compile .resx files to .resources
435%.resources: %.resx
436 $(RESGEN) /useSourcePath /compile $(@:.resources=.resx)
437
438<xsl:if test="@type='Library'">
439<!-- if the default config has a KeyFile -->
440<xsl:choose>
441 <xsl:when test="//dnpb:Solution[@name=$solutionName]/dnpb:Project[@name=$projectName]/dnpb:Configuration[@name=$defaultConfig]/dnpb:Options/dnpb:KeyFile/text()!=''">
442install-data-local: <xsl:value-of select="$defaultConfig" />_install-data-local
443
444uninstall-local: <xsl:value-of select="$defaultConfig" />_uninstall-local
445 </xsl:when>
446<!--
447 If the default config does not have a KeyFile, don't really do
448 anything
449 -->
450 <xsl:otherwise>
451#<xsl:value-of select="translate($lcProjectName, '.', '_')" />dir+=$(noinst_<xsl:value-of select="$defaultConfig" />_<xsl:value-of select="translate($lcProjectName, '.', '_')" />dir)
452#<xsl:value-of select="translate($lcProjectName, '.', '_')" />_DATA+=$(noinst_<xsl:value-of select="$defaultConfig" />_<xsl:value-of select="translate($lcProjectName, '.', '_')" />_DATA)
453 </xsl:otherwise>
454</xsl:choose>
455</xsl:if>
456</xsl:for-each>
457</xsl:template>
458
459<xsl:template name="substring-after-last" xml:space="default">
460 <xsl:param name="input" />
461 <xsl:param name="substr" />
462
463 <!-- Extract the string which comes after the first occurence -->
464 <xsl:variable name="temp" select="substring-after($input,$substr)" />
465
466 <xsl:choose>
467 <!-- If it still contains the search string then recursively process -->
468 <xsl:when test="$substr and contains($temp,$substr)">
469 <xsl:call-template name="substring-after-last">
470 <xsl:with-param name="input" select="$temp" />
471 <xsl:with-param name="substr" select="$substr" />
472 </xsl:call-template>
473 </xsl:when>
474 <xsl:otherwise>
475 <xsl:value-of select="$temp" />
476 </xsl:otherwise>
477 </xsl:choose>
478</xsl:template>
479
480<xsl:template name="substring-after-last-mod" xml:space="default">
481 <xsl:param name="input" />
482 <xsl:param name="substr" />
483
484 <xsl:choose>
485 <xsl:when test="contains($input,$substr)">
486 <xsl:call-template name="substring-after-last">
487 <xsl:with-param name="input" select="$input" />
488 <xsl:with-param name="substr" select="$substr" />
489 </xsl:call-template>
490 </xsl:when>
491 <xsl:otherwise>
492 <xsl:value-of select="$input" />
493 </xsl:otherwise>
494 </xsl:choose>
495</xsl:template>
496</xsl:stylesheet>
497 </ProjectMakefileAm>
498
499 <ProjectPcIn>
500<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
501 xmlns:dnpb="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd"
502 exclude-result-prefixes="dnpb"
503 xml:space="preserve"
504 >
505 <!-- Removes the xml version header in the generated file -->
506 <xsl:output method="text"/>
507 <xsl:param name="projectName" />
508 <xsl:param name="solutionName" />
509 <xsl:variable name="lcProjectName"><xsl:value-of select="translate($projectName, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/></xsl:variable>
510<xsl:template match="/"><xsl:for-each select="//dnpb:Solution[@name=$solutionName]/dnpb:Project[@name=$projectName]">prefix=@prefix@
511exec_prefix=${prefix}
512libdir=${exec_prefix}/lib/mono/@PROJECT_NAME@
513
514Name: <xsl:value-of select="@name" />
515Description: <xsl:value-of select="Description/text()" />
516Version: @PROJECT_VERSION@
517Requires:<xsl:for-each select="Reference"><xsl:if test="@localCopy=false"><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="@name" /></xsl:if></xsl:for-each>
518Libs: -r:${libdir}/@PROJECT_NAME@.dll
519
520</xsl:for-each>
521
522 </xsl:template>
523</xsl:stylesheet>
524 </ProjectPcIn>
525
526 <SolutionAutogenSh>
527<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
528 xmlns:dnpb="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd"
529 exclude-result-prefixes="dnpb"
530 >
531 <xsl:param name="solutionName" />
532 <xsl:template match="/"><xsl:text disable-output-escaping="yes">#!/bin/sh
533# Run this to generate all the initial makefiles, etc.
534# Ripped off from Mono, which ripped off from GNOME macros version
535
536DIE=0
537
538srcdir=`dirname $0`
539test -z "$srcdir" &amp;&amp; srcdir=.
540
541if [ -n "$MONO_PATH" ]; then
542 # from -> /mono/lib:/another/mono/lib
543 # to -> /mono /another/mono
544 for i in `echo ${MONO_PATH} | tr ":" " "`; do
545 i=`dirname ${i}`
546 if [ -n "{i}" -a -d "${i}/share/aclocal" ]; then
547 ACLOCAL_FLAGS="-I ${i}/share/aclocal $ACLOCAL_FLAGS"
548 fi
549 if [ -n "{i}" -a -d "${i}/bin" ]; then
550 PATH="${i}/bin:$PATH"
551 fi
552 done
553 export PATH
554fi
555
556(autoconf --version) &lt; /dev/null > /dev/null 2>&amp;1 || {
557 echo
558 echo "**Error**: You must have \`autoconf' installed to compile Mono."
559 echo "Download the appropriate package for your distribution,"
560 echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
561 DIE=1
562}
563
564if [ -z "$LIBTOOL" ]; then
565 LIBTOOL=`which glibtool 2>/dev/null`
566 if [ ! -x "$LIBTOOL" ]; then
567 LIBTOOL=`which libtool`
568 fi
569fi
570
571(grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) &amp;&amp; {
572 ($LIBTOOL --version) &lt; /dev/null > /dev/null 2>&amp;1 || {
573 echo
574 echo "**Error**: You must have \`libtool' installed to compile Mono."
575 echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
576 echo "(or a newer version if it is available)"
577 DIE=1
578 }
579}
580
581grep "^AM_GNU_GETTEXT" $srcdir/configure.ac >/dev/null &amp;&amp; {
582 grep "sed.*POTFILES" $srcdir/configure.ac >/dev/null || \
583 (gettext --version) &lt; /dev/null > /dev/null 2>&amp;1 || {
584 echo
585 echo "**Error**: You must have \`gettext' installed to compile Mono."
586 echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
587 echo "(or a newer version if it is available)"
588 DIE=1
589 }
590}
591
592(automake --version) &lt; /dev/null > /dev/null 2>&amp;1 || {
593 echo
594 echo "**Error**: You must have \`automake' installed to compile Mono."
595 echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
596 echo "(or a newer version if it is available)"
597 DIE=1
598 NO_AUTOMAKE=yes
599}
600
601
602# if no automake, don't bother testing for aclocal
603test -n "$NO_AUTOMAKE" || (aclocal --version) &lt; /dev/null > /dev/null 2>&amp;1 || {
604 echo
605 echo "**Error**: Missing \`aclocal'. The version of \`automake'"
606 echo "installed doesn't appear recent enough."
607 echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
608 echo "(or a newer version if it is available)"
609 DIE=1
610}
611
612if test "$DIE" -eq 1; then
613 exit 1
614fi
615
616if test -z "$*"; then
617 echo "**Warning**: I am going to run \`configure' with no arguments."
618 echo "If you wish to pass any to it, please specify them on the"
619 echo \`$0\'" command line."
620 echo
621fi
622
623case $CC in
624xlc )
625 am_opt=--include-deps;;
626esac
627
628
629if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
630 if test -z "$NO_LIBTOOLIZE" ; then
631 echo "Running libtoolize..."
632 ${LIBTOOL}ize --force --copy
633 fi
634fi
635
636echo "Running aclocal $ACLOCAL_FLAGS ..."
637aclocal $ACLOCAL_FLAGS || {
638 echo
639 echo "**Error**: aclocal failed. This may mean that you have not"
640 echo "installed all of the packages you need, or you may need to"
641 echo "set ACLOCAL_FLAGS to include \"-I \$prefix/share/aclocal\""
642 echo "for the prefix where you installed the packages whose"
643 echo "macros were not found"
644 exit 1
645}
646
647if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then
648 echo "Running autoheader..."
649 autoheader || { echo "**Error**: autoheader failed."; exit 1; }
650fi
651
652echo "Running automake --gnu $am_opt ..."
653automake --add-missing --gnu $am_opt ||
654 { echo "**Error**: automake failed."; exit 1; }
655echo "Running autoconf ..."
656autoconf || { echo "**Error**: autoconf failed."; exit 1; }
657</xsl:text>
658<xsl:for-each select="/dnpb:Prebuild/dnpb:Solution[@name=$solutionName]/dnpb:Project">
659echo Running <xsl:value-of select="@name" />/autogen.sh ...
660(cd $srcdir/<xsl:value-of select="@name" /> ; NOCONFIGURE=1 /bin/sh ./autogen.sh "$@")
661echo Done running <xsl:value-of select="@name" />/autogen.sh ...
662</xsl:for-each>
663<xsl:text disable-output-escaping="yes">
664conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
665
666if test x$NOCONFIGURE = x; then
667 echo Running $srcdir/configure $conf_flags "$@" ...
668 $srcdir/configure $conf_flags "$@" \
669 &amp;&amp; echo Now type \`make\' to compile $PKG_NAME || exit 1
670else
671 echo Skipping configure process.
672fi
673</xsl:text>
674</xsl:template>
675</xsl:stylesheet>
676 </SolutionAutogenSh>
677
678 <SolutionConfigureAc>
679<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
680 xmlns:dnpb="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd"
681 exclude-result-prefixes="dnpb"
682 xml:space="preserve"
683 >
684 <!-- Removes the xml version header in the generated file -->
685 <xsl:output method="text"/>
686 <xsl:param name="solutionName" />
687<xsl:template match="/"
688>AC_INIT([<xsl:value-of select="$solutionName" />]-solution,[<xsl:value-of select="/dnpb:Prebuild/dnpb:Solution[@name=$solutionName]/@version" />])
689AC_CONFIG_AUX_DIR(.)
690AM_INIT_AUTOMAKE([1.9 tar-ustar foreign])
691EXTRA_DIST="install-sh missing"
692SOLUTION_NAME=<xsl:value-of select="$solutionName" />
693SOLUTION_VERSION=$VERSION
694SOLUTION_DESCRIPTION="<xsl:value-of select="/dnpb:Prebuild/dnpb:Solution[@name=$solutionName]/dnpb:Description" />"
695AC_SUBST(DESCRIPTION)
696
697AM_MAINTAINER_MODE
698
699dnl AC_PROG_INTLTOOL([0.25])
700
701AC_PROG_INSTALL
702
703AC_MSG_CHECKING([whether we're building from an RCS])
704if test -f "$srcdir/.cvs_version" ; then
705 from_rcs=cvs
706else
707 if test -f "$srcdir/.svn/entries" ; then
708 from_rcs=svn
709 else
710 from_rcs=no
711 fi
712fi
713
714AC_MSG_RESULT($from_rcs)
715
716CONFIG="Release"
717AC_SUBST(CONFIG)
718<!-- TODO: Ensure that these SUBDIRS are processed in dependency order -->
719AC_CONFIG_SUBDIRS(<xsl:for-each select="/dnpb:Prebuild/dnpb:Solution[@name=$solutionName]/dnpb:Project"><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="@name" />
720</xsl:for-each>)
721<xsl:text disable-output-escaping="yes">
722
723AC_OUTPUT([
724Makefile
725])
726
727echo "==="
728echo ""
729echo "Solution configuration summary"
730echo ""
731echo " * Solution Name: $SOLUTION_NAME"
732echo " * Version: $SOLUTION_VERSION"
733echo " * Packages:"</xsl:text>
734<xsl:for-each select="/dnpb:Prebuild/dnpb:Solution[@name=$solutionName]/dnpb:Project">echo " - <xsl:value-of select="@name" />"
735</xsl:for-each><xsl:text disable-output-escaping="yes">echo ""
736echo "==="
737</xsl:text>
738</xsl:template>
739</xsl:stylesheet>
740 </SolutionConfigureAc>
741
742 <SolutionMakefileAm>
743<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
744 xmlns:dnpb="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd"
745 exclude-result-prefixes="dnpb"
746 xml:space="preserve"
747 >
748 <xsl:param name="solutionName" />
749 <xsl:template match="/">SUBDIRS =<xsl:for-each select="//dnpb:Solution[@name=$solutionName]/dnpb:Project"><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="@name" /></xsl:for-each>
750</xsl:template>
751</xsl:stylesheet>
752 </SolutionMakefileAm>
753 <ProjectWrapperScriptIn>
754<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
755 xmlns:dnpb="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd"
756 exclude-result-prefixes="dnpb"
757 xml:space="preserve"
758 >
759 <!-- Removes the xml version header in the generated file -->
760 <xsl:output method="text"/>
761 <xsl:param name="projectName" />
762 <xsl:param name="assemblyName" />
763 <xsl:param name="solutionName" />
764 <xsl:param name="monoPath" />
765 <xsl:variable name="lcProjectName"><xsl:value-of select="translate($projectName, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/></xsl:variable>
766<xsl:template match="/"><xsl:for-each select="//dnpb:Solution[@name=$solutionName]/dnpb:Project[@name=$projectName]">#! /bin/sh
767
768PACKAGE=<xsl:value-of select="$assemblyName" />
769prefix=@prefix@
770exec_prefix=@exec_prefix@
771
772# %%$@%$# why oh why isn't it $sharedir/<xsl:value-of select="$lcProjectName" />
773# Day changed to 30 Mar 2007
774# ...
775# 07:50 &lt; cj> why are we installing .exe assemblies to $prefix/lib/$package/ and
776# not $prefix/share/$package ?
777# 07:50 &lt; jonp> momentum.
778# 07:50 &lt; jonp> and it's hard to say that a .exe isn't platform specific
779# 07:50 &lt; jonp> as it can still contain DllImport's which make platform
780# assumptions
781
782packagedir=$prefix/lib/<xsl:value-of select="$lcProjectName" />
783export MONO_PATH=$MONO_PATH<xsl:value-of select="$monoPath" />
784
785exec @RUNTIME@ $packagedir/$PACKAGE.exe "$@"
786</xsl:for-each>
787</xsl:template>
788</xsl:stylesheet>
789 </ProjectWrapperScriptIn>
790</Autotools>