Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2521

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/21/2521/1

do not require cygwin gcc

Change-Id: I29de91f2eeb5c9317271aecf861f64a3c8eff73f
---
M configure.ac
M solenv/CustomTarget_concat-deps.mk
M solenv/Package_concat-deps.mk
M solenv/bin/concat-deps.c
4 files changed, 48 insertions(+), 53 deletions(-)



diff --git a/configure.ac b/configure.ac
index 62d2f78..97c351f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2158,20 +2158,6 @@
     SOLARVER=${BUILDDIR}/solver
 fi
 
-dnl ===================================================================
-dnl Extra check for Windows. Cygwin builds need gcc to build concat-deps
-dnl although MSVC is used to build other build-time tools and
-dnl LibreOffice itself.
-dnl ===================================================================
-if test "$build_os" = "cygwin"; then
-    AC_MSG_CHECKING([for Cygwin gcc/g++])
-    if which gcc > /dev/null && which g++ > /dev/null; then
-        AC_MSG_RESULT([found])
-    else
-        AC_MSG_ERROR([Cygwin gcc and g++ are needed, please install them.])
-    fi
-fi
-
 # remenber SYSBASE value
 AC_SUBST(SYSBASE)
 
@@ -2242,32 +2228,34 @@
 dnl  Checks for C compiler,
 dnl  The check for the C++ compiler is later on.
 dnl ===================================================================
-GCC_HOME_SET="true"
-AC_MSG_CHECKING([gcc home])
-if test -z "$with_gcc_home"; then
-    if test "$enable_icecream" = "yes"; then
-        if test -d "/usr/lib/icecc/bin"; then
-            GCC_HOME="/usr/lib/icecc/"
-        else
-            GCC_HOME="/opt/icecream/"
-        fi
-    else
-        GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
-        GCC_HOME_SET="false"
-    fi
-else
-    GCC_HOME="$with_gcc_home"
-fi
-AC_MSG_RESULT($GCC_HOME)
-AC_SUBST(GCC_HOME)
+if test "$_os" != "WINNT" -a "$WITH_MINGW" != "yes"; then
+       GCC_HOME_SET="true"
+       AC_MSG_CHECKING([gcc home])
+       if test -z "$with_gcc_home"; then
+               if test "$enable_icecream" = "yes"; then
+                       if test -d "/usr/lib/icecc/bin"; then
+                               GCC_HOME="/usr/lib/icecc/"
+                       else
+                               GCC_HOME="/opt/icecream/"
+                       fi
+               else
+                       GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,`
+                       GCC_HOME_SET="false"
+               fi
+       else
+               GCC_HOME="$with_gcc_home"
+       fi
+       AC_MSG_RESULT($GCC_HOME)
+       AC_SUBST(GCC_HOME)
 
-if test "$GCC_HOME_SET" = "true"; then
-    if test -z "$CC"; then
-        CC="$GCC_HOME/bin/gcc"
-    fi
-    if test -z "$CXX"; then
-        CXX="$GCC_HOME/bin/g++"
-    fi
+       if test "$GCC_HOME_SET" = "true"; then
+               if test -z "$CC"; then
+                       CC="$GCC_HOME/bin/gcc"
+               fi
+               if test -z "$CXX"; then
+                       CXX="$GCC_HOME/bin/g++"
+               fi
+       fi
 fi
 
 dnl The following checks for gcc, cc and then cl (if it weren't guarded for win32)
diff --git a/solenv/CustomTarget_concat-deps.mk b/solenv/CustomTarget_concat-deps.mk
index 1f138c5..6e8d56a 100644
--- a/solenv/CustomTarget_concat-deps.mk
+++ b/solenv/CustomTarget_concat-deps.mk
@@ -9,16 +9,15 @@
 
 $(eval $(call gb_CustomTarget_CustomTarget,solenv/concat-deps))
 
-$(call gb_CustomTarget_get_target,solenv/concat-deps) : \
-       $(call gb_CustomTarget_get_workdir,solenv/concat-deps)/concat-deps
+$(eval $(call gb_CustomTarget_register_targets,solenv/concat-deps,\
+       concat-deps$(gb_Executable_EXT_for_build) \
+))
 
-$(call gb_CustomTarget_get_workdir,solenv/concat-deps)/concat-deps : \
-               $(SRCDIR)/solenv/bin/concat-deps.c \
-               | $(call gb_CustomTarget_get_workdir,solenv/concat-deps)/.dir
-       $(call gb_Output_announce,solenv/concat-deps,$(true),GCC,1)
+$(call gb_CustomTarget_get_workdir,solenv/concat-deps)/concat-deps$(gb_Executable_EXT_for_build) : 
\
+               $(SRCDIR)/solenv/bin/concat-deps.c
+       $(call gb_Output_announce,solenv/concat-deps,$(true),C,1)
 ifeq ($(COM_FOR_BUILD),MSC)
-       # on cygwin force the use of gcc
-       gcc -O2 $< -o $@
+       LIB="$(ILIB)" $(CC_FOR_BUILD) -nologo $(SOLARINC) -O2 $< -Fo$(dir $@) -Fe$(dir $@)
 else
        $(CC_FOR_BUILD) -O2 $< -o $@
 endif
diff --git a/solenv/Package_concat-deps.mk b/solenv/Package_concat-deps.mk
index 9d6319d..9ede386 100644
--- a/solenv/Package_concat-deps.mk
+++ b/solenv/Package_concat-deps.mk
@@ -9,6 +9,6 @@
 
 $(eval $(call gb_Package_Package,solenv_concat-deps,$(call 
gb_CustomTarget_get_workdir,solenv/concat-deps)))
 
-$(eval $(call gb_Package_add_file,solenv_concat-deps,bin/concat-deps,concat-deps))
+$(eval $(call 
gb_Package_add_file,solenv_concat-deps,bin/concat-deps$(gb_Executable_EXT_for_build),concat-deps$(gb_Executable_EXT_for_build)))
 
 # vim: set noet sw=4 ts=4:
diff --git a/solenv/bin/concat-deps.c b/solenv/bin/concat-deps.c
index 2a0889d..b8fe2cf 100644
--- a/solenv/bin/concat-deps.c
+++ b/solenv/bin/concat-deps.c
@@ -30,7 +30,7 @@
 #define USE_MEMORY_ALIGNMENT 4
 #endif /* Def _AIX */
 
-#ifdef __CYGWIN__
+#ifdef _MSC_VER
 #define __windows
 #define CORE_BIG_ENDIAN 0
 #define CORE_LITTLE_ENDIAN 1
@@ -97,7 +97,11 @@
 #ifdef __windows
 #define FILE_O_RDONLY     _O_RDONLY
 #define FILE_O_BINARY     _O_BINARY
-#define PATHNCMP strncasecmp /* MSVC converts paths to lower-case sometimes? */
+#define PATHNCMP _strnicmp /* MSVC converts paths to lower-case sometimes? */
+#define inline __inline
+#define snprintf _snprintf
+#define ssize_t long
+#define S_ISREG(mode) (((mode) & _S_IFMT) == (_S_IFREG)) /* MSVC does not have this macro */
 #else /* not windaube */
 #define FILE_O_RDONLY     O_RDONLY
 #define FILE_O_BINARY     0
@@ -775,10 +779,12 @@
 {
     /* is there some obvious way to printf N characters that i'm missing? */
     size_t size = end - token + 1;
-    char tmp[size];
+    char* tmp;
+    tmp=malloc(size*sizeof(tmp));
     snprintf(tmp, size, "%s", token);
     fputs(tmp, stdout);
     fputs(".done ", stdout);
+    free(tmp);
 }
 
 /* prefix paths to absolute */
@@ -787,6 +793,7 @@
     char* token;
     char* end;
     int boost_count = 0;
+    int token_len;
     const char * unpacked_end = 0; /* end of UnpackedTarget match (if any) */
     /* for UnpackedTarget the target is GenC{,xx}Object, dont mangle! */
     int target_seen = 0;
@@ -805,7 +812,7 @@
         while (*end && (' ' != *end) && ('\t' != *end) && (':' != *end)) {
             ++end;
         }
-        int token_len = end - token;
+        token_len = end - token;
         if (target_seen &&
             elide_dependency(token, token_len, &unpacked_end))
         {
@@ -855,8 +862,9 @@
 
 static inline char * eat_space_at_end(char * end)
 {
+    char * real_end;
     assert('\0' == *end);
-    char * real_end = end - 1;
+    real_end = end - 1;
     while (' ' == *real_end || '\t' == *real_end || '\n' == *real_end
                 || ':' == *real_end)
     {    /* eat colon and whitespace at end */

-- 
To view, visit https://gerrit.libreoffice.org/2521
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I29de91f2eeb5c9317271aecf861f64a3c8eff73f
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Peter Foley <pefoley2@verizon.net>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.