To: vim-dev@vim.org Subject: Patch 6.2.142 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.142 (after 6.2.124) Problem: Mac: building without GUI through configure doesn't work. When the system is slow, unpacking the resource file takes too long. Solution: Don't always define FEAT_GUI_MAC when MACOS is defined, define it in the Makefile. Add a configure option to skip Darwin detection. Use a Python script to unpack the resources to avoid a race condition. (Taro Muraoka) Files: Makefile, src/Makefile, src/auto/configure, src/configure.in, src/dehqx.py, src/vim.h *** ../vim-6.2.141/Makefile Fri Oct 17 11:55:09 2003 --- Makefile Sun Nov 2 15:33:24 2003 *************** *** 505,510 **** --- 505,511 ---- SRC_MAC = \ src/INSTALLmac.txt \ src/Make_mpw.mak \ + src/dehqx.py \ src/gui_mac.c \ src/gui_mac.icns \ src/gui_mac.r \ *** ../vim-6.2.141/src/Makefile Fri Oct 17 12:08:46 2003 --- src/Makefile Sun Nov 2 13:26:45 2003 *************** *** 24,29 **** --- 24,31 ---- # - Uncomment the line with --disable-gui if you have Motif, GTK and/or # Athena but don't want to make gvim (the GUI version of Vim with nice # menus and scrollbars, but makes Vim bigger and startup slower). + # - Uncomment --disable-darwin if on Mac OS X but you want to compile a + # Unix version. # - Uncomment the line "CONF_OPT_X = --without-x" if you have X11 but # want to disable using X11 libraries. This speeds up starting Vim, # but the window title will not be set and the X11 selection can not *************** *** 340,345 **** --- 342,352 ---- #CONF_OPT_GUI = --enable-gui=athena #CONF_OPT_GUI = --enable-gui=nextaw + # DARWIN - detecting Mac OS X + # Uncomment this line when you want to compile a Unix version of Vim on + # Darwin. None of the Mac specific options or files will be used. + #CONF_OPT_DARWIN = --disable-darwin + # PERL - For creating Vim with Perl interface # Uncomment this when you want to include the Perl interface. # The Perl option sometimes causes problems, because it adds extra flags *************** *** 1132,1147 **** PHOTONGUI_TESTTARGET = gui # CARBON GUI ! CARBONGUI_SRC = gui.c gui_mac.c ! CARBONGUI_OBJ = objects/gui.o objects/gui_mac.o objects/pty.o ! CARBONGUI_DEFS = -arch ppc -fno-common -fpascal-strings \ -Wall -Wno-unknown-pragmas \ -mdynamic-no-pic -pipe ! CARBONGUI_IPATH = -I. -Iproto -I/Developer/Headers/FlatCarbon CARBONGUI_LIBS_DIR = CARBONGUI_LIBS1 = -framework Carbon CARBONGUI_LIBS2 = -ltermcap ! CARBONGUI_INSTALL = gui_mac.rsrc install_macosx CARBONGUI_TARGETS = CARBONGUI_MAN_TARGETS = CARBONGUI_TESTTARGET = --- 1139,1154 ---- PHOTONGUI_TESTTARGET = gui # CARBON GUI ! CARBONGUI_SRC = gui.c gui_mac.c ! CARBONGUI_OBJ = objects/gui.o objects/gui_mac.o objects/pty.o ! CARBONGUI_DEFS = -DFEAT_GUI_MAC -arch ppc -fno-common -fpascal-strings \ -Wall -Wno-unknown-pragmas \ -mdynamic-no-pic -pipe ! CARBONGUI_IPATH = -I. -Iproto CARBONGUI_LIBS_DIR = CARBONGUI_LIBS1 = -framework Carbon CARBONGUI_LIBS2 = -ltermcap ! CARBONGUI_INSTALL = install_macosx CARBONGUI_TARGETS = CARBONGUI_MAN_TARGETS = CARBONGUI_TESTTARGET = *************** *** 1429,1435 **** CC="$(CC)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" \ LDFLAGS="$(LDFLAGS)" $(CONF_SHELL) srcdir="$(srcdir)" \ ./configure $(CONF_OPT_GUI) $(CONF_OPT_X) $(CONF_OPT_XSMP) \ ! $(CONF_OPT_PERL) $(CONF_OPT_PYTHON) \ $(CONF_OPT_TCL) $(CONF_OPT_RUBY) \ $(CONF_OPT_CSCOPE) $(CONF_OPT_MULTIBYTE) $(CONF_OPT_INPUT) \ $(CONF_OPT_OUTPUT) $(CONF_OPT_GPM) $(CONF_OPT_WORKSHOP) \ --- 1436,1442 ---- CC="$(CC)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" \ LDFLAGS="$(LDFLAGS)" $(CONF_SHELL) srcdir="$(srcdir)" \ ./configure $(CONF_OPT_GUI) $(CONF_OPT_X) $(CONF_OPT_XSMP) \ ! $(CONF_OPT_DARWIN) $(CONF_OPT_PERL) $(CONF_OPT_PYTHON) \ $(CONF_OPT_TCL) $(CONF_OPT_RUBY) \ $(CONF_OPT_CSCOPE) $(CONF_OPT_MULTIBYTE) $(CONF_OPT_INPUT) \ $(CONF_OPT_OUTPUT) $(CONF_OPT_GPM) $(CONF_OPT_WORKSHOP) \ *************** *** 2309,2315 **** ### This creates a runnable Vim.app in the src directory REZ = /Developer/Tools/Rez - RESMRG = /Developer/Tools/ResMerger APPDIR = $(VIMNAME).app RESDIR = $(APPDIR)/Contents/Resources # FIXME: i'm sure someone else can do something clever with grep --- 2316,2321 ---- *************** *** 2353,2370 **** ### Classic resources # Resource fork (in the form of a .rsrc file) for Classic Vim (Mac OS 9) # This file is also required for OS X Vim. ! bundle-rsrc: gui_mac.rsrc @echo "Creating resource fork" ! $(RESMRG) gui_mac.rsrc -dstIs DF -o $(RESDIR)/$(VIMNAME).rsrc ! ! gui_mac.rsrc: ! open os_mac.rsr.hqx ! sleep 1 ! @echo ! @echo "--------------------" ! @echo "If this fails, run make install again after StuffIt Expander quits." ! @echo "--------------------" ! @echo # po/Make_osx.pl says something about generating a Mac message file # for Ukrananian. Would somebody using Mac OS X in Ukranian --- 2359,2369 ---- ### Classic resources # Resource fork (in the form of a .rsrc file) for Classic Vim (Mac OS 9) # This file is also required for OS X Vim. ! bundle-rsrc: os_mac.rsr.hqx @echo "Creating resource fork" ! python dehqx.py $< ! rm -f gui_mac.rsrc ! mv gui_mac.rsrc.rsrcfork $(RESDIR)/$(VIMNAME).rsrc # po/Make_osx.pl says something about generating a Mac message file # for Ukrananian. Would somebody using Mac OS X in Ukranian *** ../vim-6.2.141/src/auto/configure Wed Oct 29 14:51:49 2003 --- src/auto/configure Sun Nov 2 15:28:41 2003 *************** *** 12,17 **** --- 12,19 ---- ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help + --disable-darwin Disable Darwin (Mac OS X) support." + ac_help="$ac_help --with-vim-name=NAME what to call the Vim executable" ac_help="$ac_help --with-ex-name=NAME what to call the Ex executable" *************** *** 1173,1199 **** DEFAULT_VIMNAME=vim echo $ac_n "checking for Darwin (Mac OS X)""... $ac_c" 1>&6 ! echo "configure:1177: checking for Darwin (Mac OS X)" >&5 if test "`(uname) 2>/dev/null`" = Darwin; then echo "$ac_t""yes" 1>&6 - MACOSX=yes - OS_EXTRA_SCR="os_macosx.c"; - OS_EXTRA_OBJ="objects/os_macosx.o" - CFLAGS="$CFLAGS -DMACOS_X_UNIX -no-cpp-precomp" ! ac_safe=`echo "Carbon/Carbon.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Carbon/Carbon.h""... $ac_c" 1>&6 ! echo "configure:1187: checking for Carbon/Carbon.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1197: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* --- 1175,1227 ---- DEFAULT_VIMNAME=vim echo $ac_n "checking for Darwin (Mac OS X)""... $ac_c" 1>&6 ! echo "configure:1179: checking for Darwin (Mac OS X)" >&5 if test "`(uname) 2>/dev/null`" = Darwin; then echo "$ac_t""yes" 1>&6 ! echo $ac_n "checking --disable-darwin argument""... $ac_c" 1>&6 ! echo "configure:1184: checking --disable-darwin argument" >&5 ! # Check whether --enable-darwin or --disable-darwin was given. ! if test "${enable_darwin+set}" = set; then ! enableval="$enable_darwin" ! : ! else ! enable_darwin="yes" ! fi ! ! if test "$enable_darwin" = "yes"; then ! echo "$ac_t""no" 1>&6 ! echo $ac_n "checking if Darwin files are there""... $ac_c" 1>&6 ! echo "configure:1196: checking if Darwin files are there" >&5 ! if test -f os_macosx.c; then ! echo "$ac_t""yes" 1>&6 ! else ! echo "$ac_t""no, Darwin support disabled" 1>&6 ! enable_darwin=no ! fi ! else ! echo "$ac_t""yes, Darwin support excluded" 1>&6 ! fi ! ! if test "$enable_darwin" = "yes"; then ! MACOSX=yes ! OS_EXTRA_SCR="os_macosx.c"; ! OS_EXTRA_OBJ="objects/os_macosx.o" ! CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp" ! ! ac_safe=`echo "Carbon/Carbon.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for Carbon/Carbon.h""... $ac_c" 1>&6 ! echo "configure:1215: checking for Carbon/Carbon.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ! { (eval echo configure:1225: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* *************** *** 1214,1223 **** echo "$ac_t""no" 1>&6 fi ! if test "x$CARBON" = "xyes"; then ! if test -z "$with_x"; then ! with_x=no ! DEFAULT_VIMNAME=Vim fi fi else --- 1242,1252 ---- echo "$ac_t""no" 1>&6 fi ! if test "x$CARBON" = "xyes"; then ! if test -z "$with_x"; then ! with_x=no ! DEFAULT_VIMNAME=Vim ! fi fi fi else *** ../vim-6.2.141/src/configure.in Wed Oct 29 14:51:49 2003 --- src/configure.in Sun Nov 2 13:08:39 2003 *************** *** 82,99 **** AC_MSG_CHECKING([for Darwin (Mac OS X)]) if test "`(uname) 2>/dev/null`" = Darwin; then AC_MSG_RESULT(yes) - MACOSX=yes - OS_EXTRA_SCR="os_macosx.c"; - OS_EXTRA_OBJ="objects/os_macosx.o" - CFLAGS="$CFLAGS -DMACOS_X_UNIX -no-cpp-precomp" ! dnl If Carbon is found, assume we don't want X11 ! dnl unless it was specifically asked for (--with-x) ! AC_CHECK_HEADER(Carbon/Carbon.h, CARBON=yes) ! if test "x$CARBON" = "xyes"; then ! if test -z "$with_x"; then ! with_x=no ! DEFAULT_VIMNAME=Vim fi fi else --- 82,119 ---- AC_MSG_CHECKING([for Darwin (Mac OS X)]) if test "`(uname) 2>/dev/null`" = Darwin; then AC_MSG_RESULT(yes) ! AC_MSG_CHECKING(--disable-darwin argument) ! AC_ARG_ENABLE(darwin, ! [ --disable-darwin Disable Darwin (Mac OS X) support.], ! , [enable_darwin="yes"]) ! if test "$enable_darwin" = "yes"; then ! AC_MSG_RESULT(no) ! AC_MSG_CHECKING(if Darwin files are there) ! if test -f os_macosx.c; then ! AC_MSG_RESULT(yes) ! else ! AC_MSG_RESULT([no, Darwin support disabled]) ! enable_darwin=no ! fi ! else ! AC_MSG_RESULT([yes, Darwin support excluded]) ! fi ! ! if test "$enable_darwin" = "yes"; then ! MACOSX=yes ! OS_EXTRA_SCR="os_macosx.c"; ! OS_EXTRA_OBJ="objects/os_macosx.o" ! CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp" ! ! dnl If Carbon is found, assume we don't want X11 ! dnl unless it was specifically asked for (--with-x) ! AC_CHECK_HEADER(Carbon/Carbon.h, CARBON=yes) ! if test "x$CARBON" = "xyes"; then ! if test -z "$with_x"; then ! with_x=no ! DEFAULT_VIMNAME=Vim ! fi fi fi else *** ../vim-6.2.141/src/dehqx.py Sun Nov 2 15:34:05 2003 --- src/dehqx.py Sat Oct 25 16:19:34 2003 *************** *** 0 **** --- 1,40 ---- + # Python script to get both the data and resource fork from a BinHex encoded + # file. + # Author: Taro Muraoka + # Last Change: 2003 Oct 25 + + import sys + import binhex + + input = sys.argv[1] + conv = binhex.HexBin(input) + info = conv.FInfo + out = conv.FName + out_data = out + out_rsrc = out + '.rsrcfork' + #print 'out_rsrc=' + out_rsrc + print 'In file: ' + input + + outfile = open(out_data, 'wb') + print ' Out data fork: ' + out_data + while 1: + d = conv.read(128000) + if not d: break + outfile.write(d) + outfile.close() + conv.close_data() + + d = conv.read_rsrc(128000) + if d: + print ' Out rsrc fork: ' + out_rsrc + outfile = open(out_rsrc, 'wb') + outfile.write(d) + while 1: + d = conv.read_rsrc(128000) + if not d: break + outfile.write(d) + outfile.close() + + conv.close() + + # vim:set ts=8 sts=4 sw=4 et: *** ../vim-6.2.141/src/vim.h Wed Oct 29 14:45:27 2003 --- src/vim.h Sun Nov 2 12:22:17 2003 *************** *** 76,84 **** #endif - #if defined(MACOS) - # define FEAT_GUI_MAC - #endif #if defined(FEAT_GUI_MOTIF) \ || defined(FEAT_GUI_GTK) \ || defined(FEAT_GUI_ATHENA) \ --- 76,81 ---- *** ../vim-6.2.141/src/version.c Sun Nov 2 15:27:38 2003 --- src/version.c Sun Nov 2 15:28:53 2003 *************** *** 639,640 **** --- 639,642 ---- { /* Add new patch number below this line */ + /**/ + 142, /**/ -- So when I saw the post to comp.editors, I rushed over to the FTP site to grab it. So I yank apart the tarball, light x candles, where x= the vim version multiplied by the md5sum of the source divided by the MAC of my NIC (8A3FA78155A8A1D346C3C4A), put on black robes, dim the lights, wave a dead chicken over the hard drive, and summon the power of GNU GCC with the magic words "make config ; make!". [Jason Spence, compiling Vim 5.0] /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///