[OS X Emacs] Re: [Emacs.app dev]: 9.0-rc3 released

Peter Dyballa Peter_Dyballa at Web.DE
Sat Dec 8 11:44:53 EST 2007


Hello!

Since the code for GNU Emacs 23.0.60 now has matured that one can  
think of compiling Emacs.app from it, I see a few problems. The  
compile script does not have among the NS_CFG_OPTS ``--without-carbon 
´´ which leads in Mac OS X to a configuration for a deprecated Carbon  
Emacs build. ``--without-carbon´´ should become a steady part of  
NS_CFG_OPTS.

On line #135 compile has:

	if [ x$locallisppath != x ]; then

which should better be

	if [ "x$locallisppath" != "x" ]; then

because $locallisppath can contain white space. Sorry, I forgot this  
"little" change in my patch from end of September!

The simple ``$MAKE´´ on compile's line #148 should become a ``$MAKE  
bootstrap´´. Or there should be a check whether the recommended `` 
$MAKE bootstrap´´ was done before and left something behind. There  
are probably marker files.

Finally the question when to correct the patched src/epaths.h file in  
case a local lisp path was given. I think the best place is after `` 
$MAKE bootstrap´´, the former ``$MAKE´´:

	echo "make install"
	$MAKE bootstrap
	status=$?
	# Correct patched src/epaths.h:
	if [ -f src/epaths.h-orig ]; then
	    mv src/epaths.h-orig src/epaths.h
	fi
	if [ $status != 0 ]; then
	    echo "*** Compilation failed. ***"

It's necessary to do it so early in order to avoid that the compile  
script ends with an exit before the patch to src/epaths.h was removed.

I also recommend to use an 'algorithm' to determine the number of  
compile jobs make is creating: one more than CPUs exist, or something  
else (I think the name hw.ncpu did not exist before Mac OS X 10.2.8):

	jobs=`/usr/sbin/sysctl hw.ncpu | awk '{print $NF}'`
	MAKE="make -j`expr $jobs + 1`"

So the difference between original and new compile becomes:

--- nextstep/compile.orig	2007-11-23 08:58:14.000000000 +0100
+++ nextstep/compile	2007-12-08 17:27:44.000000000 +0100
@@ -53,9 +53,10 @@
  # If you want to try experimental enhanced Ctrl-g support, add to  
NS_CFG_OPTS:
  # --enable-cocoa-experimental-ctrl-g
  # (See bottom of USAGE.txt)
-    NS_CFG_OPTS="--with-ns --without-x --prefix=${PREFIX} -- 
exec_prefix=${BASEDIR}/MacOS --libexecdir=${BASEDIR}/MacOS/libexec -- 
with-pop --enable-font-backend --without-freetype"
+    NS_CFG_OPTS="--with-ns --without-carbon --without-x --prefix=$ 
{PREFIX} --exec_prefix=${BASEDIR}/MacOS --libexecdir=${BASEDIR}/MacOS/ 
libexec --with-pop --enable-font-backend --without-freetype"
  # --enable-cocoa-experimental-ctrl-g"
-    MAKE="make -j3"
+    jobs=`/usr/sbin/sysctl hw.ncpu | awk '{print $NF}'`
+    MAKE="make -j`expr $jobs + 1`"
      export CC=gcc-4.0
      export MACOSX_DEPLOYMENT_TARGET=10.3
      export MACOSX_DEPLOYMENT_TARGET_ppc=10.3
@@ -116,9 +117,7 @@
  cd ..
  if [ ! -f config.log ]; then
      echo "./configure ${NS_CFG_OPTS}"
-./configure <<EOF ${NS_CFG_OPTS}
-EOF
-#    ./configure ${NS_CFG_OPTS}
+    ./configure ${NS_CFG_OPTS}
      if [ $? != 0 ]; then
          echo "*** Configure run failed. ***"
  	echo "Please examine the above output to determine what went wrong,"
@@ -132,8 +131,8 @@
  fi

  # Pete's addition for local lisp load-path
-if [ x$locallisppath != x ]; then
-    echo "Local lisp path is being enabled"
+if [ "x$locallisppath" != "x" ]; then
+    echo " * Local Lisp Path is being enabled"
      (cd src; mv epaths.h epaths.h-orig; \
         printf "s,\(#define PATH_LOADSEARCH \"\),\\\1%s:,\n" "$ 
{locallisppath}" > locallisppath.sed; \
         cat epaths.h-orig | sed -f locallisppath.sed > epaths.h; rm  
locallisppath.sed)
@@ -145,8 +144,13 @@

  # Go (installs binaries to ./build/Emacs.app, lisp to there or PREFIX)
  echo "make install"
-$MAKE
-if [ $? != 0 ]; then
+$MAKE bootstrap
+status=$?
+# Correct patched src/epaths.h:
+if [ -f src/epaths.h-orig ]; then
+    mv src/epaths.h-orig src/epaths.h
+fi
+if [ $status != 0 ]; then
      echo "*** Compilation failed. ***"
      echo "Please examine the above output to determine what went  
wrong,"
      echo "edit the configure options in this script (\'compile\')  
to fix it, and rerun."


--
Greetings

   Pete

Real Time, adj.:
	Here and now, as opposed to fake time, which only occurs there and  
then.






More information about the MacOSX-Emacs mailing list