FYI: a recipe for building KPilot

Adriaan de Groot <adridg-FlD2LfDziEhmR6Xm/[email protected]>
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
My testbed for developing the Qt and KDE modules has been KPilot all along. 
Find attached a recipe that builds part of it. This is a collection of 
plugins, all stored as libtool shared libraries. All the different Qt 
filetypes show up, as well as one instance of KDE DCOP.

This recipe depends on the KDE module I just posted, and also on the bdir() 
extension (because the KDE module does) posted yesterday. I intend to add 
fetch attributes shortly, so that it's possible to do what AAP has always 
promised: get the recipe, invoke AAP, and everything gets downloaded and 
compiled properly.

Although the recipe isn't any smaller than the sum of all the Makefile.am's, 
I'll warrant that it's more readable and the structure is clearer.
main.aap (text/plain, 7.7 KB)
### AAP recipe for KPilot's conduits
###
### This recipe builds all of KPilot's conduits, which are:
###	null doc expense popmail vcal todo sysinfo time
###
### Each conduit is a separate libtool library, hence all
### the :ltlib entries here. Some conduits make use of a
### support library, in particular vcal and todo share lots
### of code, and the doc conduit shares code with a converter
### application.
###
### The doc conduit also creates a K-Application for converting
### documents into the right format for the docs reader.

### This assumes that you have a KDEPIM source tree checked out.
### This is still necessary because the libkcal include files
### are not installed yet, so they must be retrieved from the
### sources higher up in KDEPIM.
@if not _top.get("top_srcdir"):
    @_top["top_srcdir"]=os.path.abspath("../..")

### Standard AAP modules needed to compile KDE programs.
:import libtool
:import qt
:import kde

### Files for KDE go right into $PREFIX/share/
PKGNAME=.

### We need a configure check for this. The shell code basically
### looks like: try to compile and like simple qt program without
### -pthread, then try with -pthread, then try with -lpthread.
### It should probably happen in the Qt module, but a :conf check
### for it would be the best solution.
PTHREAD=-pthread

### We need lots of #includes: Qt and KDE includes, KPilot's own
### library, the top of the KDEPIM tree for libkcal, and the BDIR
### to be able to find generated moc and h files. 
### 
### /usr/local/include is one of the "extra-includes" one might need.
### It needs to be an argument on the AAP command line. The test for
### the pilot-link library (that's what /usr/local/include is needed
### for on my system) could also set a variable to the right directory.
all_INCLUDE=-I$top_srcdir/kpilot/lib
	-I$m_kde.KDEDIR/include 
	-I$m_qt.QTDIR/include 
	-I$top_srcdir
	-I/usr/local/include
	-I$BDIR

### Set common variables for all the libraries built here. This means
### rpaths, standard includes, and libraries everyone uses. Individual
### conduits can use { add_ } attributes for specifics.
INCLUDE= $all_INCLUDE
LDFLAGS= -module -avoid-version -no-undefined -rpath $m_kde.KDEDIR/lib
	-L$m_kde.KDEDIR/lib -R$m_kde.KDEDIR/lib
LTLIBS= ../lib/libkpilot.la
LIBS= -lkdeui -lqt-mt $PTHREAD
CXXFLAGS+= -rpath $m_kde.KDEDIR/lib


### Individual conduits
###
### Each conduit needs to set { installdir=kde3 } so that it ends up
### in the KDE modules directory ($PREFIX/lib/kde3) and not elsewhere.
###
### Note how each conduit's sources are arranged in a separate subdir,
### and we just list all the sources that are there (copied from the
### relevant *_SOURCES dir).
:ltlib conduit_null.la 
	{ installdir = kde3 } :
	{ add_INCLUDE = -I$BDIR/null }
	null/setup_base.ui 
	null/null-conduit.cc 
	null/null-factory.cc

:ltlib conduit_time.la 
	{ installdir = kde3 } :
	{ add_INCLUDE = -I$BDIR/timeconduit }
	timeconduit/time-factory.cc
	timeconduit/time-setup.cc
	timeconduit/time-conduit.cc
	timeconduit/time-setup_dialog.ui

:ltlib conduit_sysinfo.la
	{ installdir = kde3 } 
	{ add_LIBS = -lkio } :
	{ add_INCLUDE = -I$BDIR/sysinfoconduit }
	sysinfoconduit/sysinfo-factory.cc
	sysinfoconduit/sysinfo-setup.cc
	sysinfoconduit/sysinfo-conduit.cc
	sysinfoconduit/sysinfo-setup_dialog.ui

### Special data files for the sysinfo conduit.
###
### Here we use AAP's $* construct to attach not only the
### correct subdir to the files, but also to give them an
### installdir attribute (they go in $PREFIX/share/apps/kpilot/...).
kpilot_sysinfo_data_DATA = Template.html Template.txt
_top.INSTALL_DATA += \
	sysinfoconduit/$*kpilot_sysinfo_data_DATA 
		{ installdir=apps/kpilot/sysinfoconduit }


### Here's a conduit that requires an extra library. We tack it onto
### the end of the LIBS variable.
:ltlib conduit_popmail.la
	{ installdir = kde3 }
	{ add_LIBS = -lkio } :
	{ add_INCLUDE = -I$BDIR/popmail }
	popmail/setup-dialog.ui
	popmail/popmail-factory.cc 
	popmail/setupDialog.cc
	popmail/passworddialog.cc 
	popmail/popmail-conduit.cc 
	popmail/parsedate.c


:ltlib conduit_expense.la
	{ installdir = kde3 }
	{ add_LIBS = -lkio } :
	{ add_INCLUDE = -I$BDIR/expense }
	expense/expenseConduit.ui 
	expense/setupDialog.cc
	expense/expense.cc 
	expense/expense-factory.cc

:ltlib conduit_address.la
	{ installdir = kde3 }
	{ add_LIBS = -lkabc -lkabc_file } :
	{ add_INCLUDE = -I$BDIR/abbrowserconduit }
	abbrowserconduit/resolutionDialog_base.ui
	abbrowserconduit/kaddressbookConduit.ui
	abbrowserconduit/resolutionDialog.cc
	abbrowserconduit/abbrowser-factory.cc
	abbrowserconduit/abbrowser-setup.cc
	abbrowserconduit/abbrowser-conduit.cc




 
### VCal conduits share a directory and an intermediate library.
###
### These are two conduits that share a lot of code, so that
### code is listed in a variable first.
vcal_shared = vcalconduit/korganizerConduit.ui
	vcalconduit/vcal-factorybase.cc
	vcalconduit/vcal-setup.cc
	vcalconduit/vcal-conduitbase.cc

:ltlib conduit_vcal.la { installdir = kde3 }  :
	{ add_INCLUDE = -I$BDIR/vcalconduit }
	vcalconduit/vcal-conduit.cc 
	vcalconduit/vcal-factory.cc
	$vcal_shared

:ltlib conduit_todo.la { installdir = kde3 } :
	{ add_INCLUDE = -I$BDIR/vcalconduit }
	vcalconduit/todo-factory.cc 
	vcalconduit/todo-setup.cc 
	vcalconduit/todo-conduit.cc
	$vcal_shared



### Docconduit has both a helper lib, a program and a plugin
###
### There are also icons involved here, which are really complicated
### in KDE. For now, we're ignoring them.
###
### Note that the conduit and the application share a lot of code.
### We use a different setup from the vcal conduits. We make a
### static libtool library which isn't installed at all (hence
### the {installvar=} to prevent installation and the {var_LDFLAGS=}
### which prevents the -rpath and other arguments from making it
### a shared library. The conduit and the application link to
### this library.

# SUBDIRS = Icons
# xdg_apps_DATA = kpalmdoc.desktop 
# servicetypedir = $(kde_servicetypesdir)

:ltlib { installvar = } libpalmdoc_shared.la { var_LDFLAGS = } :
	{ add_INCLUDE = -I$BDIR/docconduit }
	docconduit/makedoc9.cc 
	docconduit/pilotDOCHead.cc 
	docconduit/pilotDOCEntry.cc 
	docconduit/pilotDOCBookmark.cc 
	docconduit/DOC-converter.cc

:ltlib conduit_doc.la { installdir = kde3 } { add_LIBS = -lkdeui -lkio } 
	{ add_LTLIBS = libpalmdoc_shared.la } :
	{ add_INCLUDE = -I$BDIR/docconduit }
	docconduit/doc-factory.cc
	docconduit/doc-setup.cc
	docconduit/doc-conduit.cc
	docconduit/doc-setupdialog.ui
	docconduit/doc-conflictdialog.cc 

:program kpalmdoc { filetype = ltexe }  
	{ installvar = INSTALL_LTLIB }
	{ var_LIBS = -lpisock -lkio $LIBS } 
	{ add_LTLIBS = libpalmdoc_shared.la } :
	{ add_INCLUDE = -I$BDIR/docconduit }
	docconduit/kpalmdoc_dlgbase.ui 
	docconduit/kpalmdoc_dlg.cc
	docconduit/kpalmdoc.cpp




### The knotes conduit is different (from the other conduits) in that
### it uses DCOP to communicate with another application (KNotes, of
### course), and has a copy of that application's DCOP interface
### included. It uses the KDE DCOP compiler to generate C++ code
### for the conduit.
:ltlib conduit_knotes.la
	{ installdir = kde3 }
	{ add_LIBS = -lkdeui } :
	{ add_INCLUDE = -I$BDIR/knotes }
	{ var_OBJSUF = _stub.lo }
	knotes/KNotesIface.h { filetype=stub } { var_LTOBJSUF=_stub.lo }
	knotes/knotes-factory.cc
	knotes/knotes-setup.cc 
	knotes/knotes-action.cc
	knotes/setup_base.ui


# malconduit



service_DATA = null/null-conduit.desktop
	timeconduit/time_conduit.desktop
	vcalconduit/vcal-conduit.desktop 
	vcalconduit/todo-conduit.desktop
	sysinfoconduit/sysinfo_conduit.desktop
	popmail/popmail-conduit.desktop
	knotes/knotes-conduit.desktop
	expense/expense-conduit.desktop
	docconduit/doc_conduit.desktop
	abbrowserconduit/abbrowser_conduit.desktop

_top.INSTALL_DATA += $*service_DATA { installdir = services }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.