[lsb-discuss] Problem building an LSB package which includes its own copy of the CUPS library

Till Kamppeter till.kamppeter at gmail.com
Mon Jul 14 13:13:21 PDT 2008


Then I get

------------------------------------------------------------------------
till at till-laptop:~/rpm/BUILD/hplip-2.8.6$ LSBCC_DEBUG=0x40 
/opt/lsb/bin/lsbcc -o conftest 
-L/home/till/rpm/BUILD/hplip-2.8.6/cups-1.3.7/cups/ 
/home/till/rpm/BUILD/hplip-2.8.6/cups-1.3.7/cups/libcups.a -lcups 
-lpthread -lcrypt  -lz  conftest.c
Adding -fno-stack-protector to args
Adding -Wl,--hash-style=sysv to args
000: cc
001: -o
002: conftest
003: -I
004: /opt/lsb/include
005: /home/till/rpm/BUILD/hplip-2.8.6/cups-1.3.7/cups/libcups.a
006: conftest.c
007: -nodefaultlibs
008: -L
009: /opt/lsb/lib64
010: -L
011: /home/till/rpm/BUILD/hplip-2.8.6/cups-1.3.7/cups/
012: -lcups
013: -lpthread
014: -lcrypt
015: -lz
016: -lpthread
017: -lpthread_nonshared
018: -Wl,--dynamic-linker=/lib64/ld-lsb-x86-64.so.3
019: -fno-stack-protector
020: -L
021: /usr/lib/gcc/x86_64-linux-gnu/4.2.3
022: -L/lib64
023: -L/usr/lib64
024: -Wl,--hash-style=sysv
025: -lgcc
026: -lm
027: -lc
028: -lc_nonshared
029: -lgcc
/tmp/ccW1oby8.o: In function `main':
conftest.c:(.text+0xa): undefined reference to `cupsDoFileRequest'
collect2: ld returned 1 exit status
till at till-laptop:~/rpm/BUILD/hplip-2.8.6$
------------------------------------------------------------------------

I do not have a man page for lsbcc ("man lsbcc" does not find it). Which 
package do I need to install in addtion?

    Till



Wichmann, Mats D wrote:
> turn on debugging in lsbcc to see what command line it's constructing,
> then we should be able to figure out what's happening and how to
> combat it.
> 
> LSBCC_DEBUG=0x40 should do it, but check "man lsbcc" if it
> doesn't do what you expect.
> 
> 
> 
> 
> Till Kamppeter wrote:
>> Hi,
>>
>> I am trying to make LSB packages of HPLIP (http://hplip.sf.net/).
>> HPLIP uses many libraries which are not part of the LSB. So the
>> package has to bring its own copies of these libraries.
>>
>> It also needs interfaces of the CUPS library which are not included in
>> the LSB 3.2. Therefore I am also including a statically linked private
>> copy of the CUPS library.
>>
>> In Gutenprint I am doing this already. See the spec file here:
>>
>>
> http://www.openprinting.org/download/printdriver/SPECS/gutenprint5.2.spe
> c
>> I have tried the same in HPLIP, but HPLIP does a special test for the
>> presence of the CUPS library. It is the line
>>
>> AC_CHECK_LIB([cups], [cupsDoFileRequest], [LIBS="$LIBS"],
>> [AC_MSG_ERROR([cannot find libcups support], 9)])
>>
>> in the congigure.in file. This line is a macro which gets replaced by
>> shell code which compiles a little program. The program looks like
>> this 
>>
>>
> ------------------------------------------------------------------------
>> char cupsDoFileRequest ();
>> int
>> main ()
>> {
>> return cupsDoFileRequest ();
>>    ;
>>    return 0;
>> }
>>
> ------------------------------------------------------------------------
>> and the compilation command line contains my extended CFLAGS and
>> LDFLAGS: 
>>
>>
> ------------------------------------------------------------------------
>> till at till-laptop:~/rpm/BUILD/hplip-2.8.6$ /opt/lsb/bin/lsbcc -o
>> conftest -L/home/till/rpm/BUILD/hplip-2.8.6/cups-1.3.7/cups/
>> /home/till/rpm/BUILD/hplip-2.8.6/cups-1.3.7/cups/libcups.a -lcups
>> -lpthread -lcrypt  -lz  conftest.c
>> /tmp/ccYyAwjV.o: In function `main':
>> conftest.c:(.text+0xa): undefined reference to `cupsDoFileRequest'
>> collect2: ld returned 1 exit status
>> till at till-laptop:~/rpm/BUILD/hplip-2.8.6$
>>
> ------------------------------------------------------------------------
>> The command gives an error because the compilation did not find a
>> function named cupsDoFileRequest in the libraries referenced by the
>> command line. I know that the CUPS livrary of the LSB Build
>> Environment, /opt/lsb/lib64/libcups.so does not contain this
>> function, but "-L/home/till/rpm/BUILD/hplip-2.8.6/cups-1.3.7/cups/
>> /home/till/rpm/BUILD/hplip-2.8.6/cups-1.3.7/cups/libcups.a" should
>> make the compiler using my static CUPS library, and the static CUPS
>> library contains this function.
>>
>> Below you see parts of my spec file, the code to create a static CUPS
>> library, and the "./configure" command line for HPLIP.
>>
>> Is there a simple trick to get this working?
>>
>>     Till
>>
>>
>> This generates the static CUPS library:
>>
> ------------------------------------------------------------------------
>> cd cups-*
>> # Additions to make the CUPS library build
>> # Remove non-LSB function "getpass()"
>> perl -p -i -e 's/return\s*\(getpass\(prompt\)\)/NULL/g' cups/usersys.c
>> # Add definitions for additional IOCTLs
>> perl -p -i -e 's/(\#include\s+\"http-private\.h\")/#define
>> _SYS_IOCTL_H\n#include <bits\/ioctls.h>\n$1/' cups/getifaddrs.c
>> # Let's look at the compilation command lines of CUPS
>> perl -p -i -e "s,^.SILENT:,," Makedefs.in
>> %configure --enable-static --disable-shared --disable-dbus
>> --without-php \ 
>>      --disable-slp --disable-gssapi --disable-ldap --disable-ssl \
>>      --disable-cdsassl --disable-gnutls --disable-openssl
>> --disable-pam \ 
>>      --disable-dnssd --disable-launchd
>> cd cups
>> make
>> cd ..
>> cd ..
>> cupssrc=`ls -d cups*`
>> export CFLAGS="-I`pwd`/$cupssrc $CFLAGS"
>> export LDFLAGS="-L`pwd`/$cupssrc/cups `pwd`/$cupssrc/cups/libcups.a
>> -lpthread -lcrypt  -lz -lcupsimage $LDFLAGS"
>>
> ------------------------------------------------------------------------
>> This is the "./configure" command for HPLIP in my HPLIP spec file:
>>
> ------------------------------------------------------------------------
>> %configure \
>>                  --prefix=%{_prefix} \
>>                  --mandir=%{_mandir} \
>>                  --infodir=%{_infodir} \
>>                  --docdir=%{_docdir} \
>>                  --with-docdir=%{_docdir} \
>>                  --disable-foomatic-drv-install \
>>                  --enable-foomatic-rip-hplip-install \
>>                  --with-drvdir=\$${prefix}/share/cups/drv \
>>                  --with-hpppddir=\$${prefix}/share/ppd/hpijs/HP \
>>                  --datadir=\$${prefix}/share \
>>                  --libexecdir=\$${prefix}/lib \
>>                  --localstatedir=/var \
>>                  --sysconfdir=/etc \
>>                  --enable-debug \
>>                  --without-icondir \
>>                  --disable-foomatic-xml-install \
>>                  --enable-foomatic-ppd-install \
>>                  --enable-network-build \
>>                  --enable-pp-build \
>>                  --enable-scan-build \
>>                  --enable-gui-build \
>>                  --enable-fax-build
>>
> ------------------------------------------------------------------------
>> _______________________________________________
>> lsb-discuss mailing list
>> lsb-discuss at lists.linux-foundation.org
>> https://lists.linux-foundation.org/mailman/listinfo/lsb-discuss
> 
> 




More information about the lsb-discuss mailing list