Actual libtool support routines

Adriaan de Groot <adridg-FlD2LfDziEhmR6Xm/[email protected]>
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
Find attached compile and install actions for libtool libraries. I wonder 
whether they should be merged into default.aap or left standalone - after 
all, not everyone is going to use libtool thingies, and it might expand to 
quite some body of code in the end.

-- 
pub  1024D/FEA2A3FE 2002-06-18 Adriaan de Groot <[email protected]>
     Key fingerprint = 934E 31AA 80A7 723F 54F9  50ED 76AC EE01 FEA2 A3FE
libtool.aap (text/plain, 2.3 KB)
@if not _top.get("seen_libtool_aap"):
    _top.seen_libtool_aap = 1
    :print Adding libtool support ...
    LTLIBSUF=.la
    LTLIBPRE=lib
    LTLIBOBJSUF=.lo
    INSTALL_LTLIB=
    libtool?=libtool --silent

    ### Isn't there already an install defined? Does AAP
    ### always use its own copy routines?
    install?=/usr/bin/install

    :filetype
        suffix	lo	ltlibobject
        suffix	la	ltlib
	declare ltprogram

    # There may be such a thing as a C libtool archive, but then (a) your
    # libtool needs to support it (b) you need to uncomment this. KDE
    # of course only has C++ stuff. Part of the problem comes from ltmain.sh
    # which needs to be run to create libtool if no libtool can be found
    # in TOPDIR. But where would ltmain.sh be found? KDE puts it in
    # TOPDIR/admin/, but we can't count on that for libtool in general.

    @if 0:
        :action compile ltlibobject c
            :sys $libtool --silent --mode=compile --tag=C
                $CC $CPPFLAGS $?DEFINE $?INCLUDE `cflags_normal()` $CFLAGS
                -c -o $target $source
        :route c ltobject
            compile
    #endif

    :action compile ltlibobject cpp
        :sys $libtool --silent --mode=compile --tag=CXX
            $CXX $CPPFLAGS $?DEFINE $?INCLUDE `cflags_normal()` $CXXFLAGS
            -c -o $target $source
    :route cpp ltlibobject
        compile

    # It may be useful to use { filetype= } in :ltlib commands,
    # so that buildltlib can use the correct tag.
    :action buildltlib default
        :sys $libtool --mode=link --tag=CXX
            $CXX $?LDFLAGS $?LTLIBS $?LIBS
	    $?LT_RPATH
	    -o $target
	    $source


    # This rule is still here so you can use the { filetype= }
    # attribute to select to build a program with libtool or without.
    :action build ltprogram default
        :sys $libtool --mode=link --tag=CXX g++ -o $target $source $LDFLAGS $?LIBS $?LTLIBS

    :action installltlib default
        @for i in var2dictlist(source):
            destltlib=$DESTDIR/$PREFIX/$DLLDIR
            @if i.has_key("installdir"):
                @destltlib += "/" + i["installdir"] + "/"
            :mkdir {recursive}{force} $destltlib
            @destltlib = destltlib + "/" + i["name"]
            @destltlib = os.path.abspath(destltlib)
            :sys $libtool --mode=install $install `i["name"]` $destltlib

# End of libtool.aap
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.