xref: /OK3568_Linux_fs/buildroot/package/beecrypt/0002-build-system.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1Fix build with BR2_ENABLE_DEBUG=yes, no need for expert mode anymore
2
3Otherwise configure issues this error message:
4configure: error: --enable-debug cannot be used in conjunction with --enable-expert-mode
5
6Downloaded from Gentoo:
7http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-libs/beecrypt/files/beecrypt-4.2.1-build-system.patch?revision=1.2&view=markup
8
9This patch also removes the hard-coded CFLAGS provided by beecrypt in favour
10of the CFLAGS provided by buildroot.
11
12Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
13
14--- beecrypt-4.2.1/configure.ac
15+++ beecrypt-4.2.1/configure.ac
16@@ -11,7 +11,7 @@
17
18 # Checks for package options
19 AC_ARG_ENABLE(expert-mode, [  --enable-expert-mode      follow user-defined CFLAGS settings [[default=no]]],[
20-  ac_enable_expert_mode=yes
21+  ac_enable_expert_mode=$enableval
22   ],[
23   if test "X$CFLAGS" != "X"; then
24     echo "enabling expert mode"
25@@ -25,7 +25,7 @@
26   if test "$ac_enable_expert_mode" = yes; then
27     AC_MSG_ERROR([--enable-debug cannot be used in conjunction with --enable-expert-mode])
28   fi
29-  ac_enable_debug=yes
30+  ac_enable_debug=$enableval
31   ],[
32   ac_enable_debug=no
33   ])
34@@ -456,7 +456,7 @@
35       ac_cv_python_include="-I`$PYTHON -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_inc()'`"
36     ])
37     AC_CACHE_CHECK([where to install python libraries], ac_cv_python_libdir, [
38-      ac_cv_python_libdir=`$PYTHON -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib()'`
39+      ac_cv_python_libdir=`$PYTHON -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_lib(1, 0)'`
40     ])
41   fi
42 fi
43--- beecrypt-4.2.1/acinclude.m4
44+++ beecrypt-4.2.1/acinclude.m4
45@@ -498,15 +498,6 @@ AC_DEFUN([BEE_GNU_CC],[
46     AC_SUBST(OPENMP_LIBS,"-lgomp")
47   fi
48   case $bc_target_arch in
49-  x86_64 | athlon64 | athlon-fx | k8 | opteron | em64t | nocona)
50-    CC="$CC -m64"
51-    ;;
52-  i[[3456]]86 | \
53-  pentium* | \
54-  athlon*)
55-    CC="$CC -m32"
56-    CCAS="$CCAS -m32"
57-    ;;
58   ia64)
59     case $target_os in
60     # HP/UX on Itanium needs to be told that a long is 64-bit!
61@@ -525,17 +516,8 @@ AC_DEFUN([BEE_GNU_CC],[
62     aix*)
63       CC="$CC -maix64"
64       ;;
65-    linux*)
66-      CC="$CC -m64"
67-      ;;
68     esac
69     ;;
70-  sparc | sparcv8*)
71-    CC="$CC -m32"
72-    ;;
73-  sparc64 | sparcv9*)
74-    CC="$CC -m64"
75-    ;;
76   esac
77   # Certain platforms needs special flags for multi-threaded code
78   if test "$ac_enable_threads" = yes; then
79@@ -646,14 +646,6 @@ dnl  BEE_GNU_CXX
80 AC_DEFUN([BEE_GNU_CXX],[
81   AC_REQUIRE([AC_PROG_CXX])
82   case $bc_target_arch in
83-  x86_64 | athlon64 | athlon-fx | k8 | opteron | em64t | nocona | core2)
84-    CXX="$CXX -m64"
85-    ;;
86-  i[[3456]]86 | \
87-  pentium* | \
88-  athlon*)
89-    CXX="$CXX -m32"
90-    ;;
91   ia64)
92     case $target_os in
93     # HP/UX on Itanium needs to be told that a long is 64-bit!
94@@ -672,17 +664,8 @@ AC_DEFUN([BEE_GNU_CXX],[
95     aix*)
96       CXX="$CXX -maix64"
97       ;;
98-    linux*)
99-      CXX="$CXX -m64"
100-      ;;
101     esac
102     ;;
103-  sparc | sparcv8*)
104-    CXX="$CXX -m32"
105-    ;;
106-  sparc64 | sparcv9*)
107-    CXX="$CXX -m64"
108-    ;;
109   esac
110   # Certain platforms needs special flags for multi-threaded code
111   if test "$ac_enable_threads" = yes; then
112--- beecrypt-4.2.1/java/Makefile.am
113+++ beecrypt-4.2.1/java/Makefile.am
114@@ -26,7 +26,7 @@
115
116 INCLUDES = -I$(top_srcdir)/include
117
118-libaltdir=$(prefix)/lib@LIBALT@
119+libaltdir=$(libdir)
120
121 libalt_LTLIBRARIES = libbeecrypt_java.la
122
123--- beecrypt-4.2.1/acinclude.m4
124+++ beecrypt-4.2.1/acinclude.m4
125@@ -1589,20 +1589,5 @@
126   AC_SUBST(TYPEDEF_BC_THREADID_T,$bc_typedef_bc_threadid_t)
127   ])
128-
129-AH_BOTTOM([
130-#if ENABLE_THREADS
131-# ifndef _REENTRANT
132-#  define _REENTRANT
133-# endif
134-# if LINUX
135-#  define _LIBC_REENTRANT
136-# endif
137-#else
138-# ifdef _REENTRANT
139-#  undef _REENTRANT
140-# endif
141-#endif
142-])
143
144
145 dnl  BEE_THREAD_LOCAL_STORAGE
146@@ -1623,7 +1609,5 @@
147   ])
148
149 AH_BOTTOM([
150-#if !ENABLE_THREAD_LOCAL_STORAGE
151-# define __thread
152-#endif
153+#include "config.threads.h"
154 ])
155--- beecrypt-4.2.1/config.threads.h
156+++ beecrypt-4.2.1/config.threads.h
157@@ -0,0 +1,16 @@
158+#if ENABLE_THREADS
159+# ifndef _REENTRANT
160+#  define _REENTRANT
161+# endif
162+# if LINUX
163+#  define _LIBC_REENTRANT
164+# endif
165+#else
166+# ifdef _REENTRANT
167+#  undef _REENTRANT
168+# endif
169+#endif
170+
171+#if !ENABLE_THREAD_LOCAL_STORAGE
172+# define __thread
173+#endif
174