Fwd: [Nut-upsdev] newhidups / Solaris 10 / APC RM1500

George A. Dowding gdowdin at cs.clemson.edu
Tue Mar 21 18:13:22 UTC 2006


Hi,

I can spend some time trying to get NUT working on Solaris 10 for at 
least 3 or 4 weeks. 

To get the  ball rolling, I tried to get usb to build automatically on 
Solaris 10 using Marty's guide.  This works.  But I will admit I am a 
novice when it comes to autoconf.  I am using the source checked out 
from subversion yesterday.


Arnaud Quette wrote:

>I just realised that Marty sent it privately...
>
>---------- Forwarded message ----------
>From: Marty Lee <marty at upstart-solutions.co.uk>
>Date: 7 mars 2006 10:49
>Subject: Re: [Nut-upsdev] newhidups / Solaris 10 / APC RM1500
>To: Arnaud Quette <aquette.dev at gmail.com>
>
>
>Arnaud,
>
>  
>
>>>I had to make some simple updates to get newhidups to compile on
>>>Solaris; is
>>>anyone interested in getting these rolled into NUT and for a text
>>>document on
>>>how to configure nut/newhidups/Solaris 10 ?
>>>      
>>>
>>I didn't had much time to continue on this point, so yes, any
>>(verbose) feedback is welcome...
>>
>>Arnaud
>>    
>>
>
>To get NUT 2.0.3 to compile on Solaris 10, I needed to do the following:
>
>1. u_int16_t is not defined in the build environment and libusb.h
>   uses uint_16_t too. I've added the following to libhid.h
>
>   #ifndef u_int16_t
>   typedef uint16_t u_int16_t;
>   #endif
>
>   #ifndef u_int8_t
>   typedef uint8_t u_int8_t;
>   #endif
>  
>

Did that.

>2. 'nanosleep' is in the 'rt' library, so I had to set up
>   LDFLAGS in drivers/Makefile to include '-lrt'
>
>   - this is obviously itching for a 'configure' test to make sure
>     that nanosleep is found somewhere appropriate
>
>3. On Solaris 10, the libusb stuff is in /usr/sfw by default, and
>   configure finds it ok. It doesn't add a -R/usr/sfw/lib, so at run
>   time, the libraries are no longer found.
>
>   By setting 'LIBUSB_LIBS = -R/usr/sfw/lib -L/usr/sfw/lib' in
>   drivers/Makedile things worked fine. Again, something that could
>   be added to configure as a Solaris specific.
>  
>
In configure.in added the following:

dnl Solaris 10
dnl     Needs the additional librt
dnl     Needs to find runtime libraries
case $target_os in
        solaris2.10 )
                echo Solaris 10 specific configuration for usb driver
                AC_SEARCH_LIBS(nanosleep,rt)
                LIBUSB_LIBS="-R/usr/sfw/lib $LIBUSB_LIBS"
                echo updating LIBUSB_LIBS $LIBUSB_LIBS
                ;;
esac

In drivers/Makefile.in, make a small change to LIBOBJ:

LIBOBJ  = $(LIBDEP) @NETLIBS@ @SERLIBS@

LIBOBJ  = $(LIBDEP) @NETLIBS@ @SERLIBS@ @LIBS@

>4. I had to add extra Makefile targes to drivers/Makefile, to ensure
>   things got compiled with the correct library flags:
>
>   mge-hid.o:
>       $(CC) $(CFLAGS) $(LIBUSB_CFLAGS) -c mge-hid.c
>
>   apc-hid.o:
>        $(CC) $(CFLAGS) $(LIBUSB_CFLAGS) -c apc-hid.c
>
>   belkin-hid.o:
>        $(CC) $(CFLAGS) $(LIBUSB_CFLAGS) -c belkin-hid.c
>
>  
>
The drivers seemed to compile ok without adding these targets after 
making the changes to the autoconf system.

>Hope this helps; if there are any 'test' builds available, let me
>know how to find them and I'll check things work ok. I've downloaded
>the CVS version, and from what I can tell, things seem the same as
>2.0.3
>
>Many regards
>
>marty
>
>
>--
>Marty Lee                         e: marty at upstart-solutions.co.uk
>Technical Director                v: +44 131 476 3775
>Upstart Solutions Ltd             f: +44 871 433 8922
>Scotland, UK                      w: http://www.upstart-solutions.co.uk
>
>
>
>
>--
>Linux / Unix Expert - MGE UPS SYSTEMS - R&D Dpt
>Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
>Debian Developer - http://people.debian.org/~aquette/
>OpenSource Developer - http://arnaud.quette.free.fr/
>
>_______________________________________________
>Nut-upsdev mailing list
>Nut-upsdev at lists.alioth.debian.org
>http://lists.alioth.debian.org/mailman/listinfo/nut-upsdev
>
>
>
>  
>


-- 
George A. Dowding
http://www.cs.clemson.edu/~gdowdin
112 McAdams




More information about the Nut-upsdev mailing list