Index: configure.in
===================================================================
RCS file: /sources/emacs/emacs/configure.in,v
retrieving revision 1.544
diff -u -r1.544 configure.in
--- configure.in	16 Jul 2008 23:24:39 -0000	1.544
+++ configure.in	17 Jul 2008 00:52:50 -0000
@@ -186,6 +186,11 @@
    EN_COCOA_EXPERIMENTAL_CTRL_G=yes,
    EN_COCOA_EXPERIMENTAL_CTRL_G=no)
 
+AC_ARG_ENABLE(ns-self-contained,
+[  --disable-ns-self-contained        disable self contained build under NS],
+   EN_NS_SELF_CONTAINED=no,
+   EN_NS_SELF_CONTAINED=yes)
+
 AC_ARG_ENABLE(asserts,
 [AS_HELP_STRING([--enable-asserts], [compile code with asserts enabled])],
       USE_XASSERTS=$enableval,
@@ -1230,8 +1235,12 @@
 if test "${with_ns}" != no; then
   if test "${opsys}" = darwin; then
      NS_IMPL_COCOA=yes
+     NS_SELFCONT_PREFIX=`pwd`/nextstep/Emacs.app/Contents/Resources
+     NS_EXEC_PREFIX=`pwd`/nextstep/Emacs.app/Contents/MacOS
   elif test -f /etc/GNUstep/GNUstep.conf; then
      NS_IMPL_GNUSTEP=yes
+     NS_SELFCONT_PREFIX=`pwd`/nextstep/Emacs.app/Resources
+     NS_EXEC_PREFIX=`pwd`/nextstep/Emacs.app
      GNUSTEP_SYSTEM_HEADERS="$(source /etc/GNUstep/GNUstep.conf; echo $GNUSTEP_SYSTEM_HEADERS)"
      GNUSTEP_SYSTEM_LIBRARIES="$(source /etc/GNUstep/GNUstep.conf; echo $GNUSTEP_SYSTEM_LIBRARIES)"
      CPPFLAGS="$CPPFLAGS -I${GNUSTEP_SYSTEM_HEADERS}"
@@ -1246,6 +1255,12 @@
   window_system=nextstep
   with_xft=no
   with_freetype=no
+  # set up packaging dirs
+  exec-prefix=${NS_EXEC_PREFIX}
+  libexecdir=${NS_EXEC_PREFIX}/libexec
+  if test "${EN_NS_SELF_CONTAINED}" = yes; then
+     prefix=${NS_SELFCONT_PREFIX}
+  fi
 fi
 CFLAGS="$tmp_CFLAGS"
 CPPFLAGS="$tmp_CPPFLAGS"
@@ -2901,10 +2916,26 @@
    echo
    echo "Warning: The Mac Carbon port is currently unsupported and has
 known problems.  It is not recommended for use by non-developers.
+The NeXTstep port (--with-ns) is an alternative.
 Read the emacs-devel archives for more information."
    echo
 fi
 
+if test "$HAVE_NS" = "yes"; then
+   echo
+   echo "You must run \"make install\" in order to test the built application.
+The installed application will go to nextstep/Emacs.app and can be
+run or moved from there."
+   if test "$EN_NS_SELF_CONTAINED" = "yes"; then
+      echo "The application will be fully self-contained."
+    else
+      echo "The lisp resources for the application will be installed under ${prefix}.
+You may need to run \"make install\" with sudo.  The application will fail
+to run if these resources are not installed."
+   fi
+   echo
+fi
+
 if test "$HAVE_DBUS" = yes && test "${opsys}" != "gnu-linux"; then
   echo "D-Bus integration has been tested for GNU/Linux only."
   echo
