scripts/functions: Fix CT_ExtractGit function.
Change CT_ExtractGit so that it clones the repository, instead of just
symlinking it. After cloning, any given ref is checked out, or if no
ref is given, the HEAD of the repository is checked out.
This makes CT_Extract behave similar for git repositories as it does
for tarballs, so that it for example can be used for passing glibc-ports
as a git repository.
Signed-off-by: "Esben Haabendal" <esben.haabendal@prevas.dk>
[yann.morin.1998@anciens.enib.fr: fix incomplete var rename]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
1 Original patch from Gentoo.
3 -= BEGIN original header =-
4 -= END original header =-
6 diff -durN uClibc-0.9.30.orig/include/assert.h uClibc-0.9.30/include/assert.h
7 --- uClibc-0.9.30.orig/include/assert.h 2008-07-23 13:23:36.000000000 +0200
8 +++ uClibc-0.9.30/include/assert.h 2009-02-07 09:57:59.000000000 +0100
13 -#if defined __cplusplus && __GNUC_PREREQ (2,95)
14 +#if defined __cplusplus && __GNUC_PREREQ(2,95)
15 # define __ASSERT_VOID_CAST static_cast<void>
17 # define __ASSERT_VOID_CAST (void)
19 (__assert (__STRING(expr), __FILE__, __LINE__, \
20 __ASSERT_FUNCTION), 0)))
22 +/* Define some temporaries to workaround tinyx makedepend bug */
23 +#define __GNUC_PREREQ_2_6 __GNUC_PREREQ(2, 6)
24 +#define __GNUC_PREREQ_2_4 __GNUC_PREREQ(2, 4)
25 /* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
26 which contains the name of the function currently being defined.
27 This is broken in G++ before version 2.6.
28 C9x has a similar variable called __func__, but prefer the GCC one since
29 it demangles C++ function names. */
30 -# if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4)
31 +# if defined __cplusplus ? __GNUC_PREREQ_2_6 : __GNUC_PREREQ_2_4
32 # define __ASSERT_FUNCTION __PRETTY_FUNCTION__
34 # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
35 diff -durN uClibc-0.9.30.orig/include/complex.h uClibc-0.9.30/include/complex.h
36 --- uClibc-0.9.30.orig/include/complex.h 2008-10-03 16:24:28.000000000 +0200
37 +++ uClibc-0.9.30/include/complex.h 2009-02-07 09:57:59.000000000 +0100
39 /* We might need to add support for more compilers here. But since ISO
40 C99 is out hopefully all maintained compilers will soon provide the data
41 types `float complex' and `double complex'. */
42 -#if __GNUC_PREREQ (2, 7) && !__GNUC_PREREQ (2, 97)
43 +#if __GNUC_PREREQ(2, 7) && !__GNUC_PREREQ(2, 97)
44 # define _Complex __complex__
47 diff -durN uClibc-0.9.30.orig/include/features.h uClibc-0.9.30/include/features.h
48 --- uClibc-0.9.30.orig/include/features.h 2008-09-06 18:45:07.000000000 +0200
49 +++ uClibc-0.9.30/include/features.h 2009-02-07 09:57:59.000000000 +0100
52 /* Convenience macros to test the versions of glibc and gcc.
54 - #if __GNUC_PREREQ (2,8)
55 + #if __GNUC_PREREQ(2,8)
56 ... code requiring gcc 2.8 or later ...
58 Note - they won't work for gcc1 or glibc1, since the _MINOR macros
60 /* uClibc does not support _FORTIFY_SOURCE */
61 #undef _FORTIFY_SOURCE
62 #if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \
63 - && __GNUC_PREREQ (4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
64 + && __GNUC_PREREQ(4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0
65 # if _FORTIFY_SOURCE > 1
66 # define __USE_FORTIFY_LEVEL 2
69 #endif /* !ASSEMBLER */
71 /* Decide whether we can define 'extern inline' functions in headers. */
72 -#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
73 +#if __GNUC_PREREQ(2, 7) && defined __OPTIMIZE__ \
74 && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ \
75 && (defined __extern_inline || defined __GNUC_GNU_INLINE__)
76 # define __USE_EXTERN_INLINES 1
77 diff -durN uClibc-0.9.30.orig/include/tgmath.h uClibc-0.9.30/include/tgmath.h
78 --- uClibc-0.9.30.orig/include/tgmath.h 2008-10-03 16:24:28.000000000 +0200
79 +++ uClibc-0.9.30/include/tgmath.h 2009-02-07 09:57:59.000000000 +0100
81 do not try this for now and instead concentrate only on GNU CC. Once
82 we have more information support for other compilers might follow. */
84 -#if __GNUC_PREREQ (2, 7)
85 +#if __GNUC_PREREQ(2, 7)
87 # ifndef __UCLIBC_HAS_LONG_DOUBLE_MATH__
88 # define __tgml(fct) fct