[Libreoffice-commits] .: Branch 'libreoffice-3-4' - 4 commits - autogen.sh configure.in set_soenv.in solenv/gbuild
Jan Holesovsky
kendy at kemper.freedesktop.org
Fri Apr 15 05:23:55 PDT 2011
autogen.sh | 2
configure.in | 49 ++++++++++-----
set_soenv.in | 11 +--
solenv/gbuild/filter-showIncludes.pl | 62 +++++++++++++++++++
solenv/gbuild/platform/windows.mk | 112 +++++------------------------------
5 files changed, 118 insertions(+), 118 deletions(-)
New commits:
commit 823a2d5de8b3f5d9f93bd9404aa0456736aa3ee1
Author: Jan Holesovsky <kendy at suse.cz>
Date: Wed Apr 6 11:19:15 2011 +0200
Don't override CC and CXX on Windows when set, handle ccache.
This is to allow use of ccache by specifying something like:
export CC="ccache C:/path/to/cl.exe"
export CXX="ccache C:/patch/to/cl.exe"
before running ./autogen.sh
diff --git a/configure.in b/configure.in
index c3741aa..18de3ff 100755
--- a/configure.in
+++ b/configure.in
@@ -2131,7 +2131,7 @@ if test "$_os" = "WINNT"; then
else
with_cl_home=`cygpath -u "$with_cl_home"`
fi
- AC_MSG_RESULT([done])
+ AC_MSG_RESULT([$with_cl_home])
dnl ===========================================================
dnl Check for mspdb80.dll/mspdb100.dll
@@ -2172,27 +2172,29 @@ if test "$_os" = "WINNT"; then
PATH="$MSPDB_PATH:$PATH"
AC_MSG_CHECKING([the Microsoft C/C++ Compiler])
- if test "$CL_X64" = ""; then
- if test -x "$with_cl_home/bin/cl.exe"; then
- CC="$with_cl_home/bin/cl.exe"
+ if test -z "$CC"; then
+ if test "$CL_X64" = ""; then
+ if test -x "$with_cl_home/bin/cl.exe"; then
+ CC="$with_cl_home/bin/cl.exe"
+ fi
+ else
+ if test -x "$with_cl_home/bin/amd64/cl.exe"; then
+ CC="$with_cl_home/bin/amd64/cl.exe"
+ fi
fi
- else
- if test -x "$with_cl_home/bin/amd64/cl.exe"; then
- CC="$with_cl_home/bin/amd64/cl.exe"
+ if test -z "$CC"; then
+ AC_PATH_PROG(CC, cl.exe)
fi
- fi
- if test -z "$CC"; then
- AC_PATH_PROG(CC, cl.exe)
- fi
-
- if test -e "$CC"; then
# This gives us a posix path with 8.3 filename restrictions
CC=`cygpath -d "$CC"`
CC=`cygpath -u "$CC"`
+ fi
+
+ if test -n "$CC"; then
# Remove /cl.exe from CC case insensitive
AC_MSG_RESULT([found ($CC)])
if test "$CL_X64" = ""; then
- COMPATH=`echo $CC | $SED 's@\/[[Bb]][[Ii]][[Nn]]\/[[cC]][[lL]]\.[[eE]][[xX]][[eE]]@@'`
+ COMPATH=`echo $CC | $SED -e 's@\/[[Bb]][[Ii]][[Nn]]\/[[cC]][[lL]]\.[[eE]][[xX]][[eE]].*@@' -e 's@^.* @@'`
else
if test -n "$with_cl_home"; then
COMPATH=`echo $with_cl_home`
@@ -2427,7 +2429,7 @@ dnl ===================================================================
dnl Testing for c++ compiler and version...
dnl ===================================================================
if test "$_os" = "WINNT" -a "$WITH_MINGW" != "yes"; then
- if test -e "$CC"; then
+ if test -n "$CC" -a -z "$CXX"; then
CXX="$CC"
fi
fi
diff --git a/set_soenv.in b/set_soenv.in
index 8e66789..14f59b3 100755
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -125,12 +125,8 @@ $JDK = '@JDK@';
$JAVAFLAGS = '@JAVAFLAGS@';
$MINGW = '@WITH_MINGW@'; # use MinGW for Windows build
$USE_MINGW = '@USE_MINGW@'; # use MinGW in cygwin or pure-mingw
-if ( $MINGW eq "yes" )
-{ $CC = '@CC@'; # C compiler
- $CXX = '@CXX@'; } # C++ compiler
-else
-{ $CC = PathFormat('@CC@'); # C compiler
- $CXX = PathFormat('@CXX@'); } # C++ compiler
+$CC = '@CC@'; # C compiler
+$CXX = '@CXX@'; # C++ compiler
$MOZILLA_VERSION = '@MOZILLA_VERSION@'; # mozilla version to use to build mozilla
$MOZILLA_TOOLKIT = '@MOZILLA_TOOLKIT@'; # GUI toolkit to use to build mozilla
$FLIPCMD = ""; # Flip '/' to '\' wrapper (only for winnt)
commit 35146032664093e90c2841e50d76f569df2adeb5
Author: Jan Holesovsky <kendy at suse.cz>
Date: Fri Apr 15 13:59:52 2011 +0200
Detect the prefix of the cl.exe -showIncludes output.
diff --git a/configure.in b/configure.in
index 922e3ec..c3741aa 100755
--- a/configure.in
+++ b/configure.in
@@ -2113,6 +2113,7 @@ fi
dnl ===================================================================
dnl Check which Microsoft C/C++ or MinGW compiler is used for WINNT
dnl ===================================================================
+SHOWINCLUDES_PREFIX=
if test "$_os" = "WINNT"; then
if test "$WITH_MINGW" != "yes"; then
AC_MSG_CHECKING([for a friendly Microsoft C/C++ compiler installation path])
@@ -2163,7 +2164,7 @@ if test "$_os" = "WINNT"; then
fi
if test -z "$MSPDB_PATH"; then
- AC_MSG_ERROR([You need a mspdb80.dllor mspdb100.dll, make sure it's in the path or use --with-mspdb-path])
+ AC_MSG_ERROR([You need a mspdb80.dllor mspdb100.dll, make sure it is in the path or use --with-mspdb-path])
fi
MSPDB_PATH=`cygpath -d "$MSPDB_PATH"`
MSPDB_PATH=`cygpath -u "$MSPDB_PATH"`
@@ -2222,6 +2223,19 @@ dnl The following find microsoft, matches nn.nn.nnnn then pulls numbers out
else
AC_MSG_ERROR([Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe.])
fi
+
+ dnl We need to guess the prefix of the -showIncludes output, it can be
+ dnl localized
+ AC_MSG_CHECKING([the dependency generation prefix (cl.exe -showIncludes)])
+ echo "#include <stdlib.h>" > conftest.c
+ SHOWINCLUDES_PREFIX=`$CC -c -showIncludes conftest.c 2>/dev/null | \
+ grep 'stdlib\.h' | head -n1 | sed 's/ [[[:alpha:]]]:.*//'`
+ rm -f conftest.c conftest.obj
+ if test -z "$SHOWINCLUDES_PREFIX" ; then
+ AC_MSG_ERROR([cannot determine the -showIncludes prefix])
+ else
+ AC_MSG_RESULT(["$SHOWINCLUDES_PREFIX"])
+ fi
else
AC_MSG_CHECKING([the MinGW C++ Compiler])
if test `$CC -dumpmachine | $SED -e 's/^.*-//'` = "mingw32"; then
@@ -2239,6 +2253,7 @@ fi
AC_SUBST(COMEX)
AC_SUBST(MSPDB_PATH)
AC_SUBST(USE_MINGW)
+AC_SUBST(SHOWINCLUDES_PREFIX)
dnl ===================================================================
dnl .NET needs special treatment
diff --git a/set_soenv.in b/set_soenv.in
index 2303ef6..8e66789 100755
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -78,7 +78,7 @@ my ( $oldPATH, $SRC_ROOT, $SO_HOME, $JAVA_HOME, $JDK, $JAVAFLAGS, $OOO_SHELL,
$SOLARSRC, $DEVROOT, $SOLARVER, $SOLARVERSION, $WORKDIR, $OUTDIR, $SOLARENV, $SOLARDEFIMG,
$STAR_INIROOT, $STAR_INIROOTOLD, $STAR_STANDLST, $STAR_SSCOMMON, $STAR_SSOLARINI,
$DMAKEROOT, $CLASSPATH, $XCLASSPATH, $COMPATH,
- $MSPDB_PATH, $MIDL_PATH, $CSC_PATH,
+ $MSPDB_PATH, $MIDL_PATH, $CSC_PATH, $SHOWINCLUDES_PREFIX,
$PATH, $SOLAREXTRAINC, $SOLAREXTRALIB, $SOLARLIB, $JAVALIB,
$SOLARINC, $LOCALINI, $FRAMEWORKSHOME, $COMEX, $PERL,
$COMP_ENV, $ILIB, $JAVAHOME, $PSDK_HOME, $DIRECTXSDK_LIB, $USE_NEW_SDK, $FRAME_HOME,
@@ -659,6 +659,7 @@ elsif ( $platform =~ m/cygwin/ )
$MSPDB_PATH = PathFormat('@MSPDB_PATH@');
$MIDL_PATH = PathFormat('@MIDL_PATH@');
$CSC_PATH = PathFormat('@CSC_PATH@');
+ $SHOWINCLUDES_PREFIX = '@SHOWINCLUDES_PREFIX@';
$PSDK_HOME = PathFormat('@PSDK_HOME@');
$DIRECTXSDK_LIB = PathFormat('@DIRECTXSDK_LIB@');
$USE_DIRECTX5 = "";
diff --git a/solenv/gbuild/filter-showIncludes.pl b/solenv/gbuild/filter-showIncludes.pl
index 3079ba0..f72a9eb 100755
--- a/solenv/gbuild/filter-showIncludes.pl
+++ b/solenv/gbuild/filter-showIncludes.pl
@@ -20,14 +20,19 @@ if ( !defined $outfile || !defined $objfile || !defined $srcfile ) {
die "Not enough parameters to create dependencies.";
}
+my $showincludes_prefix = $ENV{'SHOWINCLUDES_PREFIX'};
+if ( !defined( $showincludes_prefix ) || $showincludes_prefix eq "" ) {
+ $showincludes_prefix = 'Note: including file:';
+}
+
open( OUT, "> $outfile" ) or die "Cannot open $outfile for writing.";
print OUT "$objfile: \\\n $srcfile";
my %seen;
my $first_line = 1;
while ( <STDIN> ) {
- if ( /^Note: including file:/ ) {
- s/^Note: including file:\s*//;
+ if ( /^$showincludes_prefix/ ) {
+ s/^$showincludes_prefix\s*//;
s/\r$//;
chomp;
commit 002a0bc66923f9d8aec23f66678078b5c91bcae1
Author: Jan Holesovsky <kendy at suse.cz>
Date: Tue Apr 5 22:37:12 2011 +0200
Use cl.exe's -showIncludes to generate dependency files.
diff --git a/solenv/gbuild/filter-showIncludes.pl b/solenv/gbuild/filter-showIncludes.pl
new file mode 100755
index 0000000..3079ba0
--- /dev/null
+++ b/solenv/gbuild/filter-showIncludes.pl
@@ -0,0 +1,57 @@
+#!/usr/bin/env perl
+#
+# filter-showIncludes.pl depfile.d objfile.o orginal.cxx
+#
+# Create dependency information from the output of cl.exe's showInclude. It
+# needs additional information - the output name to which to write, objfile
+# that depends on the includes, and the original file name.
+#
+# It also consolidates the file names to a canonical form, and filters out
+# duplicates.
+#
+# LGPL v3 / GPL v3 / MPL 1.1
+#
+# Original author: Jan Holesovsky <kendy at suse.cz>
+
+my $outfile = $ARGV[0];
+my $objfile = $ARGV[1];
+my $srcfile = $ARGV[2];
+if ( !defined $outfile || !defined $objfile || !defined $srcfile ) {
+ die "Not enough parameters to create dependencies.";
+}
+
+open( OUT, "> $outfile" ) or die "Cannot open $outfile for writing.";
+print OUT "$objfile: \\\n $srcfile";
+
+my %seen;
+my $first_line = 1;
+while ( <STDIN> ) {
+ if ( /^Note: including file:/ ) {
+ s/^Note: including file:\s*//;
+ s/\r$//;
+
+ chomp;
+ s/\\/\//g;
+
+ # X: -> /cygdrive/x/
+ s/^(.):/\/cygdrive\/\l\1/;
+
+ s/ /\\ /g;
+
+ if ( !defined $seen{$_} ) {
+ $seen{$_} = 1;
+ print OUT " \\\n $_";
+ }
+ }
+ else {
+ # skip the first line, it always just duplicates what is being
+ # compiled
+ print unless ( $first_line );
+ }
+ $first_line = 0;
+}
+
+print OUT "\n";
+close( OUT ) or die "Cannot close $outfile.";
+
+# vim: shiftwidth=4 softtabstop=4 expandtab:
diff --git a/solenv/gbuild/platform/windows.mk b/solenv/gbuild/platform/windows.mk
index e0d611c..f9182c8 100755
--- a/solenv/gbuild/platform/windows.mk
+++ b/solenv/gbuild/platform/windows.mk
@@ -213,6 +213,16 @@ endif
gb_COMPILERNOOPTFLAGS := -Od
+ifeq ($(gb_FULLDEPS),$(true))
+gb_COMPILERDEPFLAGS := -showIncludes
+define gb_create_deps
+| $(GBUILDDIR)/filter-showIncludes.pl $(2) $(1) $(3)
+endef
+else
+gb_COMPILERDEPFLAGS :=
+define gb_create_deps
+endef
+endif
# Helper class
gb_Helper_SRCDIR_NATIVE := $(shell cygpath -m $(SRCDIR) | $(gb_AWK) -- '{ print tolower(substr($$0,1,1)) substr($$0,2) }')
@@ -241,27 +251,6 @@ endef
# CObject class
-ifeq ($(gb_FULLDEPS),$(true))
-define gb_CObject__command_deponcompile
-$(call gb_Helper_abbreviate_dirs_native,\
- $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
- $(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \
- -I$(dir $(3)) \
- $(filter-out -I$(COMPATH)% %/pch -I$(JAVA_HOME),$(6)) \
- $(3) \
- -f - \
- | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
- -v OBJECTFILE=$(1) \
- -v OUTDIR=$(OUTDIR)/ \
- -v WORKDIR=$(WORKDIR)/ \
- -v SRCDIR=$(SRCDIR)/ \
- -v REPODIR=$(REPODIR)/ \
- > $(call gb_CObject_get_dep_target,$(2)))
-endef
-else
-CObject__command_deponcompile =
-endif
-
define gb_CObject__command
$(call gb_Output_announce,$(2),$(true),C ,3)
$(call gb_Helper_abbreviate_dirs_native,\
@@ -270,37 +259,16 @@ $(call gb_Helper_abbreviate_dirs_native,\
$(gb_CC) \
$(DEFS) $(CFLAGS) -Fd$(PDBFILE) \
$(PCHFLAGS) \
+ $(gb_COMPILERDEPFLAGS) \
-I$(realpath $(dir $(3))) \
$(INCLUDE) \
-c $(realpath $(3)) \
- -Fo$(1))
-$(call gb_CObject__command_deponcompile,$(1),$(2),$(3),$(DEFS),$(CFLAGS),$(INCLUDE))
+ -Fo$(1)) $(call gb_create_deps,$(1),$(call gb_CObject_get_dep_target,$(2)),$(realpath $(3)))
endef
# CxxObject class
-ifeq ($(gb_FULLDEPS),$(true))
-define gb_CxxObject__command_deponcompile
-$(call gb_Helper_abbreviate_dirs_native,\
- $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
- $(filter-out -DPRECOMPILED_HEADERS,$(4)) $(5) \
- -I$(dir $(3)) \
- $(filter-out -I$(COMPATH)% %/pch -I$(JAVA_HOME),$(6)) \
- $(3) \
- -f - \
- | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
- -v OBJECTFILE=$(1) \
- -v OUTDIR=$(OUTDIR)/ \
- -v WORKDIR=$(WORKDIR)/ \
- -v SRCDIR=$(SRCDIR)/ \
- -v REPODIR=$(REPODIR)/ \
- > $(call gb_CxxObject_get_dep_target,$(2)))
- endef
-else
-gb_CxxObject__command_deponcompile =
-endif
-
define gb_CxxObject__command
$(call gb_Output_announce,$(2),$(true),CXX,3)
$(call gb_Helper_abbreviate_dirs_native,\
@@ -309,11 +277,11 @@ $(call gb_Helper_abbreviate_dirs_native,\
$(gb_CXX) \
$(DEFS) $(CXXFLAGS) -Fd$(PDBFILE)\
$(PCHFLAGS) \
+ $(gb_COMPILERDEPFLAGS) \
-I$(realpath $(dir $(3))) \
$(INCLUDE_STL) $(INCLUDE) \
-c $(realpath $(3)) \
- -Fo$(1))
-$(call gb_CxxObject__command_deponcompile,$(1),$(2),$(3),$(DEFS),$(CFLAGS),$(INCLUDE))
+ -Fo$(1)) $(call gb_create_deps,$(1),$(call gb_CxxObject_get_dep_target,$(2)),$(realpath $(3)))
endef
@@ -322,28 +290,6 @@ endef
gb_PrecompiledHeader_get_enableflags = -Yu$(1).hxx \
-Fp$(call gb_PrecompiledHeader_get_target,$(1))
-ifeq ($(gb_FULLDEPS),$(true))
-define gb_PrecompiledHeader__command_deponcompile
-$(call gb_Helper_abbreviate_dirs_native,\
- $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
- $(4) $(5) \
- -I$(dir $(3)) \
- $(filter-out -I$(COMPATH)% -I$(JAVA_HOME),$(6)) \
- $(3) \
- -f - \
- | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
- -v OBJECTFILE=$(1) \
- -v OUTDIR=$(OUTDIR)/ \
- -v WORKDIR=$(WORKDIR)/ \
- -v SRCDIR=$(SRCDIR)/ \
- -v REPODIR=$(REPODIR)/ \
- > $(call gb_PrecompiledHeader_get_dep_target,$(2)))
-endef
-else
-gb_PrecompiledHeader__command_deponcompile =
-endif
-
-
define gb_PrecompiledHeader__command
$(call gb_Output_announce,$(2),$(true),PCH,1)
$(call gb_Helper_abbreviate_dirs_native,\
@@ -351,11 +297,11 @@ $(call gb_Helper_abbreviate_dirs_native,\
unset INCLUDE && \
$(gb_CXX) \
$(4) $(5) -Fd$(PDBFILE) \
+ $(gb_COMPILERDEPFLAGS) \
-I$(realpath $(dir $(3))) \
$(6) \
-c $(realpath $(3)) \
- -Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -Fp$(1) -Fo$(1).obj)
-$(call gb_PrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6))
+ -Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -Fp$(1) -Fo$(1).obj) $(call gb_create_deps,$(1),$(call gb_PrecompiledHeader_get_dep_target,$(2)),$(realpath $(3)))
endef
# NoexPrecompiledHeader class
@@ -363,28 +309,6 @@ endef
gb_NoexPrecompiledHeader_get_enableflags = -Yu$(1).hxx \
-Fp$(call gb_NoexPrecompiledHeader_get_target,$(1))
-ifeq ($(gb_FULLDEPS),$(true))
-define gb_NoexPrecompiledHeader__command_deponcompile
-$(call gb_Helper_abbreviate_dirs_native,\
- $(OUTDIR)/bin/makedepend$(gb_Executable_EXT) \
- $(4) $(5) \
- -I$(dir $(3)) \
- $(filter-out -I$(COMPATH)% -I$(JAVA_HOME),$(6)) \
- $(3) \
- -f - \
- | $(gb_AWK) -f $(GBUILDDIR)/processdeps.awk \
- -v OBJECTFILE=$(1) \
- -v OUTDIR=$(OUTDIR)/ \
- -v WORKDIR=$(WORKDIR)/ \
- -v SRCDIR=$(SRCDIR)/ \
- -v REPODIR=$(REPODIR)/ \
- > $(call gb_NoexPrecompiledHeader_get_dep_target,$(2)))
-endef
-else
-gb_NoexPrecompiledHeader__command_deponcompile =
-endif
-
-
define gb_NoexPrecompiledHeader__command
$(call gb_Output_announce,$(2),$(true),PCH,1)
$(call gb_Helper_abbreviate_dirs_native,\
@@ -392,11 +316,11 @@ $(call gb_Helper_abbreviate_dirs_native,\
unset INCLUDE && \
$(gb_CXX) \
$(4) $(5) -Fd$(PDBFILE) \
+ $(gb_COMPILERDEPFLAGS) \
-I$(realpath $(dir $(3))) \
$(6) \
-c $(realpath $(3)) \
- -Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -Fp$(1) -Fo$(1).obj)
-$(call gb_NoexPrecompiledHeader__command_deponcompile,$(1),$(2),$(3),$(4),$(5),$(6))
+ -Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -Fp$(1) -Fo$(1).obj) $(call gb_create_deps,$(1),$(call gb_NoexPrecompiledHeader,$(2)),$(realpath $(3)))
endef
commit c1e16aa2c0820753b68de21977e4d518be5c958a
Author: Jan Holesovsky <kendy at suse.cz>
Date: Wed Apr 6 09:48:50 2011 +0200
Don't mention that we are updating autogen.lastrun.
diff --git a/autogen.sh b/autogen.sh
index 0dede71..471927f 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -97,7 +97,7 @@ if (defined $ENV{NOCONFIGURE}) {
print "Skipping configure process.";
} else {
if ($#cmdline_args > 0) {
- print "writing args to autogen.lastrun\n";
+# print "writing args to autogen.lastrun\n";
my $fh;
open ($fh, ">autogen.lastrun") || die "can't open autogen.lastrun: $!";
for my $arg (@cmdline_args) {
More information about the Libreoffice-commits
mailing list