aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Cook <bcook@openbsd.org>2014-07-17 21:20:34 -0500
committerBrent Cook <bcook@openbsd.org>2014-07-18 09:19:17 -0500
commitd697fdb4afb08bb46027a5efd1f8040bfdb8380e (patch)
tree9308884ee7206da1acb2a534e26c10f3ef308edd
parent0bc4bdde5f8140b23af15482000d733dfe700968 (diff)
downloadportable-d697fdb4afb08bb46027a5efd1f8040bfdb8380e.tar.gz
portable-d697fdb4afb08bb46027a5efd1f8040bfdb8380e.tar.bz2
portable-d697fdb4afb08bb46027a5efd1f8040bfdb8380e.zip
initial underpinnings for mingw/cross compilation support
Use canonical host rather than target so that this works: CC=i686-w64-mingw32-gcc ./configure --host=i686-w64-mingw32 Conditionally compile Linux issetugid compatibility function ok beck@
-rw-r--r--configure.ac.tpl24
-rw-r--r--crypto/Makefile.am.tpl11
2 files changed, 22 insertions, 13 deletions
diff --git a/configure.ac.tpl b/configure.ac.tpl
index 8accb4d..cbd62a0 100644
--- a/configure.ac.tpl
+++ b/configure.ac.tpl
@@ -1,5 +1,5 @@
1AC_INIT([libressl], [VERSION]) 1AC_INIT([libressl], [VERSION])
2AC_CANONICAL_TARGET 2AC_CANONICAL_HOST
3AM_INIT_AUTOMAKE([subdir-objects]) 3AM_INIT_AUTOMAKE([subdir-objects])
4AC_CONFIG_MACRO_DIR([m4]) 4AC_CONFIG_MACRO_DIR([m4])
5 5
@@ -8,29 +8,33 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
8AC_SUBST([USER_CFLAGS], "-O2 $CFLAGS") 8AC_SUBST([USER_CFLAGS], "-O2 $CFLAGS")
9CFLAGS="$CFLAGS -Wall -std=c99 -g" 9CFLAGS="$CFLAGS -Wall -std=c99 -g"
10 10
11case $target_os in 11case $host_os in
12 *darwin*) 12 *darwin*)
13 TARGET_OS=darwin; 13 HOST_OS=darwin;
14 LDFLAGS="$LDFLAGS -Qunused-arguments" 14 LDFLAGS="$LDFLAGS -Qunused-arguments"
15 ;; 15 ;;
16 *linux*) 16 *linux*)
17 TARGET_OS=linux; 17 HOST_OS=linux;
18 CFLAGS="$CFLAGS -D_BSD_SOURCE -D_POSIX_SOURCE -D_GNU_SOURCE" 18 CFLAGS="$CFLAGS -D_BSD_SOURCE -D_POSIX_SOURCE -D_GNU_SOURCE"
19 ;; 19 ;;
20 *solaris*) 20 *solaris*)
21 TARGET_OS=solaris; 21 HOST_OS=solaris;
22 CFLAGS="$CFLAGS -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 -DBSD_COMP" 22 CFLAGS="$CFLAGS -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 -DBSD_COMP"
23 AC_SUBST([PLATFORM_LDADD], ['-lnsl -lsocket']) 23 AC_SUBST([PLATFORM_LDADD], ['-lnsl -lsocket'])
24 ;; 24 ;;
25 *openbsd*) 25 *openbsd*)
26 AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD gcc has bounded]) 26 AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD gcc has bounded])
27 ;; 27 ;;
28 *mingw*)
29 HOST_OS=win32
30 ;;
28 *) ;; 31 *) ;;
29esac 32esac
30 33
31AM_CONDITIONAL(TARGET_DARWIN, test x$TARGET_OS = xdarwin) 34AM_CONDITIONAL(HOST_DARWIN, test x$HOST_OS = xdarwin)
32AM_CONDITIONAL(TARGET_LINUX, test x$TARGET_OS = xlinux) 35AM_CONDITIONAL(HOST_LINUX, test x$HOST_OS = xlinux)
33AM_CONDITIONAL(TARGET_SOLARIS, test x$TARGET_OS = xsolaris) 36AM_CONDITIONAL(HOST_SOLARIS, test x$HOST_OS = xsolaris)
37AM_CONDITIONAL(HOST_WIN, test x$HOST_OS = xwin)
34 38
35AC_CHECK_FUNC([clock_gettime],, 39AC_CHECK_FUNC([clock_gettime],,
36 [AC_SEARCH_LIBS([clock_gettime],[rt posix4])]) 40 [AC_SEARCH_LIBS([clock_gettime],[rt posix4])])
@@ -72,8 +76,8 @@ AM_CONDITIONAL(NO_ARC4RANDOM_BUF, test "x$NO_ARC4RANDOM_BUF" = "xyes")
72 76
73# overrides for arc4random_buf implementations with known issues 77# overrides for arc4random_buf implementations with known issues
74AM_CONDITIONAL(NO_ARC4RANDOM_BUF, 78AM_CONDITIONAL(NO_ARC4RANDOM_BUF,
75 test x$TARGET_OS = xdarwin \ 79 test x$HOST_OS = xdarwin \
76 -o x$TARGET_OS = xsolaris \ 80 -o x$HOST_OS = xsolaris \
77 -o x$NO_ARC4RANDOM_BUF = xyes) 81 -o x$NO_ARC4RANDOM_BUF = xyes)
78 82
79AC_CHECK_FUNC(getentropy,[AC_SEARCH_LIBS(write,, [NO_GETENTROPY=], 83AC_CHECK_FUNC(getentropy,[AC_SEARCH_LIBS(write,, [NO_GETENTROPY=],
diff --git a/crypto/Makefile.am.tpl b/crypto/Makefile.am.tpl
index 20c3495..d79a270 100644
--- a/crypto/Makefile.am.tpl
+++ b/crypto/Makefile.am.tpl
@@ -45,22 +45,27 @@ if NO_ARC4RANDOM_BUF
45libcompat_la_SOURCES += compat/arc4random.c 45libcompat_la_SOURCES += compat/arc4random.c
46 46
47if NO_GETENTROPY 47if NO_GETENTROPY
48if TARGET_LINUX 48if HOST_LINUX
49libcompat_la_SOURCES += compat/getentropy_linux.c 49libcompat_la_SOURCES += compat/getentropy_linux.c
50endif 50endif
51if TARGET_DARWIN 51if HOST_DARWIN
52libcompat_la_SOURCES += compat/getentropy_osx.c 52libcompat_la_SOURCES += compat/getentropy_osx.c
53endif 53endif
54if TARGET_SOLARIS 54if HOST_SOLARIS
55libcompat_la_SOURCES += compat/getentropy_solaris.c 55libcompat_la_SOURCES += compat/getentropy_solaris.c
56endif 56endif
57if HOST_WIN
58libcompat_la_SOURCES += compat/getentropy_win.c
59endif
57endif 60endif
58 61
59endif 62endif
60 63
61if NO_ISSETUGID 64if NO_ISSETUGID
65if HOST_LINUX
62libcompat_la_SOURCES += compat/issetugid_linux.c 66libcompat_la_SOURCES += compat/issetugid_linux.c
63endif 67endif
68endif
64 69
65noinst_HEADERS = des/ncbc_enc.c 70noinst_HEADERS = des/ncbc_enc.c
66noinst_HEADERS += compat/thread_private.h 71noinst_HEADERS += compat/thread_private.h