mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Adjustments to build on mingw-64.
Note that there may be some changes here that need to be wrapped with ifdef.
This commit is contained in:
parent
48948c5ce6
commit
489d0513e0
@ -135,12 +135,13 @@ IF (WIN32)
|
||||
# Setting CMAKE_FRAMEWORK_PATH, which is intended for OS X, is a terrible hack here. But I don't
|
||||
# want to mess with CMAKE_PREFIX_PATH.
|
||||
SET(CMAKE_FRAMEWORK_PATH "${CMAKE_FRAMEWORK_PATH_TMP}")
|
||||
SET(PKG_CONFIG_EXECUTABLE ${CMAKE_PREFIX_PATH}/gnome/bin/pkg-config.exe)
|
||||
SET(SWIG_EXECUTABLE ${CMAKE_PREFIX_PATH}/swig/swig.exe)
|
||||
SET(REGEX_INCLUDE_PATH ${CMAKE_PREFIX_PATH}/regex/include)
|
||||
SET(REGEX_LDFLAGS "-L${CMAKE_PREFIX_PATH}/regex/lib -lregex")
|
||||
SET(LIBXSLT_INCLUDE_DIR ${CMAKE_PREFIX_PATH}/libxslt/include)
|
||||
SET(LIBXSLT_XSLTPROC_EXECUTABLE ${CMAKE_PREFIX_PATH}/libxslt/bin/xsltproc)
|
||||
#SET(PKG_CONFIG_EXECUTABLE ${CMAKE_PREFIX_PATH}/gnome/bin/pkg-config.exe)
|
||||
SET(SWIG_EXECUTABLE swig)
|
||||
#SET(SWIG_EXECUTABLE ${CMAKE_PREFIX_PATH}/swig/swig.exe)
|
||||
SET(REGEX_INCLUDE_PATH ${CMAKE_PREFIX_PATH}/mingw32/include)
|
||||
SET(REGEX_LDFLAGS "-L${CMAKE_PREFIX_PATH}/mingw32/lib -lregex")
|
||||
#SET(LIBXSLT_INCLUDE_DIR ${CMAKE_PREFIX_PATH}/libxslt/include)
|
||||
#SET(LIBXSLT_XSLTPROC_EXECUTABLE ${CMAKE_PREFIX_PATH}/libxslt/bin/xsltproc)
|
||||
# I have not yet debugged the intltool-merge file generation process on Windows.
|
||||
SET(NO_INTLTOOL TRUE)
|
||||
#Prevent creating a console window on startup.
|
||||
@ -226,6 +227,7 @@ FIND_PATH (REGEX_INCLUDE_PATH NAMES regex.h
|
||||
PATHS /usr/include /opt/gnome/include)
|
||||
FIND_LIBRARY (REGEX_LIBRARY NAMES regex)
|
||||
IF (WIN32)
|
||||
message(STATUS "Looking for htmlhelp.h and htmlhelp.a in ${HTMLHELP_DIR}")
|
||||
FIND_PATH (HTMLHELP_INCLUDE_PATH NAMES htmlhelp.h HINTS ${HTMLHELP_DIR}/include)
|
||||
FIND_LIBRARY (HTMLHELP_LIBRARY htmlhelp HINTS ${HTMLHELP_DIR}/lib)
|
||||
ENDIF (WIN32)
|
||||
@ -708,7 +710,7 @@ INSTALL(CODE
|
||||
#For windows, copy in some DLLs from Mingw
|
||||
|
||||
IF (WIN32)
|
||||
SET(MINGW_DLLS ${CMAKE_PREFIX_PATH}/mingw/bin/libstdc++-6.dll ${CMAKE_PREFIX_PATH}/mingw/bin/libgcc_s_dw2-1.dll)
|
||||
SET(MINGW_DLLS ${CMAKE_PREFIX_PATH}/mingw32/bin/libstdc++-6.dll ${CMAKE_PREFIX_PATH}/mingw32/bin/libgcc_s_dw2-1.dll)
|
||||
INSTALL(PROGRAMS ${MINGW_DLLS} DESTINATION bin)
|
||||
FILE(COPY ${MINGW_DLLS} DESTINATION ${BINDIR_BUILD}
|
||||
# Do permissions matter for windows?
|
||||
|
@ -9,11 +9,17 @@ SET (GETTEXT_PACKAGE "gnucash")
|
||||
SET(GNOME 1)
|
||||
|
||||
IF (WIN32)
|
||||
SET (HAVE_SCANF_I64D 1)
|
||||
IF (MINGW)
|
||||
SET (HAVE_SCANF_LLD 1)
|
||||
ELSE ()
|
||||
SET (HAVE_SCANF_I64D 1)
|
||||
ENDIF ()
|
||||
SET (HAVE_HTMLHELPW 1)
|
||||
ENDIF (WIN32)
|
||||
|
||||
CHECK_INCLUDE_FILES (X11/Xlib.h HAVE_X11_XLIB_H)
|
||||
IF (NOT WIN32)
|
||||
CHECK_INCLUDE_FILES (X11/Xlib.h HAVE_X11_XLIB_H)
|
||||
ENDIF (WIN32)
|
||||
CHECK_INCLUDE_FILES (dirent.h HAVE_DIRENT_H)
|
||||
CHECK_INCLUDE_FILES (dlfcn.h HAVE_DLFCN_H)
|
||||
CHECK_INCLUDE_FILES (glob.h HAVE_GLOB_H)
|
||||
@ -182,4 +188,4 @@ SET_LOCAL_DIST(src_DIST_local CMakeLists.txt Makefile.am ${src_EXTRA_DIST})
|
||||
SET(src_DIST ${src_DIST_local} ${app_utils_DIST} ${backend_DIST} ${bin_DIST} ${business_DIST} ${cmake_modules_DIST}
|
||||
${core_utils_DIST} ${debug_DIST} ${doc_DIST} ${engine_DIST} ${gnc_module_DIST} ${gnome_DIST} ${gnome_search_DIST}
|
||||
${gnome_utils_DIST} ${html_DIST} ${import_export_DIST} ${libqof_DIST} ${optional_DIST} ${plugins_DIST} ${pixmaps_DIST} ${python_DIST}
|
||||
${quotes_DIST} ${register_DIST} ${report_DIST} ${scm_DIST} ${tax_DIST} ${test_core_DIST} PARENT_SCOPE)
|
||||
${quotes_DIST} ${register_DIST} ${report_DIST} ${scm_DIST} ${tax_DIST} ${test_core_DIST} PARENT_SCOPE)
|
||||
|
@ -22,8 +22,10 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#define __USE_MINGW_ANSI_STDIO 1
|
||||
#endif
|
||||
#include "gnc-ui-util.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <gio/gio.h>
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "swig-runtime.h"
|
||||
#include <platform.h>
|
||||
#if PLATFORM(WINDOWS)
|
||||
#include <windows.h>
|
||||
@ -28,7 +29,6 @@
|
||||
#include <glib.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <string.h>
|
||||
#include "swig-runtime.h"
|
||||
#include <libguile.h>
|
||||
#include <errno.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
|
@ -116,7 +116,7 @@ struct QofXmlBackendProvider : public QofBackendProvider
|
||||
bool
|
||||
QofXmlBackendProvider::type_check (const char *uri)
|
||||
{
|
||||
struct stat sbuf;
|
||||
GStatBuf sbuf;
|
||||
int rc;
|
||||
FILE* t;
|
||||
gchar* filename;
|
||||
|
@ -52,7 +52,7 @@ static QofLogModule log_module = GNC_MOD_BACKEND;
|
||||
bool
|
||||
GncXmlBackend::check_path (const char* fullpath, bool create)
|
||||
{
|
||||
struct stat statbuf;
|
||||
GStatBuf statbuf;
|
||||
char* dirname = g_path_get_dirname (fullpath);
|
||||
/* Again check whether the directory can be accessed */
|
||||
auto rc = g_stat (dirname, &statbuf);
|
||||
@ -333,7 +333,7 @@ GncXmlBackend::save_may_clobber_data()
|
||||
{
|
||||
if (m_fullpath.empty())
|
||||
return false;
|
||||
struct stat statbuf;
|
||||
GStatBuf statbuf;
|
||||
auto rc = g_stat (m_fullpath.c_str(), &statbuf);
|
||||
return rc == 0;
|
||||
}
|
||||
@ -397,7 +397,7 @@ GncXmlBackend::write_to_file (bool make_backup)
|
||||
gnc_prefs_get_file_save_compressed ()))
|
||||
{
|
||||
/* Record the file's permissions before g_unlinking it */
|
||||
struct stat statbuf;
|
||||
GStatBuf statbuf;
|
||||
auto rc = g_stat (m_fullpath.c_str(), &statbuf);
|
||||
if (rc == 0)
|
||||
{
|
||||
@ -619,7 +619,7 @@ GncXmlBackend::link_or_make_backup (const std::string& orig,
|
||||
bool
|
||||
GncXmlBackend::get_file_lock ()
|
||||
{
|
||||
struct stat statbuf;
|
||||
GStatBuf statbuf;
|
||||
#ifndef G_OS_WIN32
|
||||
char* pathbuf = NULL, *tmpbuf = NULL;
|
||||
size_t pathbuf_size = 0;
|
||||
@ -739,7 +739,7 @@ GncXmlBackend::get_file_lock ()
|
||||
bool
|
||||
GncXmlBackend::backup_file()
|
||||
{
|
||||
struct stat statbuf;
|
||||
GStatBuf statbuf;
|
||||
|
||||
auto datafile = m_fullpath.c_str();
|
||||
|
||||
@ -773,7 +773,7 @@ GncXmlBackend::backup_file()
|
||||
void
|
||||
GncXmlBackend::remove_old_files ()
|
||||
{
|
||||
struct stat lockstatbuf, statbuf;
|
||||
GStatBuf lockstatbuf, statbuf;
|
||||
|
||||
if (g_stat (m_lockfile.c_str(), &lockstatbuf) != 0)
|
||||
return;
|
||||
|
@ -307,7 +307,7 @@ gnc_path_find_localized_html_file (const gchar *file_name)
|
||||
static gboolean
|
||||
gnc_validate_directory (const gchar *dirname, gboolean create, gchar **msg)
|
||||
{
|
||||
struct stat statbuf;
|
||||
GStatBuf statbuf;
|
||||
gint rc;
|
||||
|
||||
*msg = NULL;
|
||||
|
@ -108,7 +108,6 @@ gnc_key_file_save_to_file (const gchar *filename,
|
||||
{
|
||||
gchar *contents;
|
||||
gint fd;
|
||||
extern int errno;
|
||||
gint length;
|
||||
ssize_t written;
|
||||
gboolean success = TRUE;
|
||||
|
@ -22,7 +22,9 @@
|
||||
\********************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#define __USE_MINGW_ANSI_STDIO 1
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#include <glib.h>
|
||||
#include <glib/gstdio.h>
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <platform.h>
|
||||
#include <libguile.h>
|
||||
#if PLATFORM(WINDOWS)
|
||||
#include <windows.h>
|
||||
#endif
|
||||
@ -230,7 +231,7 @@ gnc_get_ea_locale_dir(const char *top_dir)
|
||||
static gchar *default_locale = "C";
|
||||
gchar *ret;
|
||||
gchar *locale;
|
||||
struct stat buf;
|
||||
GStatBuf buf;
|
||||
int i;
|
||||
|
||||
#ifdef PLATFORM_WIN32
|
||||
|
@ -757,7 +757,9 @@ sxftd_update_excal_adapt( GObject *o, gpointer ud )
|
||||
void
|
||||
gnc_sx_create_from_trans( Transaction *trans )
|
||||
{
|
||||
#ifndef __MINGW32__
|
||||
int errno;
|
||||
#endif
|
||||
SXFromTransInfo *sxfti = g_new0( SXFromTransInfo, 1);
|
||||
GtkBuilder *builder;
|
||||
GtkWidget *dialog;
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <platform.h>
|
||||
#include <libguile.h>
|
||||
#if PLATFORM(WINDOWS)
|
||||
#include <windows.h>
|
||||
#endif
|
||||
@ -41,7 +42,6 @@
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <regex.h>
|
||||
#include <libguile.h>
|
||||
|
||||
#include <webkit2/webkit2.h>
|
||||
|
||||
|
@ -45,15 +45,21 @@ IF(WITH_AQBANKING)
|
||||
${aqbanking_noinst_HEADERS}
|
||||
)
|
||||
|
||||
|
||||
SET(AQB_EXPORT_SYMBOLS "")
|
||||
IF (WIN32)
|
||||
SET(AQB_EXPORT_SYMBOLS "-Wl,--export-all-symbols")
|
||||
ENDIF()
|
||||
SET(AQB_LIBSTDCXX "")
|
||||
IF (MINGW)
|
||||
SET(AQB_LIBSTDCXX "-lstdc++")
|
||||
ENDIF()
|
||||
|
||||
TARGET_LINK_LIBRARIES(gncmod-aqbanking gnc-gnome gncmod-gnome-utils gncmod-generic-import gncmod-register-core
|
||||
gncmod-register-gnome gncmod-ledger-core gncmod-engine gnc-qof ${AQB_EXPORT_SYMBOLS} ${AQBANKING_LDFLAGS} ${GWENHYWFAR_LDFLAGS}
|
||||
${GWENGUI_GTK2_LDFLAGS} ${GNOME_LDFLAGS} ${KTOBLZCHECK_LDFLAGS})
|
||||
TARGET_LINK_LIBRARIES(gncmod-aqbanking gnc-gnome gncmod-gnome-utils
|
||||
gncmod-generic-import gncmod-register-core
|
||||
gncmod-register-gnome gncmod-ledger-core gncmod-engine
|
||||
gnc-qof ${AQB_EXPORT_SYMBOLS} ${AQBANKING_LDFLAGS}
|
||||
${GWENHYWFAR_LDFLAGS} ${GWENGUI_GTK2_LDFLAGS}
|
||||
${GNOME_LDFLAGS} ${KTOBLZCHECK_LDFLAGS} ${AQB_LIBSTDCXX})
|
||||
|
||||
TARGET_COMPILE_DEFINITIONS(gncmod-aqbanking PRIVATE -DG_LOG_DOMAIN=\"gnc.import.aqbanking\")
|
||||
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <platform.h>
|
||||
#include <libguile.h>
|
||||
#if PLATFORM(WINDOWS)
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
@ -1471,7 +1471,7 @@ static char *
|
||||
gnc_get_export_filename (SCM choice)
|
||||
{
|
||||
char * filepath;
|
||||
struct stat statbuf;
|
||||
GStatBuf statbuf;
|
||||
char * title;
|
||||
const gchar * html_type = _("HTML");
|
||||
char * type;
|
||||
|
@ -231,7 +231,9 @@ gnc_saved_reports_write_internal (const gchar *file, const gchar *contents, gboo
|
||||
{
|
||||
gboolean success = TRUE;
|
||||
gint fd;
|
||||
#ifndef __MINGW32__
|
||||
extern int errno;
|
||||
#endif
|
||||
ssize_t written;
|
||||
gint length;
|
||||
gint flags = O_WRONLY | O_CREAT | (overwrite ? O_TRUNC : O_APPEND);
|
||||
|
Loading…
Reference in New Issue
Block a user