[ 
http://jira.codehaus.org/browse/MOJO-1416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=250999#action_250999
 ] 

Clément Igonet edited comment on MOJO-1416 at 1/10/11 5:14 AM:
---------------------------------------------------------------

I try to use maven native plugin to compile BCC sources files.
It seems that the linker work like this:
- using compilerProvider tag will define linker as "ilink32" and will not use 
"-o" string for objects file definition
- linkerStartOptions adds options before object files definition
- linkerMiddleOptions tag adds options after object files definition and 
executable name
- linkerEndOptions does not do anything

But I think there is a bug because the maven native plugin add a comma at the 
end as a resutls.

my pom:
(...)
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>native-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <compilerProvider>bcc</compilerProvider>
                    <compilerOutputDirectory>./Obj</compilerOutputDirectory>
                    <compilerStartOptions>
                        <compilerStartOption>${CFLAG1} ${WARNINGS} 
-I${INCLUDEPATH} -D_DEBUG;NO_STRICT -v -nObj</compilerStartOption>
                    </compilerStartOptions>
                    <sources>
                        <source>
                            <directory>.</directory>
                            <includes>
                                <include>*.cpp</include>
                            </includes>
                        </source>
                    <linkerStartOptions>
                        <linkerStartOption>${LFLAGS} 
-L${LIBPATH}</linkerStartOption>
                    </linkerStartOptions>

                    <linkerMiddleOptions>
                        <linkerMiddleOption>, ${ALLLIB},, 
${ALLRES}</linkerMiddleOption>
                    </linkerMiddleOptions>

                    <!-- Here, just for test -->
                    <linkerEndOptions>
                        <linkerEndOption>AAA</linkerEndOption>
                    </linkerEndOptions>
                </configuration>
            </plugin>
(...)

Result:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Project
[INFO]    task-segment: [compile]
[INFO] ------------------------------------------------------------------------
[INFO] [native:initialize {execution: default-initialize}]
[INFO] [native:unzipinc {execution: default-unzipinc}]
[INFO] [native:compile {execution: default-compile}]
[INFO] [native:link {execution: default-link}]
[INFO] cmd.exe /X /C "ilink32 -ID:\Project\Obj -D"" -H:0x1000000 -Hc:0x100000 
-aa -Tpe -x -Gn -v 
-L"C:\Progra~1\Borland\CBuilder6\Projects";..\commun\JBUS;..\commun;"C:\Progra~1\Borland\CBuilder6\Projects\Lib";"C:\Progra~1\Borland\CBuilder6\lib\obj";"C:\Progra~1\Borland\CBuilder6\lib";"D:\ISS\Commun\GestionBD"
 ["All obj files"] ,d:\Project\target\project.exe , , inet.lib xmlrtl.lib 
vcl.lib rtl.lib import32.lib cp32mt.lib,, Obj\Project.res ,"
Turbo Incremental Link 5.64 Copyright (c) 1997-2002 Borland
Fatal: Too many commas on command line: 
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error executing command line. Exit code:2

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Mon Jan 10 12:10:42 CET 2011
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------

My solution:
remove the last comma and/or make linkerEndOptions usefull

      was (Author: clement.igonet):
    I try to use maven native plugin to compile BCC sources files.
It seems that the linker work like this:
- using compilerProvider tag will define linker as "ilink32" and will not use 
"-o" string for objects file definition
- linkerStartOptions adds options before object files definition
- linkerMiddleOptions tag adds options after object files definition and 
executable name
- linkerEndOptions does not do anything

But I think there is a bug because the maven native plugin add a comma at the 
end as a resutls.

my pom:
(...)
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>native-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <compilerProvider>bcc</compilerProvider>
                    <compilerOutputDirectory>./Obj</compilerOutputDirectory>
                    <compilerStartOptions>
                        <compilerStartOption>${CFLAG1} ${WARNINGS} 
-I${INCLUDEPATH} -D_DEBUG;NO_STRICT -v -nObj</compilerStartOption>
                    </compilerStartOptions>
                    <sources>
                        <source>
                            <directory>.</directory>
                            <includes>
                                <include>*.cpp</include>
                            </includes>
                        </source>
                    <linkerStartOptions>
                        <linkerStartOption>${LFLAGS} 
-L${LIBPATH}</linkerStartOption>
                    </linkerStartOptions>

                    <linkerMiddleOptions>
                        <linkerMiddleOption>, ${ALLLIB},, 
${ALLRES}</linkerMiddleOption>
                    </linkerMiddleOptions>

                    <!-- Here, just for test -->
                    <linkerEndOptions>
                        <linkerEndOption>AAA</linkerEndOption>
                    </linkerEndOptions>
                </configuration>
            </plugin>
(...)

Result:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Retrochargement
[INFO]    task-segment: [compile]
[INFO] ------------------------------------------------------------------------
[INFO] [native:initialize {execution: default-initialize}]
[INFO] [native:unzipinc {execution: default-unzipinc}]
[INFO] [native:compile {execution: default-compile}]
[INFO] [native:link {execution: default-link}]
[INFO] cmd.exe /X /C "ilink32 -ID:\ISS\Retrochargement\Obj -D"" -H:0x1000000 
-Hc:0x100000 -aa -Tpe -x -Gn -v 
-L"C:\Progra~1\Borland\CBuilder6\Projects";..\commun\JBUS;..\commun;"C:\Progra~1\Borland\CBuilder6\Projects\Lib";"C:\Progra~1\Borland\CBuilder6\lib\obj";"C:\Progra~1\Borland\CBuilder6\lib";"D:\ISS\Commun\GestionBD"
 ["All obj files"] ,d:\ISS\RetroChargement\target\retrex.exe , , inet.lib 
xmlrtl.lib vcl.lib rtl.lib import32.lib cp32mt.lib,, Obj\MsgRetrochargement.res 
,"
Turbo Incremental Link 5.64 Copyright (c) 1997-2002 Borland
Fatal: Too many commas on command line: 
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error executing command line. Exit code:2

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Mon Jan 10 12:10:42 CET 2011
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------

My solution:
remove the last comma and/or make linkerEndOptions usefull
  
> using the Bcc compile provider placed all dependant .jar file on linker path 
> causing failure
> --------------------------------------------------------------------------------------------
>
>                 Key: MOJO-1416
>                 URL: http://jira.codehaus.org/browse/MOJO-1416
>             Project: Mojo
>          Issue Type: Bug
>          Components: native
>         Environment: Windows XP
>            Reporter: Damon Jacobsen
>            Priority: Critical
>
> Using this POM
> <project xmlns="http://maven.apache.org/POM/4.0.0"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
> http://maven.apache.org/maven-v4_0_0.xsd";>
>       <modelVersion>4.0.0</modelVersion>
>       <groupId>com.lifetouch.utility</groupId>
>       <artifactId>ImagenomicPortraturePluginDLL</artifactId>
>       <packaging>dll</packaging>
>       <version>0.0.1-SNAPSHOT</version>
>       <dependencies>
>               <dependency>
>                       <groupId>com.lifetouch.utility</groupId>
>                       <artifactId>ImagenomicPortraturePlugin</artifactId>
>                       <version>0.0.1-SNAPSHOT</version>
>               </dependency>
>       </dependencies>
>       <build>
>               <plugins>
>                       <plugin>
>                               <groupId>org.codehaus.mojo</groupId>
>                               <artifactId>native-maven-plugin</artifactId>
>                               <extensions>true</extensions>
>                               <configuration>
>                               <compilerProvider>generic</compilerProvider>
>                               <compilerExecutable>bcc32</compilerExecutable>
>                               <linkerExecutable>bcc32</linkerExecutable>
>                               <linkerStartOptions></linkerStartOptions>
>                               <linkerMiddleOptions></linkerMiddleOptions>
>                               <linkerEndOptions></linkerEndOptions>
>                                       <!--
>                                               | Add jdk include directories 
> to system include path | Override
>                                               ${jkdIncludePath} If your jdk 
> does not conform to Sun JDK layout
>                                       -->
>                                       <javahOS>win32</javahOS>
>                               </configuration>
>                               <!--
>                                       Generate JNI header files based on a 
> list of class name on the
>                                       classpath
>                               -->
>                               <!--
>                                       The generated include directory is 
> automatically added to include
>                                       path at compile phase
>                               -->
>                               <!-- Ensure to have appropriate denpendency jar 
> file(s) in your pom -->
>                               <executions>
>                                       <execution>
>                                               <id>javah</id>
>                                               <phase>generate-sources</phase>
>                                               <configuration>
>                                                       <!--
>                                                               | Note: | 1. 
> Without classNames, javah mojo will search for all
>                                                               JNI classes | 
> in your dependency list.
>                                                       -->
>                                               </configuration>
>                                               <goals>
>                                                       <goal>javah</goal>
>                                               </goals>
>                                       </execution>
>                               </executions>
>                       </plugin>
>               </plugins>
>       </build>
> </project>
> I get the results 
> [INFO] ilink32 "C:\Documents and 
> Settings\djacobsen\workspace\ImagenomicPortratu
> rePluginDLL\target\lib\ImagenomicPortraturePlugin.jar" ",C:\Documents and 
> Settin
> gs\djacobsen\workspace\ImagenomicPortraturePluginDLL\target\ImagenomicPortrature
> PluginDLL.dll" , ,
> Turbo Incremental Link 5.64 Copyright (c) 1997-2002 Borland
> Error: 'C:\DOCUMENTS AND 
> SETTINGS\DJACOBSEN\WORKSPACE\IMAGENOMICPORTRATUREPLUGIN
> DLL\TARGET\LIB\IMAGENOMICPORTRATUREPLUGIN.JAR' contains invalid OMF record, 
> type
>  0x50
> Notice the jar file being passed to the linker.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to