axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Johnson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AXIS2C-1525) Axis2/C 1.6.0 does not build out-of-the-box on MacOS X 10.6.6 - Patch provided
Date Tue, 13 Nov 2012 19:44:12 GMT

    [ https://issues.apache.org/jira/browse/AXIS2C-1525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496478#comment-13496478
] 

Chris Johnson commented on AXIS2C-1525:
---------------------------------------

I can confirm that -Wno-long-double causes fatal compile errors on MacOSX 10.8 and FreeBSD
9 as well.  The GCC project deprecated -Wno-long-double long time ago; although I have not
been able to pin the date down, it looks like it was around 2009.

util/src/platforms/unix/uuid_gen_unix.c has some half-finished code as well.  It does conditional
compiles of various standard C include files using the #define macro HAVE_GETIFADDRS and it
should be using HAVE_IFADDRS_H, to correctly follow conventions already in use by the rest
of the code and generated by automake/etc.   However, util/configure.ac also needs to be changed
(or the equivalent) to set this constant, perhaps with AC_CHECK_HEADERS([ifaddrs.h]...).

I can provide diff patches from my Git repo if you want.
                
> Axis2/C 1.6.0 does not build out-of-the-box on MacOS X 10.6.6 - Patch provided
> ------------------------------------------------------------------------------
>
>                 Key: AXIS2C-1525
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-1525
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: build system (Unix/Linux)
>    Affects Versions: 1.6.0
>         Environment: MacOS X 10.6.6 - Intel x86/64 architecture
>            Reporter: Jonathan Leffler
>         Attachments: axis2c-src-1.6.0-MacOSX-10.6.6.patch, axis2c-src-1.6.0-MacOSX-10.6.6.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Extracting Axis2/C from axis2c-src-1.6.0.tar.gz and building on MacOS X 10.6.6 does not
work with some adjustments.
> (1) The build in utils uses unknown GCC option -Wno-long-double (configure.ac).
> (2) The header util/include/platforms/unix/axutil_unix.h has an unusual declaration for
usleep() that breaks on MacOS X.
> (3) The source file util/src/dir_handler.c has some code to handle the non-POSIX-compliant
MacOS X specification of scandir(), but it is incomplete at best.
> This patch - available by email on request - fixes the problems for me.  I've demonstrated
the source code changes; I have problems with rebuilding the libtool after modifying configure.ac,
which I assume are related to the libtool available to me.  Manually editing the dozen or
so Makefiles containing -Wno-long-double allows the build to proceed smoothly.
> --- axis2c-src-1.6.0/util/src/dir_handler.c	2009-04-05 21:49:04.000000000 -0700
> +++ axis2c-src-1.6.0-mac/util/src/dir_handler.c	2011-01-07 16:01:28.000000000 -0800
> @@ -28,20 +28,28 @@
>  #include <minizip/axis2_archive_extract.h>
>  #endif
>  
> +/*
> + * POSIX 1003.1-2008 requires:
> + * int alphasort(const struct dirent **d1, const struct dirent **d2);
> + * int scandir(const char *dir, struct dirent ***namelist,
> + *        int (*sel)(const struct dirent *),
> + *        int (*compar)(const struct dirent **, const struct dirent **));
> + * On MacOS X (10.6.6 and earlier), the 'sel' callback takes a non-const
> + * 'struct dirent *'.  Other platforms are more strictly POSIX
> + * compliant.  FILE_SELECT_ARGTYPE encapsulates this difference.
> + */
> +#ifdef IS_MACOSX
> +#define FILE_SELECT_ARGTYPE struct dirent
> +#else
> +#define FILE_SELECT_ARGTYPE const struct dirent
> +#endif
>  
>  extern int AXIS2_ALPHASORT(
>      );
> -#ifdef IS_MACOSX
> -int dir_select(
> -    struct dirent *entry);
> -int file_select(
> -    const struct dirent *entry);
> -#else
>  int dir_select(
> -    const struct dirent *entry);
> +    FILE_SELECT_ARGTYPE *entry);
>  int file_select(
> -    const struct dirent *entry); 
> -#endif
> +    FILE_SELECT_ARGTYPE *entry);
>  
>  /**
>   * List the dll files in the given service or module folder path
> @@ -323,14 +331,8 @@
>  
>  int
>  file_select(
> -    const struct dirent *entry)
> +    FILE_SELECT_ARGTYPE *entry)
>  {
> -
> -	#ifdef IS_MACOSX
> -		int	file_select(struct dirent *entry);
> -	#else
> - 		int file_select(const struct dirent *entry);
> -	#endif 
>      /** FIXME:
>        * This block of code has been sitting here doing nothing.
>        * I have made the existing logic use this code portion.
> @@ -353,15 +355,9 @@
>          return (AXIS2_FALSE);
>  }
>  
> -#ifdef IS_MACOSX
>  int
>  dir_select(
> -    struct dirent *entry)
> -#else
> -int
> -dir_select(
> -    const struct dirent *entry)
> -#endif
> +    FILE_SELECT_ARGTYPE *entry)
>  {
>      struct stat stat_p;
>  
> --- axis2c-src-1.6.0/util/include/platforms/unix/axutil_unix.h	2009-04-05 21:48:47.000000000
-0700
> +++ axis2c-src-1.6.0-mac/util/include/platforms/unix/axutil_unix.h	2011-01-07 15:40:52.000000000
-0800
> @@ -122,7 +122,9 @@
>      /* for file access handling */
>  #ifdef HAVE_UNISTD_H
>  #include <unistd.h>
> +#ifndef IS_MACOSX
>  extern int usleep (__useconds_t __useconds);
> +#endif                          /* IS_MACOSX */
>  #endif                          /*HAVE_UNISTD_H */
>  
>      /* network handling */
> --- axis2c-src-1.6.0/util/configure.ac	2009-04-05 21:49:04.000000000 -0700
> +++ axis2c-src-1.6.0-mac/util/configure.ac	2011-01-07 16:51:36.000000000 -0800
> @@ -135,11 +135,24 @@
>    ;;
>  darwin*)
>    darwin=yes
> -  if test x"$GCC" = xyes
> -  then
> -    CFLAGS="$CFLAGS -Wno-long-double"
> -    CXXFLAGS="$CXXFLAGS -Wno-long-double"
> -  fi
> +  # GCC option -Wno-long-double is neither supported by GCC 4.2.1 as
> +  # distributed by Apple (with Xcode 3.2.5) nor by GCC 4.5.2, with
> +  # builds on MacOS X 10.6.[56].  Since Linux versions of GCC 4.1.2
> +  # do not support the option either, it probably belongs to a time long
> +  # past (though there was a faintly related item for GCC 4.6 dated
> +  # 2011-01-04 at http://gcc.gnu.org/ml/gcc-bugs/2011-01/msg00258.html).
> +  # I could find no mention of adding or removing -Wno-long-double in
> +  # GCC change notes back to v3.1.  It may have been a special option
> +  # added by Apple, but I've not located any information to confirm
> +  # that, either.  Since the axis2c-src-1.6.0.MacOSX-10.5.5.patch
> +  # available on the Internet did not fix this, the option may have been
> +  # valid for the Leopard (10.5.x) version of MacOS X.  If so, this test
> +  # needs to be made more sensitive, somehow.
> +  #if test x"$GCC" = xyes
> +  #then
> +  #  CFLAGS="$CFLAGS -Wno-long-double"
> +  #  CXXFLAGS="$CXXFLAGS -Wno-long-double"
> +  #fi
>    ;;
>  solaris*)
>    solaris=yes
> It is not clear if the FIXME block in function file_select() in dir_handler.c belongs
with the code I removed or relates to something following.  I think it could be removed too,
but did not risk it.
> I note that I found a patch file axis2c-src-1.6.0-MacOSX-10.5.5.patch on the internet.
 It has loosely equivalent fixes for the source code problems - more hack-like and less engineered
IMNSHO - but does not address the configure.ac issue at all.  I'm not sure what that means
about -Wno-long-double and MacOS X Leopard (10.5.x) compared with Snow Leopard (10.6.x).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: c-dev-help@axis.apache.org


Mime
View raw message