Revision | 07cbb4ebc408aa7161f3fb174d9fc1ef3795379a (tree) |
---|---|
Time | 2022-11-28 18:58:28 |
Author | phabrics <phabrics@phab...> |
Commiter | phabrics |
Changes to get compilation working on Mingw64.
@@ -34,7 +34,7 @@ dnl POSSIBILITY OF SUCH DAMAGE. | ||
34 | 34 | dnl Checks that we are given a good source directory. |
35 | 35 | AC_PREREQ([2.68]) |
36 | 36 | m4_include(version.m4) |
37 | -AC_INIT([tme], [0.12rc8]) | |
37 | +AC_INIT([tme], [0.12rc9]) | |
38 | 38 | AC_CONFIG_SRCDIR([ic/m68k/m68k-impl.h]) |
39 | 39 | AC_CONFIG_MACRO_DIR([m4]) |
40 | 40 | AC_CANONICAL_TARGET |
@@ -797,13 +797,14 @@ AM_PATH_GLIB_2_0([], [have_glib=$enable_glib], []) | ||
797 | 797 | dnl Checks for display type support |
798 | 798 | AM_PATH_GTK_3_0([], [have_gtk=$enable_gtk], []) |
799 | 799 | AM_PATH_SDL2([], [have_sdl=$enable_sdl], []) |
800 | +AM_CONDITIONAL([HAVE_SDL], [test "x${have_sdl}" = xyes]) | |
800 | 801 | PKG_CHECK_MODULES([RFB], [libvncclient libvncserver], [have_rfb=$enable_rfb], []) |
801 | 802 | |
802 | 803 | dnl Start the list of ethernet host support. |
803 | 804 | AM_CONDITIONAL([USE_TAP_WINDOWS], [test "x${enable_openvpn}" = xyes && test "x${have_tap_header}" = x && test "x${WIN32}" != x]) |
804 | 805 | |
805 | -if test "x${enable_openvpn}" = xyes && test "x${have_tap_header}" = xyes || test "x${WIN32}" != x; then | |
806 | - have_openvpn=yes | |
806 | +if test "x${have_tap_header}" = xyes || test "x${WIN32}" != x; then | |
807 | + have_openvpn=$enable_openvpn | |
807 | 808 | AC_DEFINE([OPENVPN_VERSION_RESOURCE], [PRODUCT_VERSION_RESOURCE], [Version in windows resource format]) |
808 | 809 | fi |
809 | 810 | AM_CONDITIONAL([HAVE_OPENVPN], [test "x${have_openvpn}" = xyes]) |
@@ -828,19 +829,21 @@ found_BPFVERSION | ||
828 | 829 | |
829 | 830 | for tme_host in $TME_HOST_TYPES; do |
830 | 831 | if eval test "x\$have_${tme_host}" = xyes; then |
831 | - TME_HOSTS="-dlopen \$(tme_host_${tme_host})/tme_host_${tme_host}.la ${TME_HOSTS}" | |
832 | - TME_HOSTS_DIRS="\$(tme_host_${tme_host}) ${TME_HOSTS_DIRS}" | |
832 | + TME_HOST_CFLAGS="\$(${tme_host^^}_CFLAGS) ${TME_HOST_CFLAGS}" | |
833 | + TME_HOST_LIBS="-dlopen \$(tme_host_${tme_host})/tme_host_${tme_host}.la ${TME_HOST_LIBS}" | |
834 | + TME_HOST_DIRS="\$(tme_host_${tme_host}) ${TME_HOST_DIRS}" | |
833 | 835 | fi |
834 | 836 | done |
835 | 837 | |
836 | 838 | dnl Checks for host support. |
837 | -AC_MSG_CHECKING([for host support types]) | |
839 | +AC_MSG_CHECKING([for enabled host types]) | |
838 | 840 | |
839 | 841 | dnl The list of ethernet host support is finished. |
840 | -AC_SUBST(TME_HOSTS) | |
841 | -AC_SUBST(TME_HOSTS_DIRS) | |
842 | +AC_SUBST(TME_HOST_CFLAGS) | |
843 | +AC_SUBST(TME_HOST_LIBS) | |
844 | +AC_SUBST(TME_HOST_DIRS) | |
842 | 845 | |
843 | -AC_MSG_RESULT($TME_HOSTS) | |
846 | +AC_MSG_RESULT($TME_HOST_DIRS) | |
844 | 847 | |
845 | 848 | AC_SYS_POSIX_TERMIOS |
846 | 849 |
@@ -880,8 +883,7 @@ AC_MSG_CHECKING([for available threading models]) | ||
880 | 883 | # specify whether preemptive thread support should be enabled & with what thread models |
881 | 884 | |
882 | 885 | AC_ARG_ENABLE(threads, |
883 | -[ --enable-threads=THRs Enable preemptive thread support utilizing the given threading models (compiled-in order of usage by platform availability: 'pthreads (or posix)','glib'). Defaults to 'yes', any available. Turn off threads with 'no' or --disable-threads; this will use setjmp/longjmp.], [tme_thread_types=${enableval}], | |
884 | -[tme_thread_types=sjlj]) | |
886 | +[ --enable-threads=THRs Enable preemptive thread support utilizing the given threading models (compiled-in order of usage by platform availability: 'pthreads (or posix)','glib'). Defaults to 'no'; this will use a singled thread with setjmp/longjmp or fibers on platforms that support them. Turn on threads with --enable-threads=<thr>; no value given is 'yes' which defaults to best threading model for platform.], [tme_thread_types=${enableval}], [enable_threads=no]) | |
885 | 887 | |
886 | 888 | if test "x${enable_threads}" = xyes; then |
887 | 889 | dnl Make brackets safe to use. |
@@ -899,13 +901,28 @@ if test "x${enable_threads}" = xyes; then | ||
899 | 901 | |
900 | 902 | dnl Make brackets the quote characters again. |
901 | 903 | changequote([, ])dnl |
904 | + recode=no | |
902 | 905 | fi |
903 | 906 | |
904 | 907 | if test "x${enable_threads}" = xno; then |
908 | + dnl Make brackets safe to use. | |
909 | + changequote(<<, >>)dnl | |
910 | + | |
911 | + dnl set the default threads based on platform | |
912 | + case "${host_os}" in | |
913 | + mingw* | msys* | cygwin*) | |
914 | + recode=i686 | |
915 | + ;; | |
916 | + *) | |
917 | + recode=yes | |
918 | + ;; | |
919 | + esac | |
920 | + | |
921 | + dnl Make brackets the quote characters again. | |
922 | + changequote([, ])dnl | |
905 | 923 | tme_thread_types=sjlj |
906 | 924 | fi |
907 | 925 | |
908 | -recode=no | |
909 | 926 | for tme_thread_type in ${tme_thread_types}; do |
910 | 927 | case "x${tme_thread_type}" in |
911 | 928 | xpthreads| xposix) CPPFLAGS="${CPPFLAGS-} -DTME_THREADS_POSIX" |
@@ -915,9 +932,6 @@ xglib) CPPFLAGS="${CPPFLAGS-} -DTME_THREADS_GLIB -DUSE_GLIB_TIME ${GLIB_CFLAGS | ||
915 | 932 | # LDFLAGS="${LDFLAGS-} ${GLIB_LIBS}" |
916 | 933 | ;; |
917 | 934 | xsjlj) CPPFLAGS="${CPPFLAGS-} -DTME_THREADS_SJLJ" |
918 | - if test "x${WIN32}" != "xyes"; | |
919 | - then recode=yes | |
920 | - fi | |
921 | 935 | ;; |
922 | 936 | esac |
923 | 937 | done |
@@ -950,16 +964,7 @@ changequote([, ])dnl | ||
950 | 964 | |
951 | 965 | AC_ARG_ENABLE(recode, |
952 | 966 | [ --enable-recode enable recode (dynamic binary translation) (default=if host supports)], |
953 | -[ ], [enable_recode=${recode}]) | |
954 | -if test "${recode_size_guest_max}" = 0; then | |
955 | - enable_recode=no | |
956 | - recode_size_guest_max=1 | |
957 | -fi | |
958 | -if test "x${enable_recode}" = xno; then | |
959 | - recode_hosts= | |
960 | -else | |
961 | - recode_hosts="mmap x86" | |
962 | -fi | |
967 | +[ ], [enable_recode=$recode]) | |
963 | 968 | |
964 | 969 | AC_MSG_CHECKING([for host recode support]) |
965 | 970 |
@@ -968,20 +973,36 @@ changequote(<<, >>)dnl | ||
968 | 973 | |
969 | 974 | # get the host maximum guest size: |
970 | 975 | case "${host_cpu}" in |
971 | - i[3456789]86) | |
976 | +i[3456789]86) | |
977 | + recode_hosts="mmap x86" | |
972 | 978 | recode_size_guest_max_host=64 |
973 | 979 | ;; |
974 | 980 | x86_64) |
981 | + recode_hosts="mmap x86" | |
975 | 982 | recode_size_guest_max_host=128 |
976 | 983 | ;; |
977 | 984 | *) |
978 | 985 | recode_hosts= |
979 | - recode_size_guest_max_host= ;; | |
986 | + recode_size_guest_max_host=1 ;; | |
980 | 987 | esac |
981 | 988 | |
982 | 989 | dnl Make brackets the quote characters again. |
983 | 990 | changequote([, ])dnl |
984 | 991 | |
992 | +keep_recode=$enable_recode | |
993 | + | |
994 | +for tme_recode_type in ${enable_recode}; do | |
995 | + if test "x${host_cpu}" = "x${tme_recode_type}"; then | |
996 | + keep_recode=yes | |
997 | + break | |
998 | + fi | |
999 | +done | |
1000 | + | |
1001 | +if test "x${keep_recode}" != xyes; then | |
1002 | + recode_hosts= | |
1003 | + recode_size_guest_max=1 | |
1004 | +fi | |
1005 | + | |
985 | 1006 | if test "x${recode_hosts}" = x; then |
986 | 1007 | AC_MSG_RESULT([no]) |
987 | 1008 | if test "x${enable_recode}" = xrequired; then |
@@ -43,17 +43,10 @@ tme_machine_sun4_oclock tme_machine_sun4 oclock | ||
43 | 43 | tme_machine_sun4_clock tme_machine_sun4 clock |
44 | 44 | tme_machine_sun4_zs tme_machine_sun4 zs |
45 | 45 | tme_host_gtk_display tme_host_gtk display |
46 | -tme_host_gtk_display tme_host_gtk display | |
47 | -tme_host_rfb_display tme_host_rfb display | |
48 | 46 | tme_host_rfb_display tme_host_rfb display |
49 | 47 | tme_host_sdl_display tme_host_sdl display |
50 | -tme_host_sdl_display tme_host_sdl display | |
51 | -tme_host_tun_tap tme_host_tun tap | |
52 | 48 | tme_host_tun_tap tme_host_tun tap |
53 | 49 | tme_host_bsd_bpf tme_host_bsd bpf |
54 | -tme_host_bsd_bpf tme_host_bsd bpf | |
55 | -tme_host_openvpn_tun_tap tme_host_openvpn tun_tap | |
56 | -tme_host_openvpn_socket_link tme_host_openvpn socket_link | |
57 | 50 | tme_host_openvpn_socket_link tme_host_openvpn socket_link |
58 | 51 | tme_host_openvpn_socket_server tme_host_openvpn_socket server |
59 | 52 | tme_host_openvpn_tun_tap tme_host_openvpn tun_tap |
@@ -3,7 +3,7 @@ | ||
3 | 3 | |
4 | 4 | AUTOMAKE_OPTIONS = 1.4 gnu |
5 | 5 | |
6 | -AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir) -I$(top_srcdir)/lib -I. -D_TME_IMPL | |
6 | +AM_CPPFLAGS = -I$(top_srcdir) -I$(srcdir) -I$(top_srcdir)/lib -I. -D_TME_IMPL @TME_HOST_CFLAGS@ | |
7 | 7 | |
8 | 8 | if HAVE_OPENVPN |
9 | 9 | AM_CPPFLAGS += -DTME_OPENVPN |
@@ -19,8 +19,13 @@ libtmesh_la_SOURCES = \ | ||
19 | 19 | libtmesh_la_LIBADD = $(top_builddir)/libtme/libtme.la |
20 | 20 | |
21 | 21 | bin_PROGRAMS = tmesh |
22 | -tmesh_LDADD = libtmesh.la $(tme_preopen) @TME_HOSTS@ | |
22 | +tmesh_LDADD = libtmesh.la $(tme_preopen) @TME_HOST_LIBS@ | |
23 | 23 | tmesh_LDFLAGS = -dlpreopen force -dlopen self |
24 | +if WIN32 | |
25 | +if HAVE_SDL | |
26 | +tmesh_LDFLAGS += -mwindows | |
27 | +endif | |
28 | +endif | |
24 | 29 | |
25 | 30 | install-exec-hook: |
26 | 31 | $(SETCAP) $(DESTDIR)$(bindir)/$(TGTPFX)tmesh$(EXEEXT) |
@@ -28,4 +33,4 @@ install-exec-hook: | ||
28 | 33 | include $(top_srcdir)/tme-hosts.txt |
29 | 34 | include $(top_srcdir)/tme-preopen.txt |
30 | 35 | |
31 | -SUBDIRS = @TME_HOSTS_DIRS@ | |
36 | +SUBDIRS = @TME_HOST_DIRS@ |