Difference between revisions of "Build Environment Effort/Module Migration Tips"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Tips 3: Linked Library: (checkpoint save))
Line 97: Line 97:
 
   cppu \
 
   cppu \
 
   ...
 
   ...
   '''sysshell '''  
+
   '''syssh.uno '''  
 
   ...
 
   ...
 
   $(gb_STDLIBS) \
 
   $(gb_STDLIBS) \
Line 106: Line 106:
 
   
 
   
 
  Cannot link against library/libraries sysshell. Libraries must be registered in Repository.mk.
 
  Cannot link against library/libraries sysshell. Libraries must be registered in Repository.mk.
 +
 +
As the hint, we can edit the Repository.mk, which located at SRCROOT, and add the below line:
 +
 +
...
 +
$(eval $(call gb_Helper_register_libraries,OOOLIBS, \
 +
  AppleRemote \
 +
  avmedia \
 +
  basegfx \
 +
  basebmp \
 +
  ...
 +
  '''syssh.uno '''
 +
  ...
 +
  $(gb_STDLIBS) \
 +
  ))
 +
...
 +
 +
Usually, the thing will be over, however, some libs such as the example, another error will be there
 +
 +
  Try `/bin/cp --help' for more information.
 +
  make: *** [/home/int/....../unxlngi6.pro/lib/libsyssh.uno.so] Error 1
  
  
 
I hope this tutorial gives you some useful tips with the new build system. If you find some other good tips, please to contribute here.
 
I hope this tutorial gives you some useful tips with the new build system. If you find some other good tips, please to contribute here.
 
Let's hack with the new build system!
 
Let's hack with the new build system!

Revision as of 09:34, 8 March 2012

Edit.png

Build Environment Effort

Quick Navigation

About this template


The overview steps for migrating a module are tracked here

Here are some useful tips for converting an OOo module to the new Build Environment

Tips 1: Deliver to the solver

Usually there are some header files to be delivered to the solver and the header files, which located at $(SRCDIR)/module/inc. So you can use the Step 3 in Module Migration.

When you need to deliver some headers in source, you can create a file in the module root called Package_source.mk

$(eval $(call gb_Package_Package,toolkit_source,$(SRCDIR)/toolkit/source))
#deliver $(SRCDIR)/toolkit/source/ layout/core/bin.hxx to $SOLARVER/$INPATH/inc/layout/core/bin.hxx
$(eval $(call gb_Package_add_file,toolkit_source,inc/layout/core/bin.hxx,layout/core/bin.hxx))
...

When you need to deliver some utility files, such as *.xml, *cfg ..., you can create a file in the module root called Package_util.mk

$(eval $(call gb_Package_Package,toolkit_util,$(SRCDIR)/toolkit/util))
#deliver $(SRCDIR)/toolkit/util/tookit.xml to $SOLARVER/$INPATH/xml/toolkit.xml
$(eval $(call gb_Package_add_file,toolkit_util,xml/toolkit.xml,toolkit.xml))

Then don't forget to add this files in Module_toolkit.mk (in our case, for other modules, use the name of that module)

...
$(eval $(call gb_Module_add_targets,tools,\
    ...
    Package_source \
    Package_util \
    ...      
 ))
...

Tips 2: Useful Variations

When you writing the makefile, you may need some pre-defined vars for your function. Here is some useful vars.

Vars\OS Windows Linux MacOSX
GUI WNT UNX UNX
GUIBASE WIN unx aqua
OS WNT LINUX MACOSX
COM MSC GCC GCC
INPATH wntmsci12.pro unxlngi6.pro unxmacxi.pro
OUTDIR "$SOLARVER/$INPATH" "$SOLARVER/$INPATH" "$SOLARVER/$INPATH"
WORKDIR "$SOLARVER/$INPATH/workdir" "$SOLARVER/$INPATH/workdir" "$SOLARVER/$INPATH/workdir"
gb_Library_OOOEXT .dll .so .dylib

Template:Documentation/Note

Tips 3: Linked Library

For the libraries to be linked while build a library, you can refer Step 4 in Module Migration.

For example, if you want to link with sysshell.lib in Library_sfx.mk, you can edit the the file and add the library as below:

...
$(eval $(call gb_Library_add_linked_libs,sfx,\
 comphelper \
 cppu \
 ...
 syssh.uno  
 ...
 $(gb_STDLIBS) \
 ))
...

Then, you can use make -sr to build, unfortunate there will be an error message:

Cannot link against library/libraries sysshell. Libraries must be registered in Repository.mk.

As the hint, we can edit the Repository.mk, which located at SRCROOT, and add the below line:

...
$(eval $(call gb_Helper_register_libraries,OOOLIBS, \
 AppleRemote \
 avmedia \
 basegfx \
 basebmp \
 ...
 syssh.uno  
 ...
 $(gb_STDLIBS) \
 ))
...

Usually, the thing will be over, however, some libs such as the example, another error will be there

 Try `/bin/cp --help' for more information.
 make: *** [/home/int/....../unxlngi6.pro/lib/libsyssh.uno.so] Error 1


I hope this tutorial gives you some useful tips with the new build system. If you find some other good tips, please to contribute here. Let's hack with the new build system!

Personal tools