diff --git a/configure.ac b/configure.ac index 8c542fea70..9401373373 100644 --- a/configure.ac +++ b/configure.ac @@ -108,7 +108,7 @@ opt_pkgs='' # gtk deps cairo_req='cairo-pdf cairo-ps pangocairo' # -gtk_req="gtk+-3.0 >= $GTK_VERSION_REQ gtk+-unix-print-3.0 librsvg-2.0 >= 2.32.0" +gtk_req="gtk+-3.0 >= $GTK_VERSION_REQ librsvg-2.0 >= 2.32.0" dnl cairo-fc is needed but only available on cairo > 1.10 dnl http://bugzilla.abisource.com/show_bug.cgi?id=13265 PKG_CHECK_EXISTS(cairo >= 1.10, [gtk_req="$gtk_req cairo-fc"],[]) @@ -157,7 +157,7 @@ case ${host_os} in ;; *mingw*) PLATFORM="win" - TOOLKIT="win" + TOOLKIT="gtk" ;; *) PLATFORM="unix" @@ -689,7 +689,7 @@ elif test "$TOOLKIT" = "qt"; then else SYSTEM_CFLAGS=$PNG_CFLAGS SYSTEM_LIBS="$PNG_LIBS -ljpeg" - deps_pkgs="$deps_pkgs $gtk_pkgs x11" + deps_pkgs="$deps_pkgs $gtk_pkgs" fi PKG_CHECK_MODULES(DEPS,[$deps_pkgs]) diff --git a/mxe/LICENSE.md b/mxe/LICENSE.md new file mode 100644 index 0000000000..9d05bb8f57 --- /dev/null +++ b/mxe/LICENSE.md @@ -0,0 +1,49 @@ +MXE is licensed under the MIT Licence. The makefiles and utilities under +`plugins/`, `src/`, and `tools/` all share this licence. + +> Copyright (c) 2007-2016 +> +> * Volker Diels-Grabsch +> * Mark Brand +> * Tony Theodore +> * Martin Gerhardy +> * Tiancheng "Timothy" Gu +> * Boris Nagaev +> * ... and many other [contributors][contributors] +> +> (contact via the [project mailing list][mailing-list] or +> [issue tracker][issue-tracker]) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all +> copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +> SOFTWARE. + +MXE distributes code from the following projects in the `ext/` directory: + +- [GNU config.guess][config.guess] [GPL3+ with Autoconf exception] +- [GNU Make Standard Library][gmsl] [BSD 3-clause] + +The [packages][packages] downloaded by MXE (ending up in `pkg/`) each +have their own licence(s). Please see the individual source trees and/or +websites for further details. + +[contributors]: https://github.com/mxe/mxe/graphs/contributors +[mailing-list]: https://lists.nongnu.org/mailman/listinfo/mingw-cross-env-list +[issue-tracker]: https://github.com/mxe/mxe/issues +[config.guess]: https://github.com/mxe/mxe/blob/master/ext/config.guess#L3-L27 +[gmsl]: https://github.com/mxe/mxe/blob/master/ext/gmsl#L8-L40 +[packages]: https://mxe.cc/#packages diff --git a/mxe/README.md b/mxe/README.md new file mode 100644 index 0000000000..93ccd7daa6 --- /dev/null +++ b/mxe/README.md @@ -0,0 +1,8 @@ +You WILL need additional work to make this go. + +make MXE_PLUGIN_DIRS=plugins/apps/abiword abiword + +notes: + +* need to remove the manpages to get Enchant to build +* need to remove the -Werror flags to get libgoffice to build diff --git a/mxe/abiword.mk b/mxe/abiword.mk new file mode 100644 index 0000000000..bac16910f0 --- /dev/null +++ b/mxe/abiword.mk @@ -0,0 +1,14 @@ +# This file is part of MXE. See LICENSE.md for licensing information. + +# TOOLKIT target for windows must be forced to GTK + +PKG := abiword +$(PKG)_DEPS := cc libgsf libxslt enchant wv goffice + +define $(PKG)_BUILD + cd '$(BUILD_DIR)' && '/media/modus/External2/abiword/abiword/configure' \ + $(MXE_CONFIGURE_OPTS) \ + --infodir='$(BUILD_DIR)/sink' + $(MAKE) -C $(BUILD_DIR) -j '$(JOBS)' + $(MAKE) -C $(BUILD_DIR) -j 1 install $(MXE_DISABLE_DOCS) +endef diff --git a/mxe/enchant.mk b/mxe/enchant.mk new file mode 100644 index 0000000000..cff4b6bf35 --- /dev/null +++ b/mxe/enchant.mk @@ -0,0 +1,14 @@ +# This file is part of MXE. See LICENSE.md for licensing information. + +# need to remove the manpages to get this to work! + +PKG := enchant +$(PKG)_DEPS := cc + +define $(PKG)_BUILD + cd '$(BUILD_DIR)' && '/media/modus/External2/abiword/enchant/configure' \ + $(MXE_CONFIGURE_OPTS) \ + --infodir='$(BUILD_DIR)/sink' + $(MAKE) -C $(BUILD_DIR) -j '$(JOBS)' + $(MAKE) -C $(BUILD_DIR) -j 1 install $(MXE_DISABLE_DOCS) +endef diff --git a/mxe/goffice.mk b/mxe/goffice.mk new file mode 100644 index 0000000000..aa51f2464e --- /dev/null +++ b/mxe/goffice.mk @@ -0,0 +1,14 @@ +# This file is part of MXE. See LICENSE.md for licensing information. + +# need to remove the -Werror flags to get this to work + +PKG := goffice +$(PKG)_DEPS := cc libgsf librsvg + +define $(PKG)_BUILD + cd '$(BUILD_DIR)' && PKG_CONFIG=/media/modus/External2/mxe/usr/bin/i686-w64-mingw32.static-pkg-config '/media/modus/External2/abiword/goffice-0.10.55/configure' \ + $(MXE_CONFIGURE_OPTS) \ + --infodir='$(BUILD_DIR)/sink' + $(MAKE) -C $(BUILD_DIR) -j '$(JOBS)' + $(MAKE) -C $(BUILD_DIR) -j 1 install $(MXE_DISABLE_DOCS) +endef diff --git a/mxe/wv.mk b/mxe/wv.mk new file mode 100644 index 0000000000..d2d8301462 --- /dev/null +++ b/mxe/wv.mk @@ -0,0 +1,12 @@ +# This file is part of MXE. See LICENSE.md for licensing information. + +PKG := wv +$(PKG)_DEPS := cc libgsf + +define $(PKG)_BUILD + cd '$(BUILD_DIR)' && PKG_CONFIG=/media/modus/External2/mxe/usr/bin/i686-w64-mingw32.static-pkg-config '/media/modus/External2/abiword/wv/configure' \ + $(MXE_CONFIGURE_OPTS) \ + --infodir='$(BUILD_DIR)/sink' + $(MAKE) -C $(BUILD_DIR) -j '$(JOBS)' + $(MAKE) -C $(BUILD_DIR) -j 1 install $(MXE_DISABLE_DOCS) +endef diff --git a/src/af/ev/win/ev_Win32Menu.h b/src/af/ev/win/ev_Win32Menu.h index 8d3c7ce43e..e882f25822 100644 --- a/src/af/ev/win/ev_Win32Menu.h +++ b/src/af/ev/win/ev_Win32Menu.h @@ -22,6 +22,7 @@ #include #include "ut_types.h" +#include "ut_vector.h" #include "xap_Types.h" #include "ev_Menu.h" #include "ut_color.h" diff --git a/src/af/ev/win/ev_Win32Toolbar.h b/src/af/ev/win/ev_Win32Toolbar.h index 5780434132..12a94292f6 100644 --- a/src/af/ev/win/ev_Win32Toolbar.h +++ b/src/af/ev/win/ev_Win32Toolbar.h @@ -24,6 +24,8 @@ #include "ut_types.h" #include "ut_vector.h" +#include "ut_misc.h" +#include "ut_assert.h" #include "xap_Types.h" #include "ev_Toolbar.h" #include "xav_Listener.h" diff --git a/src/af/util/unix/Makefile.am b/src/af/util/unix/Makefile.am index 959a965e18..48cf9d1e4d 100644 --- a/src/af/util/unix/Makefile.am +++ b/src/af/util/unix/Makefile.am @@ -6,8 +6,6 @@ AM_CPPFLAGS = \ libunix_la_SOURCES = \ ut_debugmsg.cpp \ - ut_files.cpp \ - ut_files.h \ ut_mutexImpl.h \ ut_path.cpp \ ut_sleep.h \ @@ -16,8 +14,6 @@ libunix_la_SOURCES = \ ut_unixIdle.cpp \ ut_unixIdle.h \ ut_unixMisc.cpp \ - ut_unixColor.cpp \ - ut_unixColor.h \ ut_unixTimer.cpp \ ut_unixTimer.h diff --git a/src/af/util/win/Makefile.am b/src/af/util/win/Makefile.am index bbfeff557b..77f8def745 100644 --- a/src/af/util/win/Makefile.am +++ b/src/af/util/win/Makefile.am @@ -17,7 +17,6 @@ libwin_la_SOURCES = \ ut_Win32Misc.cpp \ ut_Win32OS.cpp \ ut_Win32OS.h \ - ut_Win32String.cpp \ ut_Win32Timer.cpp \ ut_Win32Timer.h \ ut_Win32Uuid.cpp \ diff --git a/src/af/util/win/ut_Win32String.cpp b/src/af/util/win/ut_Win32String.cpp deleted file mode 100644 index 38331f7934..0000000000 --- a/src/af/util/win/ut_Win32String.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* AbiSource Program Utilities - * Copyright (C) 1998,1999 AbiSource, Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - * 02110-1301 USA. - */ - -#include -#include -#include -#include -#include -#include -#include - -#include "ut_types.h" -#include "ut_misc.h" -#include "ut_assert.h" -#include "ut_string.h" - -UT_BidiCharType UT_bidiGetCharType(UT_UCS4Char c) -{ -#ifndef NO_BIDI_SUPPORT - return fribidi_get_type(c); -#else - return UT_BIDI_LTR; -#endif -} - -bool UT_bidiReorderString(const UT_UCS4Char * pStrIn, UT_uint32 len, UT_BidiCharType baseDir, - UT_UCS4Char * pStrOut) -{ -#ifndef NO_BIDI_SUPPORT - // if this assert fails, we have a serious problem ... - UT_ASSERT_HARMLESS( sizeof(UT_UCS4Char) == sizeof(FriBidiChar) ); - return (0 != fribidi_log2vis ((FriBidiChar *)pStrIn, len, &baseDir, (FriBidiChar*)pStrOut, nullptr, nullptr, nullptr)); -#else - if(!pStrIn || !*pStrIn) - return true; - - UT_return_val_if_fail( pStrOut, false ); - - UT_UCS4_strncpy(pStrOut, pStrIn, len); - return true; -#endif -} - -bool UT_bidiMapLog2Vis(const UT_UCS4Char * pStrIn, UT_uint32 len, UT_BidiCharType baseDir, - UT_uint32 *pL2V, UT_uint32 * pV2L, UT_Byte * pEmbed) -{ -#ifndef NO_BIDI_SUPPORT - // if this assert fails, we have a serious problem ... - UT_ASSERT_HARMLESS( sizeof(UT_UCS4Char) == sizeof(FriBidiChar) ); - return (0 != fribidi_log2vis ((FriBidiChar *)pStrIn, len, &baseDir, - nullptr, (FriBidiStrIndex*)pL2V, (FriBidiStrIndex*)pV2L, (FriBidiLevel*)pEmbed)); -#else - UT_return_val_if_fail( pL2V && pV2L && pEmbed, false ); - for(UT_uint32 i = 0; i < len; ++i) - { - pL2V[i] = i; - pV2L[i] = i; - pEmbed[i] = 0; - } - - return true; -#endif -} - - -bool UT_bidiGetMirrorChar(UT_UCS4Char c, UT_UCS4Char &mc) -{ -#ifndef NO_BIDI_SUPPORT - return (0 != fribidi_get_mirror_char(c, (FriBidiChar*)&mc)); -#else - return false; -#endif -} diff --git a/src/af/util/win/ut_debugmsg.cpp b/src/af/util/win/ut_debugmsg.cpp index 662b1a658c..c003823d3f 100644 --- a/src/af/util/win/ut_debugmsg.cpp +++ b/src/af/util/win/ut_debugmsg.cpp @@ -26,6 +26,10 @@ #include "ut_debugmsg.h" +void UT_Debug_Init() +{ +} + // TODO This is Win32-specific, and should not be. void _UT_OutputMessage(const char *s, ...) diff --git a/src/af/util/xp/Makefile.am b/src/af/util/xp/Makefile.am index b9d7cf11aa..9b2e7ed3a6 100644 --- a/src/af/util/xp/Makefile.am +++ b/src/af/util/xp/Makefile.am @@ -31,6 +31,8 @@ libxp_la_SOURCES = \ ut_endian.h \ ut_exception.h \ ut_export.h \ + ut_files.cpp \ + ut_files.h \ ut_go_file.cpp \ ut_go_file.h \ ut_growbuf.cpp \ @@ -96,6 +98,8 @@ libxp_la_SOURCES = \ ut_unicode.h \ ut_units.cpp \ ut_units.h \ + ut_unixColor.cpp \ + ut_unixColor.h \ ut_uuid.cpp \ ut_uuid.h \ ut_vector.h \ diff --git a/src/af/util/unix/ut_files.cpp b/src/af/util/xp/ut_files.cpp similarity index 94% rename from src/af/util/unix/ut_files.cpp rename to src/af/util/xp/ut_files.cpp index debb672c4d..b25fbfc725 100644 --- a/src/af/util/unix/ut_files.cpp +++ b/src/af/util/xp/ut_files.cpp @@ -79,7 +79,13 @@ bool UT_createDirectoryIfNecessary(const char * szDir, bool publicdir) bool success = true; mode_t old_mask = umask (0); +#ifdef _WIN32 + // glib almost certainly has a better way to do this + // but let's put out the fires first, no? + if (mkdir (szDir)) +#else if (mkdir (szDir, publicdir ? 0775 : 0700)) +#endif { UT_DEBUGMSG(("Could not create Directory [%s].\n", szDir)); success = false; diff --git a/src/af/util/unix/ut_files.h b/src/af/util/xp/ut_files.h similarity index 100% rename from src/af/util/unix/ut_files.h rename to src/af/util/xp/ut_files.h diff --git a/src/af/util/xp/ut_string.cpp b/src/af/util/xp/ut_string.cpp index 7576a76607..a1c08479ee 100644 --- a/src/af/util/xp/ut_string.cpp +++ b/src/af/util/xp/ut_string.cpp @@ -1692,8 +1692,6 @@ const char* std_size_string(float f) return string; } -#ifndef TOOLKIT_WIN - UT_BidiCharType UT_bidiGetCharType(UT_UCS4Char c) { #ifndef NO_BIDI_SUPPORT @@ -1798,5 +1796,3 @@ bool UT_bidiGetMirrorChar(UT_UCS4Char c, UT_UCS4Char &mc) #endif } - -#endif diff --git a/src/af/util/xp/ut_string.h b/src/af/util/xp/ut_string.h index 84da63e332..ae8da1058e 100644 --- a/src/af/util/xp/ut_string.h +++ b/src/af/util/xp/ut_string.h @@ -174,6 +174,8 @@ ABI_EXPORT char *UT_strptime (const char *buf, const char *format, struct tm *tm #endif +#if 0 +/* This code breaks boost */ #ifdef _WIN32 #define snprintf _snprintf @@ -181,6 +183,7 @@ ABI_EXPORT char *UT_strptime (const char *buf, const char *format, struct tm *tm #define N_(String) (String) #endif /* WIN32 */ +#endif #if defined (SNPRINTF_MISSING) extern int snprintf(char *str, size_t size, const char *format, ...); diff --git a/src/af/util/unix/ut_unixColor.cpp b/src/af/util/xp/ut_unixColor.cpp similarity index 100% rename from src/af/util/unix/ut_unixColor.cpp rename to src/af/util/xp/ut_unixColor.cpp diff --git a/src/af/util/unix/ut_unixColor.h b/src/af/util/xp/ut_unixColor.h similarity index 100% rename from src/af/util/unix/ut_unixColor.h rename to src/af/util/xp/ut_unixColor.h diff --git a/src/af/xap/gtk/xap_UnixAppImpl.cpp b/src/af/xap/gtk/xap_UnixAppImpl.cpp index bc4014b7f8..ab7c9266d6 100644 --- a/src/af/xap/gtk/xap_UnixAppImpl.cpp +++ b/src/af/xap/gtk/xap_UnixAppImpl.cpp @@ -24,7 +24,9 @@ #include "xap_UnixAppImpl.h" #include "ut_string_class.h" +#ifndef _WIN32 #include "ut_files.h" +#endif #include "ut_go_file.h" std::string XAP_UnixAppImpl::localizeHelpUrl(const char * pathBefore, @@ -42,7 +44,9 @@ bool XAP_UnixAppImpl::openHelpURL(const char * url) bool XAP_UnixAppImpl::openURL(const char * url) { // Need this to make AbiGimp Load!!!!! +#ifndef _WIN32 if (progExists("foo")) {} +#endif GError * err = nullptr; err = UT_go_url_show (url); diff --git a/src/af/xap/gtk/xap_UnixFrameImpl.cpp b/src/af/xap/gtk/xap_UnixFrameImpl.cpp index 90cf772a79..cbeb49632b 100644 --- a/src/af/xap/gtk/xap_UnixFrameImpl.cpp +++ b/src/af/xap/gtk/xap_UnixFrameImpl.cpp @@ -43,7 +43,6 @@ #include "ut_string.h" #include "ut_types.h" #include "ut_assert.h" -#include "ut_files.h" #include "ut_misc.h" #include "ut_sleep.h" #include "xap_ViewListener.h" diff --git a/src/wp/ap/gtk/ap_UnixApp.cpp b/src/wp/ap/gtk/ap_UnixApp.cpp index cbd977f16f..028112189e 100644 --- a/src/wp/ap/gtk/ap_UnixApp.cpp +++ b/src/wp/ap/gtk/ap_UnixApp.cpp @@ -42,7 +42,9 @@ #include #include #include +#ifndef _WIN32 #include +#endif #include #include "ut_compiler.h" @@ -1301,22 +1303,26 @@ int AP_UnixApp::main(const char * szAppName, int argc, char ** argv) // Setup signal handlers, primarily for segfault // If we segfaulted before here, we *really* blew it - struct sigaction sa; - sa.sa_handler = &XAP_App::signalWrapper; - - sigfillset(&sa.sa_mask); // We don't want to hear about other signals - sigdelset(&sa.sa_mask, SIGABRT); // But we will call abort(), so we can't ignore that +#ifndef _WIN32 + { + struct sigaction sa; + sa.sa_handler = &XAP_App::signalWrapper; + + sigfillset(&sa.sa_mask); // We don't want to hear about other signals + sigdelset(&sa.sa_mask, SIGABRT); // But we will call abort(), so we can't ignore that #if defined (SA_NODEFER) && defined (SA_RESETHAND) - sa.sa_flags = SA_NODEFER | SA_RESETHAND; // Don't handle nested signals + sa.sa_flags = SA_NODEFER | SA_RESETHAND; // Don't handle nested signals #else - sa.sa_flags = 0; + sa.sa_flags = 0; +#endif + + sigaction(SIGSEGV, &sa, nullptr); + sigaction(SIGBUS, &sa, nullptr); + sigaction(SIGILL, &sa, nullptr); + sigaction(SIGQUIT, &sa, nullptr); + sigaction(SIGFPE, &sa, nullptr); + } #endif - - sigaction(SIGSEGV, &sa, nullptr); - sigaction(SIGBUS, &sa, nullptr); - sigaction(SIGILL, &sa, nullptr); - sigaction(SIGQUIT, &sa, nullptr); - sigaction(SIGFPE, &sa, nullptr); // TODO: handle SIGABRT @@ -1377,6 +1383,7 @@ bool AP_UnixApp::doWindowlessArgs(const AP_Args *Args, bool & bSuccess) if (Args->m_sGeometry) { +#ifndef _WIN32 // [--geometry ] // TODO : does X have a dummy geometry value reserved for this? @@ -1402,6 +1409,7 @@ bool AP_UnixApp::doWindowlessArgs(const AP_Args *Args, bool & bSuccess) // set the xap-level geometry for future frame use Args->getApp()->setGeometry(x, y, width, height, f); +#endif } if (Args->m_sPrintTo) diff --git a/src/wp/impexp/xp/ie_exp_Text.cpp b/src/wp/impexp/xp/ie_exp_Text.cpp index 60b0d48837..f2a8b4df96 100644 --- a/src/wp/impexp/xp/ie_exp_Text.cpp +++ b/src/wp/impexp/xp/ie_exp_Text.cpp @@ -229,6 +229,8 @@ UT_Error IE_Exp_Text::_writeDocument(void) if (!(!m_bIsEncoded || m_bExplicitlySetEncoding || _doEncodingDialog(m_szEncoding.c_str()))) return UT_SAVE_CANCELLED; + // on modern OSes, even Windows, this is a terrible idea anyway. for one, this code goes *after* we requested an encoding from the user! +#if 0 // TODO If we're going to the clipboard and the OS supports unicode, set encoding. // TODO Only supports Windows so far. // TODO Should use a finer-grain technique than IsWinNT() since Win98 supports unicode clipboard. @@ -239,6 +241,7 @@ UT_Error IE_Exp_Text::_writeDocument(void) _setEncoding(XAP_EncodingManager::get_instance()->getNativeUnicodeEncodingName()); #endif } +#endif m_pListener = _constructListener(); if (!m_pListener)