@@ -147,7 +147,8 @@ LTCXXCOMPILE = \
$(LIBTOOL) --tag CXX \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CXX) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) \
+ -Xcompiler-static -UPIC
LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
@@ -406,7 +406,8 @@ LTCXXCOMPILE = \
$(LIBTOOL) --tag CXX \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CXX) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) \
+ -Xcompiler-static -UPIC
LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
@@ -1280,6 +1280,8 @@ func_mode_compile ()
$opt_debug
# Get the compilation command and the source file.
base_compile=
+ shared_compile=
+ static_compile=
srcfile="$nonopt" # always keep a non-empty value in "srcfile"
suppress_opt=yes
suppress_output=
@@ -1303,6 +1305,20 @@ func_mode_compile ()
continue
;;
+ xcompiler-shared )
+ arg_mode=normal
+ func_quote_for_eval "$arg"
+ shared_compile="$shared_compile $func_quote_for_eval_result"
+ continue
+ ;;
+
+ xcompiler-static )
+ arg_mode=normal
+ func_quote_for_eval "$arg"
+ static_compile="$static_compile $func_quote_for_eval_result"
+ continue
+ ;;
+
normal )
# Accept any command-line options.
case $arg in
@@ -1333,6 +1349,18 @@ func_mode_compile ()
continue # The current "srcfile" will either be retained or
;; # replaced later. I would guess that would be a bug.
+ -Xcompiler-shared)
+ arg_mode=xcompiler-shared # the next one goes into the
+ # "shared_compile" arg list
+ continue
+ ;;
+
+ -Xcompiler-static)
+ arg_mode=xcompiler-static # the next one goes into the
+ # "static_compile" arg list
+ continue
+ ;;
+
-Wc,*)
func_stripname '-Wc,' '' "$arg"
args=$func_stripname_result
@@ -1516,10 +1544,10 @@ compiler."
fbsd_hideous_sh_bug=$base_compile
if test "$pic_mode" != no; then
- command="$base_compile $qsrcfile $pic_flag"
+ command="$base_compile $qsrcfile $pic_flag $shared_compile"
else
# Don't build PIC code
- command="$base_compile $qsrcfile"
+ command="$base_compile $qsrcfile $shared_compile"
fi
func_mkdir_p "$xdir$objdir"
@@ -1568,9 +1596,9 @@ compiler."
if test "$build_old_libs" = yes; then
if test "$pic_mode" != yes; then
# Don't build PIC code
- command="$base_compile $qsrcfile$pie_flag"
+ command="$base_compile $qsrcfile$pie_flag $static_compile"
else
- command="$base_compile $qsrcfile $pic_flag"
+ command="$base_compile $qsrcfile $pic_flag $static_compile"
fi
if test "$compiler_c_o" = yes; then
command="$command -o $obj"
@@ -1664,6 +1692,12 @@ This mode accepts the following additional options:
-shared do not build a \`.o' file suitable for static linking
-static only build a \`.o' file suitable for static linking
-Wc,FLAG pass FLAG directly to the compiler
+ -Xcompiler-shared FLAG
+ pass FLAG directly to the compiler when compiling shared
+ libraries
+ -Xcompiler-static FLAG
+ pass FLAG directly to the compiler when compiling static
+ libraries
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
from the given SOURCEFILE.