Force scons to use local libraries over system libraries

暗黑聖飢魔 <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <CALUrpDA75a3pPxR5Lk__Au4o1jiWid7jJq1ogBKJYrFRq1nzUw@mail.gmail.com>
Hi, is it possible to change the library path search order, so that scons
searches a specific path before the system path?

We try to build an open source project called gem5, which uses scons as its
build system. We need to link gem5 with *libz 1.2.9*. The problem is that
there is already a */usr/lib/libz.so*, whose version is the incompatible
*1.2.8*. Unfortunately, we don't have permission to update the system
libraries.

We have already tried adding the following statement to SConstruct:

    main.Prepend(LIBPATH=['*/path/to/our/libz*'])

but in the build log, we find "*/path/to/our/libz*" is still searched after
"*/usr/lib*":

    scons build/ARM/gem5.opt --verbose
    ...
    g++ -o build/ARM/marshal \
        -L/usr/lib/python2.7/config-x86_64-linux-gnu \
        -L*/usr/lib* \
        -Xlinker \
        -export-dynamic \
        -Wl,-O1 \
        -Wl,-Bsymolic-functions \
        -z origin build/ARM/python/marshar.o \
        -Lbuild/nomail \
        -Lbuild/libfdt \
        -Lbuild/libelf \
        -Lbuild/iostream3 \
        -Lbuild/fputils \
        -Lbuild/drampower \
        -L*/path/to/our/libz* \
        -Lbuild/googletest \
        -lpthread -lm -lpython2.7 *-lz* -lrt -llz4 ...... -ldrampower
-lfputils -liostream3 -lelf -lfdt -lnomali -lpng

It seems the "*/usr/lib*" is specified by scons itself instead of gem5's
scons scripts. Is it possible to bring our "*/path/to/our/libz*" before
that?

Thanks,
Hsuan

_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
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.