Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
9824eda6
Commit
9824eda6
authored
May 06, 2009
by
kenton@google.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable cross-compiling
parent
42c81e1a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
0 deletions
+59
-0
CHANGES.txt
CHANGES.txt
+2
-0
README.txt
README.txt
+23
-0
configure.ac
configure.ac
+24
-0
Makefile.am
src/Makefile.am
+10
-0
No files found.
CHANGES.txt
View file @
9824eda6
...
...
@@ -29,6 +29,8 @@
optional int32 foo = 1 [deprecated = true];
Currently this does not have any actual effect, but in the future the code
generators may generate deprecation annotations in each language.
* Cross-compiling should now be possible using the --with-protoc option to
configure. See README.txt for more info.
protoc
* --error_format=msvs option causes errors to be printed in Visual Studio
...
...
README.txt
View file @
9824eda6
...
...
@@ -33,6 +33,29 @@ For advanced usage information on configure and make, see INSTALL.txt.
If you already built the package with a different prefix, make sure
to run "make clean" before building again.
** Note for cross-compiling **
The makefiles normally invoke the protoc executable that they just
built in order to build tests. When cross-compiling, the protoc
executable may not be executable on the host machine. In this case,
you must build a copy of protoc for the host machine first, then use
the --with-protoc option to tell configure to use it instead. For
example:
./configure --with-protoc=protoc
This will use the installed protoc (found in your $PATH) instead of
trying to execute the one built during the build process. You can
also use an executable that hasn't been installed. For example, if
you built the protobuf package for your host machine in ../host,
you might do:
./configure --with-protoc=../host/src/protoc
Either way, you must make sure that the protoc executable you use
has the same version as the protobuf source code you are trying to
use it with.
** Note for Solaris users **
Solaris 10 x86 has a bug that will make linking fail, complaining
...
...
configure.ac
View file @
9824eda6
...
...
@@ -30,6 +30,11 @@ AC_ARG_WITH([zlib],
[include classes for streaming compressed data in and out @<:@default=check@:>@])],
[],[with_zlib=check])
AC_ARG_WITH([protoc],
[AS_HELP_STRING([--with-protoc=COMMAND],
[use the given protoc command instead of building a new one when building tests (useful for cross-compiling)])],
[],[with_protoc=no])
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
...
...
@@ -90,6 +95,25 @@ AS_IF([test "$with_zlib" != no],
fi])])
AM_CONDITIONAL([HAVE_ZLIB], [test $HAVE_ZLIB = 1])
AS_IF([test "$with_protoc" != "no"], [
PROTOC=$with_protoc
AS_IF([test "$with_protoc" == "yes"], [
# No argument given. Use system protoc.
PROTOC=protoc
])
AS_IF([echo "$PROTOC" | grep -q '^@<:@^/@:>@.*/'], [
# Does not start with a slash, but contains a slash. So, it's a relative
# path (as opposed to an absolute path or an executable in $PATH).
# Since it will actually be executed from the src directory, prefix with
# the current directory. We also insert $ac_top_build_prefix in case this
# is a nested package and --with-protoc was actually given on the outer
# package's configure script.
PROTOC=`pwd`/${ac_top_build_prefix}$PROTOC
])
AC_SUBST([PROTOC])
])
AM_CONDITIONAL([USE_EXTERNAL_PROTOC], [test "$with_protoc" != "no"])
ACX_PTHREAD
AC_CXX_STL_HASH
...
...
src/Makefile.am
View file @
9824eda6
...
...
@@ -206,6 +206,14 @@ protoc_outputs = \
BUILT_SOURCES
=
$(protoc_outputs)
if
USE_EXTERNAL_PROTOC
unittest_proto_middleman
:
$(protoc_inputs)
$(PROTOC)
-I
$(srcdir)
--cpp_out
=
.
$(protoc_inputs)
touch
unittest_proto_middleman
else
# This rule is a little weird. The first prereq is the protoc executable
# and the rest are its inputs. Therefore, $^ -- which expands to the
# list of prereqs -- is actually a valid command. We have to place "./" in
...
...
@@ -220,6 +228,8 @@ unittest_proto_middleman: protoc$(EXEEXT) $(protoc_inputs)
./
$^
-I
$(srcdir)
--cpp_out
=
.
touch
unittest_proto_middleman
endif
$(protoc_outputs)
:
unittest_proto_middleman
COMMON_TEST_SOURCES
=
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment