Bug 397796 - "Allow XULRunner apps to specify the name of xulrunner-stub via configure". r+a=luser.
authorbent.mozilla@gmail.com
Thu, 11 Oct 2007 11:50:54 -0700
changeset 6837 35b8524bf77a0a991db0cd1ff5b6c1df508d55bb
parent 6836 8aef0b3d0e711aed03e6fadbd7995db7c638eea0
child 6838 50eb6bd3f5357adefc66c27646314ac893448b44
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
bugs397796
milestone1.9a9pre
Bug 397796 - "Allow XULRunner apps to specify the name of xulrunner-stub via configure". r+a=luser.
config/autoconf.mk.in
configure.in
xulrunner/stub/Makefile.in
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -71,16 +71,18 @@ DIST		= $(DEPTH)/dist
 LIBXUL_SDK      = @LIBXUL_SDK@
 
 ifdef LIBXUL_SDK
 LIBXUL_DIST = $(LIBXUL_SDK)
 else
 LIBXUL_DIST = $(DIST)
 endif
 
+XULRUNNER_STUB_NAME = @XULRUNNER_STUB_NAME@
+
 MOZ_CHROME_FILE_FORMAT	= @MOZ_CHROME_FILE_FORMAT@
 
 MOZ_WIDGET_TOOLKIT	= @MOZ_WIDGET_TOOLKIT@
 MOZ_GFX_TOOLKIT		= @MOZ_GFX_TOOLKIT@
 MOZ_X11			= @MOZ_X11@
 
 MOZ_JS_LIBS		   = @MOZ_JS_LIBS@
 
--- a/configure.in
+++ b/configure.in
@@ -4361,16 +4361,31 @@ minimal)
   AC_MSG_ERROR([Unrecognized value: --with-embedding-profile=$MOZ_EMBEDDING_PROFILE])
   ;;
 esac
 
 AC_SUBST(MOZ_EMBEDDING_LEVEL_DEFAULT)
 AC_SUBST(MOZ_EMBEDDING_LEVEL_BASIC)
 AC_SUBST(MOZ_EMBEDDING_LEVEL_MINIMAL)
 
+MOZ_ARG_WITH_STRING(xulrunner-stub-name,
+[  --with-xulrunner-stub-name=appname   Create the xulrunner stub with the given name],
+  XULRUNNER_STUB_NAME=$withval)
+
+if test -z "$XULRUNNER_STUB_NAME"; then
+  case "$target_os" in
+  darwin*)
+    XULRUNNER_STUB_NAME=xulrunner
+    ;;
+  *)
+    XULRUNNER_STUB_NAME=xulrunner-stub
+  esac
+fi
+AC_SUBST(XULRUNNER_STUB_NAME)
+
 if test -z "$MOZ_BUILD_APP"; then
   AC_MSG_ERROR([--enable-application=APP was not specified and is required.])
 else
   # We have a valid application only if it has a build.mk file in its top
   # directory.
   if test ! -f "${srcdir}/${MOZ_BUILD_APP}/build.mk" ; then
     AC_MSG_ERROR([--enable-application value not recognized (${MOZ_BUILD_APP}/build.mk does not exist).])
   fi
--- a/xulrunner/stub/Makefile.in
+++ b/xulrunner/stub/Makefile.in
@@ -46,25 +46,21 @@ MODULE    = xulrunner
 
 REQUIRES  = xpcom xulapp
 
 CPPSRCS   = nsXULStub.cpp
 
 # Statically link the CRT when possible
 USE_STATIC_LIBS = 1
 
-ifeq ($(OS_ARCH),Darwin)
-
-PROGRAM   = xulrunner$(BIN_SUFFIX)
-
-else
-
-PROGRAM   = xulrunner-stub$(BIN_SUFFIX)
-
-endif # OS_ARCH
+# The value of XULRUNNER_STUB_NAME is generated by configure to allow XULRunner
+# apps to override it using the --with-xulrunner-stub-name=<appname> argument.
+# If this configure argument is not present then the default name is 'xulrunner'
+# for Mac OS X and 'xulrunner-stub' for all other platforms.
+PROGRAM   = $(XULRUNNER_STUB_NAME)$(BIN_SUFFIX)
 
 LOCAL_INCLUDES = -I$(topsrcdir)/xpcom/build
 
 DEFINES  += -DXPCOM_GLUE
 
 LIBS = \
   $(XPCOM_STANDALONE_GLUE_LDOPTS) \
   $(NULL)