Bug 54001 - [PATCH] fix for linux-3.x detection
Summary: [PATCH] fix for linux-3.x detection
Status: CLOSED FIXED
Alias: None
Product: APR
Classification: Unclassified
Component: APR (show other bugs)
Version: HEAD
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords: FixedInTrunk
Depends on:
Blocks:
 
Reported: 2012-10-14 08:36 UTC by Gilles Espinasse
Modified: 2014-01-21 12:59 UTC (History)
0 users



Attachments
patch against svn tree (645 bytes, application/x-download)
2012-10-14 08:36 UTC, Gilles Espinasse
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gilles Espinasse 2012-10-14 08:36:55 UTC
Created attachment 29473 [details]
patch against svn tree

include/apr_general.h use
#if defined(CRAY) || (defined(__arm) && !defined(LINUX))
#ifdef __STDC__
#define APR_OFFSET(p_type,field) _Offsetof(p_type,field)
#else
#ifdef CRAY2
#define APR_OFFSET(p_type,field) \
        (sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))

#else /* !CRAY2 */

#define APR_OFFSET(p_type,field) ((unsigned int)&(((p_type)NULL)->field))

#endif /* !CRAY2 */
#endif /* __STDC__ */
#else /* ! (CRAY || __arm) */

apr_hints.m4 has
    *-linux*)
        case `uname -r` in
	    2.* )  APR_ADDTO(CPPFLAGS, [-DLINUX=2])
	           ;;
	    1.* )  APR_ADDTO(CPPFLAGS, [-DLINUX=1])
	           ;;
	    * )
	           ;;
        esac

So when `uname -r` start with 3 on arm, LINUX is not defined

I would suggest this change as the value assigned to LINUX value is never used

Index: build/apr_hints.m4
===================================================================
--- build/apr_hints.m4	(révision 1397958)
+++ build/apr_hints.m4	(copie de travail)
@@ -119,15 +119,7 @@
 	APR_ADDTO(CPPFLAGS, [-DHPUX -D_REENTRANT])
 	;;
     *-linux*)
-        case `uname -r` in
-	    2.* )  APR_ADDTO(CPPFLAGS, [-DLINUX=2])
-	           ;;
-	    1.* )  APR_ADDTO(CPPFLAGS, [-DLINUX=1])
-	           ;;
-	    * )
-	           ;;
-        esac
-	APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_GNU_SOURCE])
+	APR_ADDTO(CPPFLAGS, [-DLINUX -D_REENTRANT -D_GNU_SOURCE])
 	;;
     *-lynx-lynxos)
 	APR_ADDTO(CPPFLAGS, [-D__NO_INCLUDE_WARN__ -DLYNXOS])
Comment 1 Stefan Fritsch 2012-10-19 18:16:26 UTC
Committed, thanks.

trunk: r1400200
1.5: r1400203
1.4: r1400205
Comment 2 Jeff Trawick 2014-01-21 12:59:28 UTC
fixed in 1.4.7 and later releases