Compilation problem and solution on Solaris 2.7

Jean-Francois Stenuit lonely at skynet.be
Sat Apr 6 01:00:05 EST 2002


To whoever it may help,

My flavor of Solaris 2.7 was not able to compile rsync 2.5.5 with the
vanilla "./configure; make".

Three functions where missing : inet_ntop, inet_pton, inet_addr

There are replacement inet_ntop and inet_pton in the distribution tree, so
it's easy to change the Makefile and have them compiled and included by a
simple "make". However, the inet_addr is missing on the system, so I had
to write a replacement.

Here is the (very simple) replacement code for inet_addr :

#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netinet/in.h>

unsigned long int inet_addr(const char *cp)
{
        struct in_addr inp;

        if (inet_aton(cp,&inp) == 0) {
                return -1;
        } else {
                return ntohl((unsigned long int)inp.s_addr);
        }
}

Copy this code in a new file named 'inet_addr.c' in the 'lib' directory,
add 'lib/inet_ntop.o lib/inet_pton.o lib/inet_addr.o' in the 'LIBOBJ='
line of the Makefile, and everything will be OK.

Hope this helps,

-- 
 |--- Jean-Francois "Jef" Stenuit, Network Manager
 |------ BELGACOM-Skynet NV/SA, Carlistraat 2, B-1140 Brussels
 |--------- Phone : (32)(2) 706-1311, Fax : (32)(2) 706-1150

**** DISCLAIMER ****
"This e-mail is not intended to create or affect any contractual
arrangements between the parties. The content of this e-mail represent
the opinion of its author and does not bind its employer in any way.
Any use of the information contained herein by persons other than the
designated recipient(s) is prohibited."





More information about the rsync mailing list