aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Prebuild/src/data/autotools.xml
blob: ee4b0643dcbbdd6fdd919afbf0d6a3883a77cbef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
<?xml version="1.0" encoding="utf-8" ?>
<Autotools>
	<ProjectAutogenSh>
		<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				xmlns:dnpb="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd"
				exclude-result-prefixes="dnpb"
				>
	<xsl:template match="/"><xsl:text disable-output-escaping="yes">#!/bin/sh
# Run this to generate all the initial makefiles, etc.
# Ripped off from Mono, which ripped off from GNOME macros version

DIE=0

srcdir=`dirname $0`
test -z "$srcdir" &amp;&amp; srcdir=.

if [ -n "$MONO_PATH" ]; then
	# from -> /mono/lib:/another/mono/lib
	# to -> /mono /another/mono
	for i in `echo ${MONO_PATH} | tr ":" " "`; do
		i=`dirname ${i}`
		if [ -n "{i}" -a -d "${i}/share/aclocal" ]; then
			ACLOCAL_FLAGS="-I ${i}/share/aclocal $ACLOCAL_FLAGS"
		fi
		if [ -n "{i}" -a -d "${i}/bin" ]; then
			PATH="${i}/bin:$PATH"
		fi
	done
	export PATH
fi

(autoconf --version) &lt; /dev/null > /dev/null 2>&amp;1 || {
  echo
  echo "**Error**: You must have \`autoconf' installed to compile Mono."
  echo "Download the appropriate package for your distribution,"
  echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
  DIE=1
}

if [ -z "$LIBTOOL" ]; then
  LIBTOOL=`which glibtool 2>/dev/null` 
  if [ ! -x "$LIBTOOL" ]; then
    LIBTOOL=`which libtool`
  fi
fi

(grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) &amp;&amp; {
  ($LIBTOOL --version) &lt; /dev/null > /dev/null 2>&amp;1 || {
    echo
    echo "**Error**: You must have \`libtool' installed to compile Mono."
    echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
    echo "(or a newer version if it is available)"
    DIE=1
  }
}

grep "^AM_GNU_GETTEXT" $srcdir/configure.ac >/dev/null &amp;&amp; {
  grep "sed.*POTFILES" $srcdir/configure.ac >/dev/null || \
  (gettext --version) &lt; /dev/null > /dev/null 2>&amp;1 || {
    echo
    echo "**Error**: You must have \`gettext' installed to compile Mono."
    echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
    echo "(or a newer version if it is available)"
    DIE=1
  }
}

(automake --version) &lt; /dev/null > /dev/null 2>&amp;1 || {
  echo
  echo "**Error**: You must have \`automake' installed to compile Mono."
  echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
  echo "(or a newer version if it is available)"
  DIE=1
  NO_AUTOMAKE=yes
}

# if no automake, don't bother testing for aclocal
test -n "$NO_AUTOMAKE" || (aclocal --version) &lt; /dev/null > /dev/null 2>&amp;1 || {
  echo
  echo "**Error**: Missing \`aclocal'.  The version of \`automake'"
  echo "installed doesn't appear recent enough."
  echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
  echo "(or a newer version if it is available)"
  DIE=1
}

if test "$DIE" -eq 1; then
  exit 1
fi

if test -z "$NOCONFIGURE"; then

if test -z "$*"; then
  echo "**Warning**: I am going to run \`configure' with no arguments."
  echo "If you wish to pass any to it, please specify them on the"
  echo \`$0\'" command line."
  echo
fi

fi

case $CC in
xlc )
  am_opt=--include-deps;;
esac


if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
  if test -z "$NO_LIBTOOLIZE" ; then 
    echo "Running libtoolize..."
    ${LIBTOOL}ize --force --copy
  fi
fi

echo "Running aclocal $ACLOCAL_FLAGS ..."
aclocal $ACLOCAL_FLAGS || {
  echo
  echo "**Error**: aclocal failed. This may mean that you have not"
  echo "installed all of the packages you need, or you may need to"
  echo "set ACLOCAL_FLAGS to include \"-I \$prefix/share/aclocal\""
  echo "for the prefix where you installed the packages whose"
  echo "macros were not found"
  exit 1
}

if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then
  echo "Running autoheader..."
  autoheader || { echo "**Error**: autoheader failed."; exit 1; }
fi

echo "Running automake --gnu $am_opt ..."
automake --add-missing --gnu $am_opt ||
  { echo "**Error**: automake failed."; exit 1; }
echo "Running autoconf ..."
autoconf || { echo "**Error**: autoconf failed."; exit 1; }

conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c

if test x$NOCONFIGURE = x; then
  echo Running $srcdir/configure $conf_flags "$@" ...
  $srcdir/configure $conf_flags "$@" \
  &amp;&amp; echo Now type \`make\' to compile $PKG_NAME || exit 1
else
  echo Skipping configure process.
fi
</xsl:text>
	</xsl:template>
	</xsl:stylesheet>
	</ProjectAutogenSh>

	<ProjectConfigureAc>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				xmlns:dnpb="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd"
				exclude-result-prefixes="dnpb"
				xml:space="preserve"
				>
	<!-- Removes the xml version header in the generated file -->
	<xsl:output method="text"/>
	<xsl:param name="solutionName" />
	<xsl:param name="projectName" />
	<xsl:param name="projectVersion" />
	<xsl:param name="assemblyName" />
	<xsl:variable name="lcProjectName"><xsl:value-of select="translate($projectName, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/></xsl:variable>
	<xsl:template match="/">
	<xsl:for-each select="//dnpb:Solution[@name=$solutionName]/dnpb:Project[@name=$projectName]"
>AC_INIT([<xsl:value-of select="$projectName" />],[<xsl:value-of select="$projectVersion" />])

AC_PREREQ(2.60)
AC_CANONICAL_SYSTEM
AC_CONFIG_AUX_DIR(.)
AM_INIT_AUTOMAKE([1.9 tar-ustar foreign])
AM_MAINTAINER_MODE
dnl AC_PROG_INTLTOOL([0.25])
AC_PROG_INSTALL

ASSEMBLY_NAME=<xsl:value-of select="$assemblyName" />
PROJECT_NAME=<xsl:value-of select="$projectName" />
PROJECT_VERSION=$VERSION
PROJECT_DESCRIPTION="<xsl:value-of select="dnpb:Description/text()" />"
PROJECT_TYPE="<xsl:value-of select="@type" />"

AC_SUBST(ASSEMBLY_NAME)
AC_SUBST(PROJECT_NAME)
AC_SUBST(PROJECT_VERSION)
AC_SUBST(DESCRIPTION)

AC_MSG_CHECKING([assembly type])
case $PROJECT_TYPE in
	*Exe)
		ASSEMBLY_EXTENSION=exe
		;;
	*Library)
		ASSEMBLY_EXTENSION=dll
		;;
	*)
		AC_MSG_ERROR([*** Please add support for project type $PROJECT_TYPE to configure.ac checks!])
		;;
esac
AC_MSG_RESULT([$PROJECT_TYPE])

AC_SUBST(ASSEMBLY_EXTENSION)

AC_MSG_CHECKING([whether we're compiling from an RCS])
if test -f "$srcdir/.cvs_version" ; then
        from_rcs=cvs
else
  if test -f "$srcdir/.svn/entries" ; then
  		from_rcs=svn
  else
        from_rcs=no
  fi
fi

AC_MSG_RESULT($from_rcs)

MONO_REQUIRED_VERSION=1.1
<xsl:text disable-output-escaping="yes">
PKG_CHECK_MODULES(MONO_DEPENDENCY, mono >= $MONO_REQUIRED_VERSION, has_mono=true, has_mono=false)
</xsl:text>
if test "x$has_mono" = "xtrue"; then
  AC_PATH_PROG(RUNTIME, mono, no)
  AC_PATH_PROG(CSC, gmcs, no)
  AC_PATH_PROG(RESGEN, resgen2, no)
  if test `uname -s` = "Darwin"; then
        LIB_PREFIX=
        LIB_SUFFIX=.dylib
  else
        LIB_PREFIX=.so
        LIB_SUFFIX=
  fi
else
  AC_PATH_PROG(CSC, csc.exe, no)
  if test x$CSC = "xno"; then
        AC_MSG_ERROR([You need to install either mono or .Net])
  else
    RUNTIME=
    LIB_PREFIX=
    LIB_SUFFIX=
  fi
fi

AC_PATH_PROG(GACUTIL, gacutil)
if test "x$GACUTIL" = "xno" ; then
	AC_MSG_ERROR([No gacutil tool found])
fi

GACUTIL_FLAGS='/package <xsl:value-of select="$assemblyName" /> /gacdir $(DESTDIR)$(prefix)/lib'
AC_SUBST(GACUTIL_FLAGS)

AC_SUBST(PATH)
AC_SUBST(LD_LIBRARY_PATH)

AC_SUBST(LIB_PREFIX)
AC_SUBST(LIB_SUFFIX)
AC_SUBST(RUNTIME)
AC_SUBST(CSC)
AC_SUBST(RESGEN)
AC_SUBST(GACUTIL)

AC_SUBST(BASE_DEPENDENCIES_CFLAGS)
AC_SUBST(BASE_DEPENDENCIES_LIBS)

dnl Find monodoc
MONODOC_REQUIRED_VERSION=1.0
AC_SUBST(MONODOC_REQUIRED_VERSION)
<xsl:text disable-output-escaping="yes">
PKG_CHECK_MODULES(MONODOC_DEPENDENCY, monodoc >= $MONODOC_REQUIRED_VERSION, enable_monodoc=yes, enable_monodoc=no)
</xsl:text>
if test "x$enable_monodoc" = "xyes"; then
        AC_PATH_PROG(MONODOC, monodoc, no)
        if test x$MONODOC = xno; then
           enable_monodoc=no
        fi
else
        MONODOC=
fi

AC_SUBST(MONODOC)
AM_CONDITIONAL(ENABLE_MONODOC, test "x$enable_monodoc" = "xyes")

winbuild=no
case "$host" in
       *-*-mingw*|*-*-cygwin*)
               winbuild=yes
               ;;
esac
AM_CONDITIONAL(WINBUILD, test x$winbuild = xyes)

<xsl:if test="@type='Exe' or @type='WinExe'">AC_CONFIG_FILES(<xsl:value-of select="$lcProjectName" />)</xsl:if>
<xsl:if test="@type='Library'">AC_CONFIG_FILES(<xsl:value-of select="$projectName" />.pc)</xsl:if>

AC_CONFIG_FILES(Makefile)
AC_OUTPUT

echo "==="
echo ""
echo "Project configuration summary"
echo ""
echo "   * Installation prefix: $prefix"
echo "   * compiler:            $CSC"
echo "   * Documentation:       $enable_monodoc ($MONODOC)"
echo "   * Project Name:        $PROJECT_NAME"
echo "   * Version:             $PROJECT_VERSION"
echo ""
echo "==="

</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
	</ProjectConfigureAc>

	<ProjectMakefileAm>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				xmlns:dnpb="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd"
				exclude-result-prefixes="dnpb"
				xml:space="preserve"
				>
<xsl:param name="projectName" />
<xsl:param name="solutionName" />
<xsl:param name="assemblyName" />
<xsl:variable name="lcProjectName"><xsl:value-of select="translate($projectName, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/></xsl:variable>
<xsl:param name="embeddedFiles" />
<xsl:param name="compiledFiles" />
<xsl:param name="contentFiles" />
<xsl:param name="extraDistFiles" />
<xsl:param name="pkgLibs" />
<xsl:param name="binaryLibs" />
<xsl:param name="systemLibs" />
<xsl:param name="localCopyTargets" />
<xsl:param name="hasAssemblyConfig" />

<xsl:template match="/">
<xsl:for-each select="//dnpb:Solution[@name=$solutionName]/dnpb:Project[@name=$projectName]">
<xsl:variable name="lcType"><xsl:value-of select="translate(@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')" /></xsl:variable>

ASSEMBLY=$(ASSEMBLY_NAME).$(ASSEMBLY_EXTENSION)
<!--
  If the project is an application, create targets for the wrapper script
  -->
<xsl:if test="@type='Exe' or @type='WinExe'">
<xsl:value-of select="$lcProjectName" />dir = $(prefix)/lib/<xsl:value-of select="$lcProjectName" />
<xsl:value-of select="$lcProjectName" />_DATA = $(ASSEMBLY)<xsl:if test="$hasAssemblyConfig='true'"> $(ASSEMBLY).config</xsl:if>

bin_SCRIPTS=<xsl:value-of select="$lcProjectName" />
</xsl:if><xsl:if test="@type='Library'">
pkgconfigdir = $(prefix)/lib/pkgconfig
pkgconfig_DATA = <xsl:value-of select="$projectName" />.pc
<xsl:if test="$hasAssemblyConfig='true'">
<xsl:value-of select="translate($lcProjectName, '.', '_')" />dir = $(prefix)/lib/mono/<xsl:value-of select="$projectName" />
<xsl:value-of select="translate($lcProjectName, '.', '_')" />_DATA = $(ASSEMBLY).config
</xsl:if>
noinst_DATA = $(ASSEMBLY)
</xsl:if>

PACKAGES =<xsl:value-of select="$pkgLibs" />
BINARY_LIBS =<xsl:value-of select="$binaryLibs" />
SYSTEM_LIBS =<xsl:value-of select="$systemLibs" />
RESOURCES_SRC =<xsl:value-of select="$embeddedFiles" />
RESOURCES = $(RESOURCES_SRC:.resx=.resources)
SOURCES =<xsl:value-of select="$compiledFiles" />

EXTRA_DIST=$(SOURCES) $(BINARY_LIBS) $(RESOURCES_SRC) install-sh missing <xsl:value-of select="$extraDistFiles" />

CLEANFILES=$(ASSEMBLY)

<xsl:value-of select="$localCopyTargets" />

<xsl:for-each select="//dnpb:Solution[@name=$solutionName]/dnpb:Project[@name=$projectName]/dnpb:Configuration">
<xsl:variable name="outputPath"><xsl:value-of select="dnpb:Options/dnpb:OutputPath/text()" /></xsl:variable>
<xsl:variable name="keyFile"><xsl:value-of select="dnpb:Options/dnpb:KeyFile/text()" /></xsl:variable>
<xsl:variable name="docFile"><xsl:value-of select="dnpb:Options/dnpb:XmlDocFile/text()" /></xsl:variable>
<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>
	<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:$@ \
		/target:<xsl:value-of select="$lcType" /> \<xsl:if test="$embeddedFiles!=''">
		$(addprefix /resource:$(srcdir)/, $(RESOURCES)) \</xsl:if><xsl:if test="$pkgLibs!=''">
		$(addprefix /pkg:, $(PACKAGES)) \</xsl:if><xsl:if test="$systemLibs!=''">
		$(addprefix /r:, $(SYSTEM_LIBS)) \</xsl:if><xsl:if test="$binaryLibs!=''">
		$(addprefix /r:$(srcdir)/, $(BINARY_LIBS)) \</xsl:if>
		@$(srcdir)/$(ASSEMBLY).response \<xsl:if test="$docFile!=''">
		/doc:doc/<xsl:value-of select="$docFile" /> \</xsl:if><xsl:if test="$keyFile!=''">
		/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'">
		/unsafe \</xsl:if><xsl:text disable-output-escaping="yes">
	&amp;&amp; rm -f $(ASSEMBLY) \
	&amp;&amp; ln $@ $(ASSEMBLY)</xsl:text>
	
CLEANFILES+=<xsl:value-of select="$outputPath"/>/$(ASSEMBLY)

<!-- if this project config has a KeyFile -->
<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>

<xsl:value-of select="@name" />: <xsl:value-of select="$outputPath"/>/$(ASSEMBLY)<xsl:text disable-output-escaping="yes">
	rm -f $(ASSEMBLY) \
	&amp;&amp;</xsl:text> ln <xsl:value-of select="$outputPath"/>/$(ASSEMBLY) $(ASSEMBLY)
<!-- If the project is a library, create library-specific targets -->
<xsl:if test="//dnpb:Solution[@name=$solutionName]/dnpb:Project[@name=$projectName]/@type='Library'">
<xsl:choose>
<!--
  If the project has a keyfile, make a gac install/uninstall target
  -->
  <xsl:when test="dnpb:Options/dnpb:KeyFile/text()!=''">
<xsl:value-of select="@name" />_install-data-local: <xsl:value-of select="$outputPath"/>/$(ASSEMBLY)
	echo "$(GACUTIL) /i $(ASSEMBLY) /f $(GACUTIL_FLAGS)";  \
	$(GACUTIL) /i $(ASSEMBLY) /f $(GACUTIL_FLAGS) || exit 1;

<xsl:value-of select="@name" />_uninstall-local:
	if [`gacutil -l <xsl:value-of select="$projectName" /> | grep "Number" | awk -F= '{print $$2}'` -gt "0" ] ; \
	then \
		echo "$(GACUTIL) /u $(ASSEMBLY_NAME) $(GACUTIL_FLAGS)"; \
		$(GACUTIL) /u $(ASSEMBLY_NAME) $(GACUTIL_FLAGS) || exit 1; \
	fi
  </xsl:when>
<!--
   If there is no keyfile for the project, define a filesystem
   install target
  -->
  <xsl:otherwise>
noinst_<xsl:value-of select="@name" />_<xsl:value-of select="translate($lcProjectName, '.', '_')" />dir = $(prefix)/lib/mono/<xsl:value-of select="$projectName" />
noinst_<xsl:value-of select="@name" />_<xsl:value-of select="translate($lcProjectName, '.', '_')" />_DATA = <xsl:value-of select="$outputPath"/>/$(ASSEMBLY)
  </xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:for-each>

<xsl:variable name="defaultConfig"><xsl:value-of select="//dnpb:Solution[@name=$solutionName]/dnpb:Project[@name=$projectName]/dnpb:Configuration/@name" /></xsl:variable>
$(ASSEMBLY): <xsl:value-of select="$defaultConfig" />

<xsl:text disable-output-escaping="yes">
$(srcdir)/$(ASSEMBLY).response: $(srcdir)/Makefile
	echo "$(addprefix $(srcdir)/, $(SOURCES))" &gt; $@
</xsl:text>

all: $(ASSEMBLY)

# rule to compile .resx files to .resources
%.resources: %.resx
	$(RESGEN) /useSourcePath /compile $(@:.resources=.resx)

<xsl:if test="@type='Library'">
<!-- if the default config has a KeyFile -->
<xsl:choose>
  <xsl:when test="//dnpb:Solution[@name=$solutionName]/dnpb:Project[@name=$projectName]/dnpb:Configuration[@name=$defaultConfig]/dnpb:Options/dnpb:KeyFile/text()!=''">
install-data-local: <xsl:value-of select="$defaultConfig" />_install-data-local

uninstall-local: <xsl:value-of select="$defaultConfig" />_uninstall-local
  </xsl:when>
<!--
  If the default config does not have a KeyFile, don't really do
  anything
  -->
  <xsl:otherwise>
#<xsl:value-of select="translate($lcProjectName, '.', '_')" />dir+=$(noinst_<xsl:value-of select="$defaultConfig" />_<xsl:value-of select="translate($lcProjectName, '.', '_')" />dir)
#<xsl:value-of select="translate($lcProjectName, '.', '_')" />_DATA+=$(noinst_<xsl:value-of select="$defaultConfig" />_<xsl:value-of select="translate($lcProjectName, '.', '_')" />_DATA)
  </xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:for-each>
</xsl:template>

<xsl:template name="substring-after-last" xml:space="default">
	<xsl:param name="input" />
	<xsl:param name="substr" />
    
	<!-- Extract the string which comes after the first occurence -->
	<xsl:variable name="temp" select="substring-after($input,$substr)" />
    
    <xsl:choose>
		<!-- If it still contains the search string then recursively process -->
		<xsl:when test="$substr and contains($temp,$substr)">
			<xsl:call-template name="substring-after-last">
				<xsl:with-param name="input" select="$temp" />
				<xsl:with-param name="substr" select="$substr" />
			</xsl:call-template>
		</xsl:when>
		<xsl:otherwise>
			<xsl:value-of select="$temp" />
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>

<xsl:template name="substring-after-last-mod" xml:space="default">
	<xsl:param name="input" />
	<xsl:param name="substr" />

	<xsl:choose>
		<xsl:when test="contains($input,$substr)">
			<xsl:call-template name="substring-after-last">
				<xsl:with-param name="input"  select="$input" />
				<xsl:with-param name="substr" select="$substr" />
			</xsl:call-template>
		</xsl:when>
		<xsl:otherwise>
			<xsl:value-of select="$input" />
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>
</xsl:stylesheet>
	</ProjectMakefileAm>
	
	<ProjectPcIn>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				xmlns:dnpb="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd"
				exclude-result-prefixes="dnpb"
				xml:space="preserve"
				>
	<!-- Removes the xml version header in the generated file -->
	<xsl:output method="text"/>
	<xsl:param name="projectName" />
	<xsl:param name="solutionName" />
	<xsl:variable name="lcProjectName"><xsl:value-of select="translate($projectName, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/></xsl:variable>
<xsl:template match="/"><xsl:for-each select="//dnpb:Solution[@name=$solutionName]/dnpb:Project[@name=$projectName]">prefix=@prefix@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib/mono/@PROJECT_NAME@

Name: <xsl:value-of select="@name" />
Description: <xsl:value-of select="Description/text()" />
Version: @PROJECT_VERSION@
Requires:<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>
Libs: -r:${libdir}/@PROJECT_NAME@.dll

</xsl:for-each>	

	</xsl:template>
</xsl:stylesheet>
	</ProjectPcIn>
	
	<SolutionAutogenSh>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				xmlns:dnpb="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd"
				exclude-result-prefixes="dnpb"
				>
	<xsl:param name="solutionName" />
	<xsl:template match="/"><xsl:text disable-output-escaping="yes">#!/bin/sh
# Run this to generate all the initial makefiles, etc.
# Ripped off from Mono, which ripped off from GNOME macros version

DIE=0

srcdir=`dirname $0`
test -z "$srcdir" &amp;&amp; srcdir=.

if [ -n "$MONO_PATH" ]; then
	# from -> /mono/lib:/another/mono/lib
	# to -> /mono /another/mono
	for i in `echo ${MONO_PATH} | tr ":" " "`; do
		i=`dirname ${i}`
		if [ -n "{i}" -a -d "${i}/share/aclocal" ]; then
			ACLOCAL_FLAGS="-I ${i}/share/aclocal $ACLOCAL_FLAGS"
		fi
		if [ -n "{i}" -a -d "${i}/bin" ]; then
			PATH="${i}/bin:$PATH"
		fi
	done
	export PATH
fi

(autoconf --version) &lt; /dev/null > /dev/null 2>&amp;1 || {
  echo
  echo "**Error**: You must have \`autoconf' installed to compile Mono."
  echo "Download the appropriate package for your distribution,"
  echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
  DIE=1
}

if [ -z "$LIBTOOL" ]; then
  LIBTOOL=`which glibtool 2>/dev/null` 
  if [ ! -x "$LIBTOOL" ]; then
    LIBTOOL=`which libtool`
  fi
fi

(grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) &amp;&amp; {
  ($LIBTOOL --version) &lt; /dev/null > /dev/null 2>&amp;1 || {
    echo
    echo "**Error**: You must have \`libtool' installed to compile Mono."
    echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
    echo "(or a newer version if it is available)"
    DIE=1
  }
}

grep "^AM_GNU_GETTEXT" $srcdir/configure.ac >/dev/null &amp;&amp; {
  grep "sed.*POTFILES" $srcdir/configure.ac >/dev/null || \
  (gettext --version) &lt; /dev/null > /dev/null 2>&amp;1 || {
    echo
    echo "**Error**: You must have \`gettext' installed to compile Mono."
    echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
    echo "(or a newer version if it is available)"
    DIE=1
  }
}

(automake --version) &lt; /dev/null > /dev/null 2>&amp;1 || {
  echo
  echo "**Error**: You must have \`automake' installed to compile Mono."
  echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
  echo "(or a newer version if it is available)"
  DIE=1
  NO_AUTOMAKE=yes
}


# if no automake, don't bother testing for aclocal
test -n "$NO_AUTOMAKE" || (aclocal --version) &lt; /dev/null > /dev/null 2>&amp;1 || {
  echo
  echo "**Error**: Missing \`aclocal'.  The version of \`automake'"
  echo "installed doesn't appear recent enough."
  echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
  echo "(or a newer version if it is available)"
  DIE=1
}

if test "$DIE" -eq 1; then
  exit 1
fi

if test -z "$*"; then
  echo "**Warning**: I am going to run \`configure' with no arguments."
  echo "If you wish to pass any to it, please specify them on the"
  echo \`$0\'" command line."
  echo
fi

case $CC in
xlc )
  am_opt=--include-deps;;
esac


if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
  if test -z "$NO_LIBTOOLIZE" ; then 
    echo "Running libtoolize..."
    ${LIBTOOL}ize --force --copy
  fi
fi

echo "Running aclocal $ACLOCAL_FLAGS ..."
aclocal $ACLOCAL_FLAGS || {
  echo
  echo "**Error**: aclocal failed. This may mean that you have not"
  echo "installed all of the packages you need, or you may need to"
  echo "set ACLOCAL_FLAGS to include \"-I \$prefix/share/aclocal\""
  echo "for the prefix where you installed the packages whose"
  echo "macros were not found"
  exit 1
}

if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then
  echo "Running autoheader..."
  autoheader || { echo "**Error**: autoheader failed."; exit 1; }
fi

echo "Running automake --gnu $am_opt ..."
automake --add-missing --gnu $am_opt ||
  { echo "**Error**: automake failed."; exit 1; }
echo "Running autoconf ..."
autoconf || { echo "**Error**: autoconf failed."; exit 1; }
</xsl:text>
<xsl:for-each select="/dnpb:Prebuild/dnpb:Solution[@name=$solutionName]/dnpb:Project">
echo Running <xsl:value-of select="@name" />/autogen.sh ...
(cd $srcdir/<xsl:value-of select="@name" /> ; NOCONFIGURE=1  /bin/sh ./autogen.sh "$@")
echo Done running <xsl:value-of select="@name" />/autogen.sh ...
</xsl:for-each>
<xsl:text disable-output-escaping="yes">
conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c

if test x$NOCONFIGURE = x; then
  echo Running $srcdir/configure $conf_flags "$@" ...
  $srcdir/configure $conf_flags "$@" \
  &amp;&amp; echo Now type \`make\' to compile $PKG_NAME || exit 1
else
  echo Skipping configure process.
fi
</xsl:text>
</xsl:template>
</xsl:stylesheet>	
	</SolutionAutogenSh>
	
	<SolutionConfigureAc>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				xmlns:dnpb="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd"
				exclude-result-prefixes="dnpb"
				xml:space="preserve"
				>
	<!-- Removes the xml version header in the generated file -->
	<xsl:output method="text"/>
	<xsl:param name="solutionName" />
<xsl:template match="/"
>AC_INIT([<xsl:value-of select="$solutionName" />]-solution,[<xsl:value-of select="/dnpb:Prebuild/dnpb:Solution[@name=$solutionName]/@version" />])
AC_CONFIG_AUX_DIR(.)
AM_INIT_AUTOMAKE([1.9 tar-ustar foreign])
EXTRA_DIST="install-sh missing"
SOLUTION_NAME=<xsl:value-of select="$solutionName" />
SOLUTION_VERSION=$VERSION
SOLUTION_DESCRIPTION="<xsl:value-of select="/dnpb:Prebuild/dnpb:Solution[@name=$solutionName]/dnpb:Description" />"
AC_SUBST(DESCRIPTION)

AM_MAINTAINER_MODE

dnl AC_PROG_INTLTOOL([0.25])

AC_PROG_INSTALL

AC_MSG_CHECKING([whether we're building from an RCS])
if test -f "$srcdir/.cvs_version" ; then
        from_rcs=cvs
else
  if test -f "$srcdir/.svn/entries" ; then
  		from_rcs=svn
  else
        from_rcs=no
  fi
fi

AC_MSG_RESULT($from_rcs)

CONFIG="Release"
AC_SUBST(CONFIG)
<!-- TODO: Ensure that these SUBDIRS are processed in dependency order -->
AC_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" />
</xsl:for-each>)
<xsl:text disable-output-escaping="yes">

AC_OUTPUT([
Makefile
])

echo "==="
echo ""
echo "Solution configuration summary"
echo ""
echo "   * Solution Name:       $SOLUTION_NAME"
echo "   * Version:       $SOLUTION_VERSION"
echo "   * Packages:"</xsl:text>
<xsl:for-each select="/dnpb:Prebuild/dnpb:Solution[@name=$solutionName]/dnpb:Project">echo "    - <xsl:value-of select="@name" />"
</xsl:for-each><xsl:text disable-output-escaping="yes">echo ""
echo "==="
</xsl:text>
</xsl:template>
</xsl:stylesheet>
	</SolutionConfigureAc>
	
	<SolutionMakefileAm>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				xmlns:dnpb="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd"
				exclude-result-prefixes="dnpb"
				xml:space="preserve"
				>
	<xsl:param name="solutionName" />
	<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>
</xsl:template>
</xsl:stylesheet>
	</SolutionMakefileAm>
	<ProjectWrapperScriptIn>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				xmlns:dnpb="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd"
				exclude-result-prefixes="dnpb"
				xml:space="preserve"
				>
	<!-- Removes the xml version header in the generated file -->
	<xsl:output method="text"/>
	<xsl:param name="projectName" />
	<xsl:param name="assemblyName" />
	<xsl:param name="solutionName" />
	<xsl:param name="monoPath" />
	<xsl:variable name="lcProjectName"><xsl:value-of select="translate($projectName, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')"/></xsl:variable>
<xsl:template match="/"><xsl:for-each select="//dnpb:Solution[@name=$solutionName]/dnpb:Project[@name=$projectName]">#! /bin/sh

PACKAGE=<xsl:value-of select="$assemblyName" />
prefix=@prefix@
exec_prefix=@exec_prefix@

# %%$@%$# why oh why isn't it $sharedir/<xsl:value-of select="$lcProjectName" />
# Day changed to 30 Mar 2007
# ...
# 07:50 &lt; cj> why are we installing .exe assemblies to $prefix/lib/$package/ and 
#             not $prefix/share/$package ?
# 07:50 &lt; jonp> momentum.
# 07:50 &lt; jonp> and it's hard to say that a .exe isn't platform specific
# 07:50 &lt; jonp> as it can still contain DllImport's which make platform 
#               assumptions

packagedir=$prefix/lib/<xsl:value-of select="$lcProjectName" />
export MONO_PATH=$MONO_PATH<xsl:value-of select="$monoPath" /> 

exec @RUNTIME@ $packagedir/$PACKAGE.exe "$@"
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
	</ProjectWrapperScriptIn>
</Autotools>