autotools.xml 27 KB

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