You are not logged in.

#1 2005-04-26 14:53:25

vande198
Member
From: East Lansing, MI, USA
Registered: 2003-09-12
Posts: 98

Trouble Compiling links-hacked

I'm trying to get links-hacked to compile.  Here's my PKGBUILD:

pkgname=links-hacked
pkgver=030709
pkgrel=1
pkgdesc="An enhanced version of links with support for tabs"
pkgurl="http://xray.sai.msu.ru/~karpov/links-hacked/"
url="http://xray.sai.msu.ru/~karpov/links-hacked/"
source=(http://xray.sai.msu.ru/~karpov/$pkgname/downloads/$pkgname-$pkgver.tgz http://xray.sai.msu.ru/~karpov/links-hacked/downloads/links-fonts-new.tgz)
depends=('openssl' 'x-server')
md5sums=(74fb710ecfa89aceb51211f7dce24ab0 1176ee9132c9df8c1ec955e28bff6f5b)
conflicts=(links)

build() {
  cd $startdir/src/$pkgname-$pkgver/
  mv ../font ./
  ./autogen.sh
  ./configure --prefix=/usr --enable-ssl --enable-javascript --enable-graphics
  make || return 1
  make prefix=$startdir/pkg/usr install
}

However, compilation fails with this:

if gcc -DHAVE_CONFIG_H -I. -I. -I.   -I/usr/local/include -I/usr/X11R6/include  -O2 -march=pentium2 -mmmx -fomit-frame-pointer -mtune=pentium2 -pipe -I/usr/include/freetype2 -MT options.o -MD -MP -MF ".deps/options.Tpo" -c -o options.o options.c; 
then mv -f ".deps/options.Tpo" ".deps/options.Po"; else rm -f ".deps/options.Tpo"; exit 1; fi
options.c: In function `load_options':
options.c:264: error: label at end of compound statement
make[2]: *** [options.o] Error 1
make[2]: Leaving directory `/var/abs/local/links-hacked/src/links-hacked-030709'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/abs/local/links-hacked/src/links-hacked-030709'
make: *** [all] Error 2
==> ERROR: Build Failed.  Aborting...

Any suggestions?

PS It appears that the website for links-hacked is down, so I'll try to upload the source to my own webspace.


"To be a Spartan is to be a philosopher much more than to be an athlete."
Plato, the <i>Protagoras</i>, 342e-343a

Offline

#2 2005-04-26 15:18:19

vande198
Member
From: East Lansing, MI, USA
Registered: 2003-09-12
Posts: 98

Re: Trouble Compiling links-hacked


"To be a Spartan is to be a philosopher much more than to be an athlete."
Plato, the <i>Protagoras</i>, 342e-343a

Offline

#3 2005-04-26 15:21:44

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Trouble Compiling links-hacked

do me a favor and check +-5 lines at:

options.c: In function `load_options':
options.c:264: error: label at end of compound statement 

I'm going to assume there's an ifdef block to remove some borked code... *shrug*

Offline

#4 2005-04-26 16:01:03

neri
Forum Fellow
From: Victoria, Canada
Registered: 2003-05-04
Posts: 553

Re: Trouble Compiling links-hacked

phrakture wrote:

do me a favor and check +-5 lines at:

options.c: In function `load_options':
options.c:264: error: label at end of compound statement 

I'm going to assume there's an ifdef block to remove some borked code... *shrug*

probably it is a switch/case issue, where the last case is left open which has been allowd until gcc-3.4. Search for a thing like
blah:

and add an empty command (read: just add a semicolon) and it should work.
Crystalball says, it's the "default:" case which is not closed.

-neri

Offline

#5 2005-04-26 21:13:02

JGC
Developer
Registered: 2003-12-03
Posts: 1,664

Re: Trouble Compiling links-hacked

if it's the last default: case, just close it with a neat "break;" instruction.

Offline

#6 2005-04-27 13:39:57

vande198
Member
From: East Lansing, MI, USA
Registered: 2003-09-12
Posts: 98

Re: Trouble Compiling links-hacked

I don't know quite where to put that "break;"  Here are the two instances of the pattern "load_options" in options.c:

void load_options()
{
    FILE *f;
        unsigned char *options_file = stracpy (links_home);

        if (!options_file)
                goto load_failure;

        add_to_strn(&options_file, "options");

        f = fopen(options_file, "r");
        mem_free(options_file);

        if (!f){
                goto load_failure;
        }

        while(!feof(f)){
                unsigned char *tmp=mem_alloc(MAX_STR_LEN);
                unsigned char *name=mem_alloc(MAX_STR_LEN);
                unsigned char *value=tmp;
                unsigned char *vvv;
                if(fgets(tmp,MAX_STR_LEN,f)){
                        /* Very ugly realization of option string parsing --karpov */
                        sscanf(tmp,"%s",name);

                        while(*value!='"')
                                value++;
                        value++;

                        vvv=value;
                        while((*vvv!='"')||
                              (*vvv=='"' &&
                               *(vvv-1)=='\')) vvv++;
                        *vvv='';
                        options_set(name,value);
                }
                mem_free(tmp);
                mem_free(name);
        }
        fclose(f);

        return;

load_failure:
        /* internal("Can't load options!n"); */
}

and

void init_options()
{
        register_options();
        load_options();
}

I'm a bit of a novice when it comes to writing any code other than bash scripts.


"To be a Spartan is to be a philosopher much more than to be an athlete."
Plato, the <i>Protagoras</i>, 342e-343a

Offline

Board footer

Powered by FluxBB