Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ClamAV: devel

Configure patch for OS X 10.5 Leopard

 

 

ClamAV devel RSS feed   Index | Next | Previous | View Threaded


markjallan at gmail

Feb 9, 2008, 8:15 AM

Post #1 of 2 (248 views)
Permalink
Configure patch for OS X 10.5 Leopard

Hi folks,

Here's a patch to allow ClamAV to configure properly on Mac OS X
10.5. The nidump tool was deprecated a long time ago and is no longer
included in 10.5 as netinfo doesn't exist any more. The dscl tool is
the preferred method from at least 10.3 onwards. Unfortunately I
don't have any machines with 10.2 on which I can test to see if it
works there too.

The patch is against the release version of ClamAV 0.92 and doesn't
check which Mac OS version is in use, I've simply replaced the nidump
call with the correct dscl call. FWIW, 10.2 is almost 6 years old now
so I doubt very much if anyone is still running it.

The second part of the patch delays endian checking until compile-time
to permit cross-compiling for PPC and i386 architectures within the
same binaries.

Mark

[~/Desktop/clamav_0.92] > diff -Naur configureOrig configure

--- configureOrig 2008-02-08 21:38:58.000000000 +0000
+++ configure 2008-02-08 21:53:43.000000000 +0000
@@ -25400,8 +25400,8 @@
then
{ echo "$as_me:$LINENO: checking for $clamav_user using netinfo" >&5
echo $ECHO_N "checking for $clamav_user using netinfo... $ECHO_C"
>&6; }
- clamavuser=`/usr/bin/nidump passwd . |grep ${clamav_user}`
- clamavgroup=`/usr/bin/nidump group . |grep ${clamav_group}`
+ clamavuser=`/usr/bin/dscl . -list /Users | grep ${clamav_user}`
+ clamavgroup=`/usr/bin/dscl . -list /Groups | grep $
{clamav_group}`
fi

if test "$use_yp" = "yes"
@@ -25827,7 +25827,7 @@
yes)

cat >>confdefs.h <<\_ACEOF
-#define WORDS_BIGENDIAN 1
+#define WORDS_BIGENDIAN (defined(__BIG_ENDIAN__) && __BIG_ENDIAN__)
_ACEOF
;;
no)
@@ -25843,13 +25843,13 @@
if test $ac_cv_c_bigendian = yes; then

cat >>confdefs.h <<\_ACEOF
-#define WORDS_BIGENDIAN 1
+#define WORDS_BIGENDIAN (defined(__BIG_ENDIAN__) && __BIG_ENDIAN__)
_ACEOF

else

cat >>confdefs.h <<\_ACEOF
-#define WORDS_BIGENDIAN 0
+#define WORDS_BIGENDIAN (defined(__BIG_ENDIAN__) && __BIG_ENDIAN__)
_ACEOF

fi


_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net


edwintorok at gmail

Feb 9, 2008, 11:54 PM

Post #2 of 2 (239 views)
Permalink
Re: Configure patch for OS X 10.5 Leopard [In reply to]

Mark Allan wrote:
> Hi folks,
>
> Here's a patch to allow ClamAV to configure properly on Mac OS X
> 10.5. The nidump tool was deprecated a long time ago and is no longer
> included in 10.5 as netinfo doesn't exist any more. The dscl tool is
> the preferred method from at least 10.3 onwards. Unfortunately I
> don't have any machines with 10.2 on which I can test to see if it
> works there too.
>
> The patch is against the release version of ClamAV 0.92 and doesn't
> check which Mac OS version is in use, I've simply replaced the nidump
> call with the correct dscl call. FWIW, 10.2 is almost 6 years old now
> so I doubt very much if anyone is still running it.
>

Thanks, but this is already in the SVN version:

Tue Jan 22 15:29:15 CET 2008 (tk)
---------------------------------
* configure: if available use dscl on Mac OS X (bb#753)

> The second part of the patch delays endian checking until compile-time
> to permit cross-compiling for PPC

If you are cross-compiling for PPC the AC_C_BIGENDIAN macro from
autoconf just works.

> and i386 architectures within the
> same binaries.
>

You mean Mac OSX Universal Binaries?
One solution would be to compile for PPC and i386 separately then glue
those 2 together, see:
http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix/compiling/chapter_4_section_3.html

There is also a check for FPU endianness, which can't be done using
preprocessor macros, and needs to be done during ./configure, so
I think that compiling 2 executables, one for each architecture is the
safest choice.

If you want to solve this in the AC_C_BIGENDIAN macro, please raise the
issue with the autoconf developers.

> Mark
> try to guess the endianness by grepping values into an object file
>
> [~/Desktop/clamav_0.92] > diff -Naur configureOrig configure
>
> --- configureOrig 2008-02-08 21:38:58.000000000 +0000
> +++ configure 2008-02-08 21:53:43.000000000 +0000
>

You should change configure.in, and not configure directly. When
autoconf is run it will regenerate configure from configure.in,
thus any changes to configure will be overwritten.

Best regards,
--Edwin
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net

ClamAV devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.