cURL / Mailing Lists / curl-users / Single Mail

curl-users

Compiling curl on sunos4.1.4

From: Ron Zapp <rzapper_at_yahoo.com>
Date: Fri, 4 Feb 2000 12:48:00 -0800 (PST)

I downloaded curl 6.4, and had some trouble compiling it using
sparc-sun-sunos4.1.4. I did finally get it to compile, but
I had to make a few changes.

I did a ./configure and a make,
       -----------------------------------
% make
cd . && /tmp_mnt/home/user7/tmp2/curl-6.4/missing autoheader
WARNING: `autoheader' is missing on your system. You should only need it if
         you modified `acconfig.h' or `configure.in'. You might want
         to install the `Autoconf' and `GNU m4' packages. Grab them
         from any GNU archive site.
make all-recursive
make[1]: Entering directory `/tmp_mnt/home/user7/tmp2/curl-6.4'
Making all in lib
make[2]: Entering directory `/tmp_mnt/home/user7/tmp2/curl-6.4/lib'
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../src -I../include -g -O2 -c file.c
In file included from file.c:52:
setup.h:88: stdcheaders.h: No such file or directory
make[2]: *** [file.o] Error 1
make[2]: Leaving directory `/tmp_mnt/home/user7/tmp2/curl-6.4/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp_mnt/home/user7/tmp2/curl-6.4'
make: *** [all-recursive-am] Error 2
%

     -------------------------------
It appeared that the the make could not find "stdcheaders.h"
but it was looking in the wrong place. The file stdcheaders.h
was in curl-6.4/include/curl/ So I just copied the *.h files
into the curl-6.4/include directory and did another 'make'

This time I had a more serious problem when it got to the
src directory:

    --------------------------------
urlglob.c: In function `next_url':
urlglob.c:280: invalid operands to binary +
urlglob.c: In function `match_url':
urlglob.c:319: invalid operands to binary +

   ---------------------------------

The two problems were both due to a difference in how sprintf works
in version 4 of sunOS versus "SYSTEM V" (aka Solaris)
  (Here's a section of the 'man' page edited for clarity)

NAME
     sprintf - formatted output conversion

SYNOPSIS
     #include <stdio.h>

     char *sprintf(s, format [ , arg... ] )
     char *s, *format;

SYSTEM V SYNOPSIS
     The routines above are available as shown, except:

     int sprintf(s, format [ , arg... ] )
     char *s, *format;
sprintf() returns s.

SYSTEM V RETURN VALUES
     On success, sprintf() returns the number of characters
     transmitted, excluding the null character. On failure, it
     returns EOF.

     --------------------------------------

    So... what this means is that depending on what compiler you're running
    sprintf will either return a character pointer to 's' (pretty useless)
    or, it will return the number of characters copied (an integer).

    Obviously the latter is preferred, but for those of us running the old
    operating system (don't ask me why we're running it) We get the compile
    problem mentioned above. But there is a simple fix that should work
    for all systems. Just replace the existing code:

    buf += sprintf(buf, "%0*d", pat->content.NumRange.padlength,
                                pat->content.NumRange.ptr_n);

    with the following 2 lines of code:

    sprintf(buf, "%0*d", pat->content.NumRange.padlength,
                         pat->content.NumRange.ptr_n);

    buf += strlen(buf); /*Kludge for SunOS4.x */

     This fix is needed in line number 280 and a similar change
     in 319 of urlglob.c
 

     After that - the compile worked fine, and curl appears to work fine.
     Let me know if you would like me to email you a copy of the compiled
     version for other SunOS4.1.4 users to have.

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
Received on 2000-02-04