Bug 438397 - "-fshort-wchar shouldn't be hardcoded in pkgconfig" [r=bsmedberg]
authorRiku Voipio / Mike Hommey <mh+mozilla@glandium.org>
Mon, 20 Oct 2008 22:25:16 -0500
changeset 20702 c4c46a5f96819c226600bc3aa32e348e6cbc651d
parent 20701 49b6ae6afcc4ac6c30b47e653b29b9764570531c
child 20703 6e9a29a235ce506b4ca35fabefa34b48033beb69
push id3072
push userreed@reedloden.com
push dateTue, 21 Oct 2008 03:25:24 +0000
treeherderautoland@c4c46a5f9681 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs438397
milestone1.9.1b2pre
Bug 438397 - "-fshort-wchar shouldn't be hardcoded in pkgconfig" [r=bsmedberg]
config/autoconf.mk.in
configure.in
xulrunner/installer/Makefile.in
xulrunner/installer/libxul-embedding-unstable.pc.in
xulrunner/installer/libxul-embedding.pc.in
xulrunner/installer/libxul-unstable.pc.in
xulrunner/installer/libxul.pc.in
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -261,16 +261,18 @@ MOZ_INSURIFYING = @MOZ_INSURIFYING@
 MOZ_INSURE_DIRS = @MOZ_INSURE_DIRS@
 MOZ_INSURE_EXCLUDE_DIRS = @MOZ_INSURE_EXCLUDE_DIRS@
 
 MOZ_NATIVE_NSPR = @MOZ_NATIVE_NSPR@
 MOZ_NATIVE_NSS = @MOZ_NATIVE_NSS@
 
 CROSS_COMPILE   = @CROSS_COMPILE@
 
+WCHAR_CFLAGS	= @WCHAR_CFLAGS@
+
 OS_CPPFLAGS	= @CPPFLAGS@
 OS_CFLAGS	= $(OS_CPPFLAGS) @CFLAGS@
 OS_CXXFLAGS	= $(OS_CPPFLAGS) @CXXFLAGS@
 OS_LDFLAGS	= @LDFLAGS@
 
 OS_COMPILE_CFLAGS = $(OS_CPPFLAGS) @COMPILE_CFLAGS@
 OS_COMPILE_CXXFLAGS = $(OS_CPPFLAGS) @COMPILE_CXXFLAGS@
 
--- a/configure.in
+++ b/configure.in
@@ -2777,16 +2777,17 @@ dnl Note that we assume that mac & win32
                      [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
                       CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
                      ac_cv_have_usable_wchar_option_v2="yes",
                      ac_cv_have_usable_wchar_option_v2="no")])
 
     if test "$ac_cv_have_usable_wchar_option_v2" = "yes"; then
         AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
         HAVE_CPP_2BYTE_WCHAR_T=1
+        WCHAR_CFLAGS="-fshort-wchar"
     else    
         CXXFLAGS=$_SAVE_CXXFLAGS
     fi
     AC_LANG_RESTORE
 fi
 
 dnl Check for .hidden assembler directive and visibility attribute.
 dnl Borrowed from glibc configure.in
@@ -7932,16 +7933,17 @@ AC_SUBST(MOZ_NATIVE_NSS)
 AC_SUBST(CFLAGS)
 AC_SUBST(CXXFLAGS)
 AC_SUBST(CPPFLAGS)
 AC_SUBST(COMPILE_CFLAGS)
 AC_SUBST(COMPILE_CXXFLAGS)
 AC_SUBST(LDFLAGS)
 AC_SUBST(LIBS)
 AC_SUBST(CROSS_COMPILE)
+AC_SUBST(WCHAR_CFLAGS)
 
 AC_SUBST(HOST_CC)
 AC_SUBST(HOST_CXX)
 AC_SUBST(HOST_CFLAGS)
 AC_SUBST(HOST_CXXFLAGS)
 AC_SUBST(HOST_OPTIMIZE_FLAGS)
 AC_SUBST(HOST_AR)
 AC_SUBST(HOST_AR_FLAGS)
--- a/xulrunner/installer/Makefile.in
+++ b/xulrunner/installer/Makefile.in
@@ -113,16 +113,17 @@ endif
 %.pc: $(srcdir)/%.pc.in Makefile.in Makefile $(DEPTH)/config/autoconf.mk
 	cat $< | sed \
 	-e "s|%prefix%|$(prefix)|" \
 	-e "s|%includedir%|$(includedir)|" \
 	-e "s|%idldir%|$(idldir)|" \
 	-e "s|%sdkdir%|$(sdkdir)|" \
 	-e "s|%MOZ_APP_NAME%|$(MOZ_APP_NAME)|" \
 	-e "s|%MOZILLA_VERSION%|$(MOZ_APP_VERSION)|" \
+	-e "s|%WCHAR_CFLAGS%|$(WCHAR_CFLAGS)|" \
 	-e "s|%FULL_NSPR_LIBS%|$(FULL_NSPR_LIBS)|" \
 	-e "s|%FULL_NSPR_CFLAGS%|$(FULL_NSPR_CFLAGS)|" \
 	-e "s|%NSPR_NAME%|$(NSPR_NAME)|" \
 	-e "s|%NSPR_VERSION%|$(NSPR_VERSION)|" > $@
 	chmod 644 $@
 
 install:: $(pkg_config_files)
 	@echo pkg_config_file: $(pkg_config_files)
--- a/xulrunner/installer/libxul-embedding-unstable.pc.in
+++ b/xulrunner/installer/libxul-embedding-unstable.pc.in
@@ -3,9 +3,9 @@ sdkdir=%sdkdir%
 includedir=%includedir%
 idldir=%idldir%
 includetype=unstable
 
 Name: libxul-embedding-unstable
 Description: Static library for version-independent embedding of the Mozilla runtime (unstable API)
 Version: %MOZILLA_VERSION%
 Libs: -L${sdkdir}/lib -lxpcomglue
-Cflags: -DXPCOM_GLUE -I${includedir}/${includetype} -fshort-wchar
+Cflags: -DXPCOM_GLUE -I${includedir}/${includetype} %WCHAR_CFLAGS%
--- a/xulrunner/installer/libxul-embedding.pc.in
+++ b/xulrunner/installer/libxul-embedding.pc.in
@@ -7,9 +7,9 @@ includetype=stable
 # Note: the default pkg-config cflags will only list include directories
 # that contain stable (frozen or safe for linking) header files. To include
 # nonfrozen headers, run pkg-config with --define-variable=includetype=unstable
 
 Name: libxul-embedding
 Description: Static library for version-independent embedding of the Mozilla runtime
 Version: %MOZILLA_VERSION%
 Libs: -L${sdkdir}/lib -lxpcomglue
-Cflags: -DXPCOM_GLUE -I${includedir}/${includetype} -fshort-wchar
+Cflags: -DXPCOM_GLUE -I${includedir}/${includetype} %WCHAR_CFLAGS%
--- a/xulrunner/installer/libxul-unstable.pc.in
+++ b/xulrunner/installer/libxul-unstable.pc.in
@@ -4,9 +4,9 @@ includedir=%includedir%
 idldir=%idldir%
 includetype=unstable
 
 Name: libxul
 Description: The Mozilla Runtime and Embedding Engine (unstable API)
 Version: %MOZILLA_VERSION%
 Requires: %NSPR_NAME% >= %NSPR_VERSION%
 Libs: -L${sdkdir}/lib -lxpcomglue_s -lxul -lxpcom
-Cflags: -I${includedir}/${includetype} -fshort-wchar
+Cflags: -I${includedir}/${includetype} %WCHAR_CFLAGS%
--- a/xulrunner/installer/libxul.pc.in
+++ b/xulrunner/installer/libxul.pc.in
@@ -8,9 +8,9 @@ includetype=stable
 # that contain stable (frozen or safe for linking) header files. To include
 # nonfrozen headers, run pkg-config with --define-variable=includetype=unstable
 
 Name: libxul
 Description: The Mozilla Runtime and Embedding Engine
 Version: %MOZILLA_VERSION%
 Requires: %NSPR_NAME% >= %NSPR_VERSION%
 Libs: -L${sdkdir}/lib -lxpcomglue_s -lxul -lxpcom
-Cflags: -I${includedir}/${includetype} -fshort-wchar
\ No newline at end of file
+Cflags: -I${includedir}/${includetype} %WCHAR_CFLAGS%