summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derek.foreman@collabora.co.uk>2011-05-13 15:52:42 (GMT)
committerDerek Foreman <derek.foreman@collabora.co.uk>2011-08-30 21:32:37 (GMT)
commita19c4078aedb00e2b87fc504dc1624a230f30936 (patch)
treec011950bf34515601aae09780ec5534ae190e092
parent5e14de02b323d207151429d37f006ec30bbf7783 (diff)
downloadlibgcrypt-a19c4078aedb00e2b87fc504dc1624a230f30936.tar.gz
libgcrypt-a19c4078aedb00e2b87fc504dc1624a230f30936.tar.xz
Support building on AndroidHEADmaster
-rw-r--r--.gitignore1
-rw-r--r--Android.mk41
-rw-r--r--cipher/Makefile.am8
-rw-r--r--compat/Makefile.am8
-rwxr-xr-xconfig.sub9
-rw-r--r--m4/gpg-error.m456
-rw-r--r--mpi/Makefile.am9
-rw-r--r--random/Makefile.am8
-rw-r--r--random/rndunix.c5
-rw-r--r--src/Makefile.am10
10 files changed, 103 insertions, 52 deletions
diff --git a/.gitignore b/.gitignore
index ec7f8bb..d39b64d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -81,3 +81,4 @@ tests/rsacvt
tests/t-mpi-bit
tests/tsexp
tests/version
+Android.mk
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..638b8a4
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,41 @@
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+GCRYPT_BUILT_SOURCES := \
+ src/Android.mk \
+ mpi/Android.mk \
+ cipher/Android.mk \
+ random/Android.mk \
+ compat/Android.mk
+
+gcrypt-configure-real:
+ cd $(GCRYPT_TOP) ; \
+ $(GCRYPT_TOP)/autogen.sh && \
+ CC="$(CONFIGURE_CC)" \
+ CFLAGS="$(CONFIGURE_CFLAGS) -I$(GPG_ERROR_TOP)/src" \
+ LD=$(TARGET_LD) \
+ LDFLAGS="$(CONFIGURE_LDFLAGS)" \
+ CPP=$(CONFIGURE_CPP) \
+ CPPFLAGS="$(CONFIGURE_CPPFLAGS)" \
+ PKG_CONFIG_LIBDIR=$(CONFIGURE_PKG_CONFIG_LIBDIR) \
+ PKG_CONFIG_TOP_BUILD_DIR=$(PKG_CONFIG_TOP_BUILD_DIR) \
+ $(GCRYPT_TOP)/configure --host=arm-linux-androideabi \
+ --disable-Werror && \
+ for file in $(GCRYPT_BUILT_SOURCES); do \
+ rm -f $$file && \
+ make -C $$(dirname $$file) $$(basename $$file) ; \
+ done
+
+gcrypt-configure: gcrypt-configure-real
+
+.PHONY: gcrypt-configure
+
+CONFIGURE_TARGETS += gcrypt-configure
+
+#include all the subdirs...
+-include $(GCRYPT_TOP)/src/Android.mk
+-include $(GCRYPT_TOP)/mpi/Android.mk
+-include $(GCRYPT_TOP)/cipher/Android.mk
+-include $(GCRYPT_TOP)/random/Android.mk
+-include $(GCRYPT_TOP)/compat/Android.mk
diff --git a/cipher/Makefile.am b/cipher/Makefile.am
index cbeace8..95622c8 100644
--- a/cipher/Makefile.am
+++ b/cipher/Makefile.am
@@ -80,3 +80,11 @@ tiger.o: $(srcdir)/tiger.c
tiger.lo: $(srcdir)/tiger.c
`echo $(LTCOMPILE) -c $(srcdir)/tiger.c | $(o_flag_munging) `
+
+Android.mk: Makefile.am
+ androgenizer -:PROJECT gcrypt -:STATIC cipher -:TAGS eng debug \
+ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
+ -:SOURCES $(libcipher_la_SOURCES) $(EXTRA_libcipher_la_SOURCES) \
+ -:CFLAGS $(INCLUDES) $(DEFAULT_INCLUDES) $(DEFS) $(CFLAGS) $(AM_CFLAGS) \
+ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \
+ > $@
diff --git a/compat/Makefile.am b/compat/Makefile.am
index f0ddf34..a4797e6 100644
--- a/compat/Makefile.am
+++ b/compat/Makefile.am
@@ -46,3 +46,11 @@ libcompat_la_LIBADD = @LTLIBOBJS@
# getpid.c
# clock.c
#
+
+Android.mk: Makefile.am
+ androgenizer -:PROJECT gcrypt -:STATIC compat -:TAGS eng debug \
+ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
+ -:SOURCES $(libcompat_la_SOURCES) \
+ -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \
+ > $@
diff --git a/config.sub b/config.sub
index f9fcdc8..8a6b268 100755
--- a/config.sub
+++ b/config.sub
@@ -1526,6 +1526,15 @@ case $basic_machine in
tic6x-*)
os=-coff
;;
+ tic54x-*)
+ os=-coff
+ ;;
+ tic55x-*)
+ os=-coff
+ ;;
+ tic6x-*)
+ os=-coff
+ ;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
diff --git a/m4/gpg-error.m4 b/m4/gpg-error.m4
index 8d82925..984ea04 100644
--- a/m4/gpg-error.m4
+++ b/m4/gpg-error.m4
@@ -24,56 +24,8 @@ AC_DEFUN([AM_PATH_GPG_ERROR],
fi
fi
- AC_PATH_TOOL(GPG_ERROR_CONFIG, gpg-error-config, no)
- min_gpg_error_version=ifelse([$1], ,0.0,$1)
- AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version)
- ok=no
- if test "$GPG_ERROR_CONFIG" != "no" ; then
- req_major=`echo $min_gpg_error_version | \
- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
- req_minor=`echo $min_gpg_error_version | \
- sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
- gpg_error_config_version=`$GPG_ERROR_CONFIG $gpg_error_config_args --version`
- major=`echo $gpg_error_config_version | \
- sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
- minor=`echo $gpg_error_config_version | \
- sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
- if test "$major" -gt "$req_major"; then
- ok=yes
- else
- if test "$major" -eq "$req_major"; then
- if test "$minor" -ge "$req_minor"; then
- ok=yes
- fi
- fi
- fi
- fi
- if test $ok = yes; then
- GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --cflags`
- GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --libs`
- AC_MSG_RESULT([yes ($gpg_error_config_version)])
- ifelse([$2], , :, [$2])
- if test x"$host" != x ; then
- gpg_error_config_host=`$GPG_ERROR_CONFIG $gpg_error_config_args --host 2>/dev/null || echo none`
- if test x"$gpg_error_config_host" != xnone ; then
- if test x"$gpg_error_config_host" != x"$host" ; then
- AC_MSG_WARN([[
-***
-*** The config script $GPG_ERROR_CONFIG was
-*** built for $gpg_error_config_host and thus may not match the
-*** used host $host.
-*** You may want to use the configure option --with-gpg-error-prefix
-*** to specify a matching config script.
-***]])
- fi
- fi
- fi
- else
- GPG_ERROR_CFLAGS=""
- GPG_ERROR_LIBS=""
- AC_MSG_RESULT(no)
- ifelse([$3], , :, [$3])
- fi
- AC_SUBST(GPG_ERROR_CFLAGS)
- AC_SUBST(GPG_ERROR_LIBS)
+ PKG_CHECK_MODULES(GPG_ERROR, [gpg-error >= 1.8], [ok=yes], [
+ AC_MSG_ERROR([libgpg-error not found])])
+# AC_SUBST(GPG_ERROR_CFLAGS)
+# AC_SUBST(GPG_ERROR_LIBS)
])
diff --git a/mpi/Makefile.am b/mpi/Makefile.am
index e900539..440e976 100644
--- a/mpi/Makefile.am
+++ b/mpi/Makefile.am
@@ -175,3 +175,12 @@ libmpi_la_SOURCES = longlong.h \
mpih-mul.c \
mpiutil.c \
ec.c
+
+Android.mk: Makefile.am
+ androgenizer -:PROJECT gcrypt -:STATIC mpi -:TAGS eng debug \
+ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
+ -:SOURCES $(libmpi_la_SOURCES) $(nodist_libmpi_la_SOURCES) \
+ -:CFLAGS $(INCLUDES) $(DEFAULT_INCLUDES) $(DEFS) $(CFLAGS) $(AM_CFLAGS) \
+ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \
+ -:PASSTHROUGH LOCAL_ARM_MODE:=arm \
+ > $@
diff --git a/random/Makefile.am b/random/Makefile.am
index 603226d..340dfc1 100644
--- a/random/Makefile.am
+++ b/random/Makefile.am
@@ -48,3 +48,11 @@ rndegd.c \
rndunix.c \
rndw32.c \
rndw32ce.c
+
+Android.mk: Makefile.am
+ androgenizer -:PROJECT gcrypt -:STATIC random -:TAGS eng debug \
+ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
+ -:SOURCES $(librandom_la_SOURCES) rndlinux.c \
+ -:CFLAGS $(INCLUDES) $(DEFAULT_INCLUDES) $(DEFS) $(CFLAGS) $(AM_CFLAGS) \
+ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \
+ > $@
diff --git a/random/rndunix.c b/random/rndunix.c
index cc5eb14..4254c27 100644
--- a/random/rndunix.c
+++ b/random/rndunix.c
@@ -114,9 +114,14 @@
#include <sys/select.h>
#endif /* _AIX */
#ifndef __QNX__
+#ifdef __BIONIC__
+#include <linux/shm.h>
+#include <signal.h>
+#else
#include <sys/shm.h>
#include <signal.h>
#include <sys/signal.h>
+#endif
#endif /* __QNX__ */
#include <sys/stat.h>
#include <sys/types.h> /* Verschiedene komische Typen */
diff --git a/src/Makefile.am b/src/Makefile.am
index 9168022..01459e3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -129,6 +129,16 @@ gcryptrnd_LDADD = libgcrypt.la $(GPG_ERROR_LIBS) $(PTH_LIBS)
getrandom_SOURCES = getrandom.c
endif USE_RANDOM_DAEMON
+Android.mk: Makefile.am
+ androgenizer -:PROJECT gcrypt -:SHARED gcrypt -:TAGS eng debug \
+ -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
+ -:SOURCES $(libgcrypt_la_SOURCES) \
+ -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(libgcrypt_la_CFLAGS) \
+ -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) $(libgcrypt_la_CPPFLAGS) \
+ -:LDFLAGS $(libgcrypt_la_LIBADD) \
+ -:LIBFILTER_STATIC mpi cipher random compat \
+ > $@
install-data-local: install-def-file