EXPLAINING: DESTDIR and autoconf/automake

W. Tasin tasin at e-technik.fh-muenchen.de
Thu Mar 2 22:32:58 UTC 2000


Hello together,

Ralf Funken asked me to explain him the problem with ktranslator and the
problem about creating rpm-binaries with it. I think it is something you
all should know because we have to look at it for the new project
management.

Problem:
Makefile.am and own written "install" rules inside.
For example:
-------------
  :
  :
install-data-local:
   $(mkinstalldirs) $(kde_appsdir)/Applications/
   $(INSTALL_DATA) ktranslator.kdelnk
$(kde_appsdir)/Applications/ktranslator.kdelnk
  :
  :
-------------
as you can see this take no care of DESTDIR.

it should be at the end (means in the Makefile):
-------------
  :
  :
   $(mkinstalldirs) $(DESTDIR)$(kde_appsdir)/Applications/
   $(INSTALL_DATA) ktranslator.kdelnk
$(DESTDIR)$(kde_appsdir)/Applications/ktranslator.kdelnk
  :
-------------
Now you may ask: Why kdevelop doesn´t have a problem with this, there
are also own written install-data-local rules? 
The answer is the magic "perl am_edit" call. This call modifies all the
Makefile.in, which are generated by "automake"....

"perl automoc" (which is used in some of our templates) doesn´t do
that... 


If you want to use "perl am_edit", so don´t forget to make new rule for
creation of a distribution, I mean the "make dist" call.

So you have to insert at the top-level Makefile.am the following lines
at the beginning of the file:
-------------
dist-hook:
        perl am_edit
  
  :
  :
-------------

I found out another possibility to do this. Instead of writing an own
install-data-local rule, it is also possible to do the following in the
Makefile.am (but I think it is only for automake 1.4):

-------------
  :
  :
applnk_DATA = ktranslator.kdelnk
applnkdir = $(kde_appsdir)/Applications
  :
-------------

another example of Makefile.am I used for the "new" ktranslator:

ktranslator/icons/Makefile.am--------------

EXTRA_DIST =  $(wildcard *.xpm) $(wildcard *.gif)
 
toolbar_DATA = header.xpm copy-string.xpm prev-fuzzy.xpm mosearch.xpm \
               posearch.xpm next-fuzzy.xpm spellcheck.xpm idea.xpm
cvs.xpm
toolbardir = $(kde_toolbardir)
 
iconsmini_DATA = mini-cross.xpm  mini-exp.xpm mini-exclam.xpm
iconsminidir = $(kde_icondir)/mini/
 
icon_DATA = ktranslator.xpm
icondir = $(kde_icondir)
 
pics_DATA = about.gif
picsdir =
$(kde_datadir)/ktranslator/                                                          
-------------------------------------------


That´s all folks
Ciao

Walter

-- 
oohhh sveglia.... il mondo e' ammalato, ma x colpa di chi.........
(Zucchero)
:-------W. Tasin, FB 04,
FHM-------------------PGP-KeyID:0x7961A645----------:
<Key-Fingerprint: 1610 835F 0080 32F4 6140  6CF7 A7D0 44CD 7961A645>
<http://wwwkeys.pgp.net:11371/pks/lookup?op=index&search=0x7961A645&fingerprint=on>




More information about the KDevelop-devel mailing list