cons-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dependencies in the Program method


From: Zachary Deretsky
Subject: Dependencies in the Program method
Date: Thu, 1 Mar 2001 20:51:27 -0800

Documentation tells:
Cons automatically sets up dependencies on any libraries mentioned in LIBS:
those libraries will be built before the command is linked.

Why then, in my case, cons is not checking and not building the library
libautils.so specified in the same Conscript file before building the
program autest? I'd appreciate any hints.


Here is part of the "cons -d" log:
----------------------------------------------------------------------------
---
LIBS:  -lautils -lstd7d -ltls15d -lpthread -lm -lc
LIBPATH:
/aristo/zwork/icwizard_src/Aexport_SunOS/debug/lib:.:/aristo/zwork/tpc/lib:/
usr/local/lib:/usr/openwin/lib
PREFLIB: lib
SUFLIB: .so
...
Target Abuild_SunOS/debug/autils/src/autest:
Checking Abuild_SunOS/debug/autils/src/autest
  Checking /aristo/zwork/tpc/lib/libstd7d.so
  Checking /aristo/zwork/tpc/lib/libtls15d.so
Rebuilding Abuild_SunOS/debug/autils/src/autest: out of date.
g++ -Wl,-Bdynamic -o
Abuild_SunOS/debug/autils/src/autest -L/aristo/zwork/icwizard_src/Aexport_Su
nOS/debug/lib -L. -L/aristo/zwork/tpc/lib -L/usr/local/lib -L/usr/openwin/li
b -lautils -lstd7d -ltls15d -lpthread -lm -lc
/aristo/zwork/tpc/bin/ld: cannot find -lautils
collect2: ld returned 1 exit status
cons.pl: *** [Abuild_SunOS/debug/autils/src/autest] Error 1
cons.pl: errors constructing Abuild_SunOS/debug/autils/src/autest
----------------------------------------------------------------------------
--

Here is my Conscript file where UnixSharedLibrary method is taken from cons
FAQ:
----------------------------------------------------------------------------
--

Import qw(INCLUDE LIB BIN PYTHON SWIG TABLES RESOURCES DOC STAMPS CONS
DEFINES OS);

#----------------- LIB 1 -----------------#
$LIB_NAME_1 = 'autils';
  @LIB_LIBS_1 = qw(
          python1.5
          dl
          base
          stg
          );

@LIB_SRCS_1 = qw(
          autFirstMultipleGE.cpp
          autFirstMultipleLE.cpp
          autGlobals.cpp
          autMajorMinor.cpp
          autMessage.cpp
          autMonitor.cpp
          autNearestMultiple.cpp
          autParam.cpp
          autParamTable.cpp
          autPool.cpp
          autProp.cpp
          autPropDefinition.cpp
          autPropRegistry.cpp
          autPropTable.cpp
          autPropTypes.cpp
          autPtrList.cpp
          autSearchPath.cpp
          autStringPool.cpp
          autTest.cpp
          GetOpt.cpp
          );

map {$_ = '-l' . $_ } @LIB_LIBS_1;
$mycons = $CONS->clone( LIBS => $CONS->{LIBS} . " @LIB_LIBS_1",
                        DEFINES => $DEFINES,
                        CFLAGS => '-fPIC ' . $CONS->{CFLAGS},
                        LDFLAGS => '-shared -Wl,-soname,%>,-Bsymbolic  ',
                        SUFLIB => '.so',
                        SUFSHLIB => '.so',
                        SUFLIBS => '.so:.a',
                        SUFOBJ => '.pic.o',
                        );
$mycons->UnixSharedLibrary("lib$LIB_NAME_1", @LIB_SRCS_1);
$mycons->Install($LIB, "lib$LIB_NAME_1.so");

#----------------- PROG 1 -----------------#
$PROG_NAME_1 = 'autest';
  @PROG_LIBS_1 = qw(
          autils
          );
@PROG_SRCS_1 = qw(
          autest.cpp
          autStringPool_test.cpp
          );

map {$_ = '-l' . $_ } @PROG_LIBS_1;
$mycons = $CONS->clone( LIBS => " @PROG_LIBS_1 " . $CONS->{LIBS},
                        DEFINES => $DEFINES,
                        LDFLAGS => '-Wl,-Bdynamic  ',
                        SUFLIB => '.so',
                        SUFOBJ => '.o',
                        );

print "LIBS: $mycons->{LIBS}\n";
print "LIBPATH: $mycons->{LIBPATH}\n";
print "PREFLIB: $mycons->{PREFLIB}\n";
print "SUFLIB: $mycons->{SUFLIB}\n";
$mycons->Program($PROG_NAME_1, @PROG_SRC_1);
$mycons->Install($BIN, $PROG_NAME_1);






reply via email to

[Prev in Thread] Current Thread [Next in Thread]