ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Plessers <tpless...@tiscali.be>
Subject Apply m4 acts weird in Linux
Date Thu, 14 Aug 2003 12:44:17 GMT
Hi there,

I use Ant in a build process where .jm4 files (=java files that have M4 
macros) are first pre-processed by M4, which saves them in .java files that 
are later on compiled.

It works great in Windows,  but doesn't seem to go well in Linux.

		<apply
			executable="/usr/bin/m4"
			dir="${build.dir}/com/zappware/${name}"
			dest="${build.dir}/com/zappware/${name}"
			relative="true"
			vmlauncher="true"
			os="Linux">

				<arg value="-I${src.abs.dir}"/>
				<srcfile/>
				<arg value=">"/>
				<targetfile/>

				<fileset dir="com/zappware/${name}" includes="*.jm4"/>
				<mapper type="glob" from="*.jm4" to="*.java"/>

		</apply>

In Windows, this passes all .jm4 files to the M4 command and turns it into 
macro-expanded .java files.

example : m4 -IC:\TestProject\com\zappware\testproject\src TestProject.jm4 > 
TestProject.java

However, in Linux, M4 is executed without the ">" and <targetfile/> argument, 
which results in a macro-expanded sourcecode printout to stdout, not to the 
.java file.

example : /usr/bin/m4 -IC:\TestProject\com\zappware\testproject\src 
TestProject.jm4

(printout of expanded file)

/usr/bin/m4 >
(cannot find file >)

/usr/bin/m4 TestProject.java
(cannot fine file TestProject.java)

So it actually cuts the arguments into multiple M4 commands.

Any suggestions, I already upgraded to Ant-1.5.4 with the same results.

Greetings,
Tim Plessers

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message