#95 ✓resolved
codykrieger

Issue building libcss

Reported by codykrieger | December 26th, 2010 @ 07:49 AM | in 0.0.3

What I did:

  • check out latest source from github
  • check out the submodules
  • build node (deps/node-build.sh)
  • check out libcss deps (deps/libcss/checkout-deps.sh)
  • install pkg-config with homebrew
  • attempt to build libcss (deps/libcss/build.sh)

What I expected to happen:
libcss to build successfully.

What actually happened:
libwapcaplet and libparserutils compile successfully, but libcss does not. At first I kept getting pkg-config issues - that led me to add the following line to the top of build.sh:

export PKG_CONFIG_PATH="$(pwd)/libparserutils:$(pwd)/libwapcaplet:$PKG_CONFIG_PATH"

After doing this to stop pkg-config from complaining:

cp deps/libcss/libparserutils/libparserutils.pc.in deps/libcss/libparserutils/libparserutils.pc
cp deps/libcss/libwapcaplet/libwapcaplet.pc.in deps/libcss/libwapcaplet/libwapcaplet.pc

Now, the output is:

------------------- libcss -------------------
 COMPILE: src/libcss.c
cc1: warnings being treated as errors
src/libcss.c: In function ‘css_initialise’:
src/libcss.c:31: warning: implicit declaration of function ‘parserutils_initialise’
src/libcss.c:31: warning: nested extern declaration of ‘parserutils_initialise’
src/libcss.c: In function ‘css_finalise’:
src/libcss.c:47: warning: implicit declaration of function ‘parserutils_finalise’
src/libcss.c:47: warning: nested extern declaration of ‘parserutils_finalise’
make: *** [build-Darwin-i386-release-lib-static/src_libcss.o] Error 1

There's some discussion about this going on here as well: http://groups.google.com/group/kod-app/browse_thread/thread/25ea121...

Comments and changes to this ticket

  • Aku Kotkavuo

    Aku Kotkavuo December 26th, 2010 @ 09:45 AM

    I can confirm this. The gist https://gist.github.com/755113 mentioned in the Google group discussion describes exactly what I'm seeing.

  • rsms

    rsms December 26th, 2010 @ 10:37 AM

    • Milestone set to 0.0.3
    • State changed from “new” to “open”
    • Milestone order changed from “66” to “0”

    It appears as the following line has no effect for you:

    CFLAGS="$CFLAGS -I../libparserutils/include -I../libwapcaplet/include -L.." make...
    

    This line is constructed in the function makeuniversal and instructs the compiler to look for header files in libparserutils/include and libwapcaplet/include, but also instructs the linker to look for libraries in lib.

    Could you please try to dump the CFLAGS passed in env by changing the makeuniversal function to:

    function makeuniversal {
      origd="$(pwd)"
      cd $1
      echo CFLAGS "$CFLAGS -arch x86_64 $3"
      CFLAGS="$CFLAGS -arch i386 $3" make TARGET=i386 || exit $?
      CFLAGS="$CFLAGS -arch x86_64 $3" make TARGET=x86_64 || exit $?
      rm -f ../lib/$2
      lipo build-*i386*/$2 build-*x86_64*/$2 -output ../lib/$2 -create
      cd "$origd"
    }
    

    (The only addition is a new line echo CFLAGS "$CFLAGS -arch x86_64 $3")

    A few questions:

    1. What's the result (output) from the above change (i.e. the value of CFLAGS)?

    2. What compiler are you using? (try cc -v)

    This is the output I'm getting for (1):

    CFLAGS  -arch x86_64 -I../libparserutils/include -I../libwapcaplet/include -L..
    

    Compiler version for (2) (I've added linebreaks):

    $ cc -v
    Using built-in specs.
    Target: i686-apple-darwin10
    Configured with: /var/tmp/gcc/gcc-5664~105/src/configure
      --disable-checking
      --enable-werror
      --prefix=/usr
      --mandir=/share/man
      --enable-languages=c,objc,c++,obj-c++
      --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
      --with-slibdir=/usr/lib
      --build=i686-apple-darwin10
      --program-prefix=i686-apple-darwin10-
      --host=x86_64-apple-darwin10
      --target=i686-apple-darwin10
      --with-gxx-include-dir=/include/c++/4.2.1
    Thread model: posix
    gcc version 4.2.1 (Apple Inc. build 5664)
    
  • Aku Kotkavuo

    Aku Kotkavuo December 26th, 2010 @ 11:44 AM

    I also get exactly the same output for (1) and (2) as you, except for the tmpdir mentioned earlier.

    Could it be that libcss's Makefile is overwriting CFLAGS? It has a section like this:

    # Parserutils & wapcaplet
    ifneq ($(PKGCONFIG),)
      CFLAGS := $(CFLAGS) $(shell $(PKGCONFIG) libparserutils libwapcaplet --cflags)
      LDFLAGS := $(LDFLAGS) $(shell $(PKGCONFIG) libparserutils libwapcaplet --libs)
    else
      CFLAGS := $(CFLAGS) -I$(PREFIX)/include
      LDFLAGS := $(LDFLAGS) -lparserutils -lwapcaplet
    endif
    

    I have pkgconfig installed via Homebrew, but it shouldn't interfere with building this.

  • David

    David December 27th, 2010 @ 01:15 AM

    Similarly to @Swizec: If you pull the -Werror out of the libcss Makefile (just to check), the build process is almost exactly the same as removing

    "|| exit $?"

    from the CFLAGS defs.

  • ronin-130346 (at lighthouseapp)

    ronin-130346 (at lighthouseapp) December 27th, 2010 @ 07:24 AM

    For what is worth, I was running into the same situation mentioned above. I was able to get libcss to build using the tag 0.0.2 versions of libparerutils and libwapcaplet.

    Just updated by deps/libcss/checkout-deps.sh file to look like this:

    #!/bin/bash
    cd "$(dirname "$0")"
    if [ ! -d libparserutils ]; then
      svn co svn://svn.netsurf-browser.org/tags/libparserutils/0.0.2/ libparserutils
    fi
    if [ ! -d libwapcaplet ]; then
      svn co svn://svn.netsurf-browser.org/tags/libwapcaplet/0.0.2/ libwapcaplet
    fi
    

    I noticed a change to libparserutils/include/parserutils/parserutils.h that seems suspect. But, I have no idea if that is at all related to the warnings showing up in the compilation of under the trunk of those dependencies.

    Thoughts?

  • Deleted User

    Deleted User December 27th, 2010 @ 05:55 PM

    I think this is worthy of a patch :D

  • rsms

    rsms December 27th, 2010 @ 06:59 PM

    • State changed from “open” to “resolved”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

A text editor for Mac OS X

Pages