4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
10 Patch 6.2.142 (after 6.2.124)
11 Problem: Mac: building without GUI through configure doesn't work.
12 When the system is slow, unpacking the resource file takes too
14 Solution: Don't always define FEAT_GUI_MAC when MACOS is defined, define it
16 Add a configure option to skip Darwin detection.
17 Use a Python script to unpack the resources to avoid a race
18 condition. (Taro Muraoka)
19 Files: Makefile, src/Makefile, src/auto/configure, src/configure.in,
20 src/dehqx.py, src/vim.h
23 *** ../vim-6.2.141/Makefile Fri Oct 17 11:55:09 2003
24 --- Makefile Sun Nov 2 15:33:24 2003
35 *** ../vim-6.2.141/src/Makefile Fri Oct 17 12:08:46 2003
36 --- src/Makefile Sun Nov 2 13:26:45 2003
40 # - Uncomment the line with --disable-gui if you have Motif, GTK and/or
41 # Athena but don't want to make gvim (the GUI version of Vim with nice
42 # menus and scrollbars, but makes Vim bigger and startup slower).
43 + # - Uncomment --disable-darwin if on Mac OS X but you want to compile a
45 # - Uncomment the line "CONF_OPT_X = --without-x" if you have X11 but
46 # want to disable using X11 libraries. This speeds up starting Vim,
47 # but the window title will not be set and the X11 selection can not
51 #CONF_OPT_GUI = --enable-gui=athena
52 #CONF_OPT_GUI = --enable-gui=nextaw
54 + # DARWIN - detecting Mac OS X
55 + # Uncomment this line when you want to compile a Unix version of Vim on
56 + # Darwin. None of the Mac specific options or files will be used.
57 + #CONF_OPT_DARWIN = --disable-darwin
59 # PERL - For creating Vim with Perl interface
60 # Uncomment this when you want to include the Perl interface.
61 # The Perl option sometimes causes problems, because it adds extra flags
64 PHOTONGUI_TESTTARGET = gui
67 ! CARBONGUI_SRC = gui.c gui_mac.c
68 ! CARBONGUI_OBJ = objects/gui.o objects/gui_mac.o objects/pty.o
69 ! CARBONGUI_DEFS = -arch ppc -fno-common -fpascal-strings \
70 -Wall -Wno-unknown-pragmas \
71 -mdynamic-no-pic -pipe
72 ! CARBONGUI_IPATH = -I. -Iproto -I/Developer/Headers/FlatCarbon
74 CARBONGUI_LIBS1 = -framework Carbon
75 CARBONGUI_LIBS2 = -ltermcap
76 ! CARBONGUI_INSTALL = gui_mac.rsrc install_macosx
78 CARBONGUI_MAN_TARGETS =
79 CARBONGUI_TESTTARGET =
81 PHOTONGUI_TESTTARGET = gui
84 ! CARBONGUI_SRC = gui.c gui_mac.c
85 ! CARBONGUI_OBJ = objects/gui.o objects/gui_mac.o objects/pty.o
86 ! CARBONGUI_DEFS = -DFEAT_GUI_MAC -arch ppc -fno-common -fpascal-strings \
87 -Wall -Wno-unknown-pragmas \
88 -mdynamic-no-pic -pipe
89 ! CARBONGUI_IPATH = -I. -Iproto
91 CARBONGUI_LIBS1 = -framework Carbon
92 CARBONGUI_LIBS2 = -ltermcap
93 ! CARBONGUI_INSTALL = install_macosx
95 CARBONGUI_MAN_TARGETS =
96 CARBONGUI_TESTTARGET =
99 CC="$(CC)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" \
100 LDFLAGS="$(LDFLAGS)" $(CONF_SHELL) srcdir="$(srcdir)" \
101 ./configure $(CONF_OPT_GUI) $(CONF_OPT_X) $(CONF_OPT_XSMP) \
102 ! $(CONF_OPT_PERL) $(CONF_OPT_PYTHON) \
103 $(CONF_OPT_TCL) $(CONF_OPT_RUBY) \
104 $(CONF_OPT_CSCOPE) $(CONF_OPT_MULTIBYTE) $(CONF_OPT_INPUT) \
105 $(CONF_OPT_OUTPUT) $(CONF_OPT_GPM) $(CONF_OPT_WORKSHOP) \
107 CC="$(CC)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" \
108 LDFLAGS="$(LDFLAGS)" $(CONF_SHELL) srcdir="$(srcdir)" \
109 ./configure $(CONF_OPT_GUI) $(CONF_OPT_X) $(CONF_OPT_XSMP) \
110 ! $(CONF_OPT_DARWIN) $(CONF_OPT_PERL) $(CONF_OPT_PYTHON) \
111 $(CONF_OPT_TCL) $(CONF_OPT_RUBY) \
112 $(CONF_OPT_CSCOPE) $(CONF_OPT_MULTIBYTE) $(CONF_OPT_INPUT) \
113 $(CONF_OPT_OUTPUT) $(CONF_OPT_GPM) $(CONF_OPT_WORKSHOP) \
116 ### This creates a runnable Vim.app in the src directory
118 REZ = /Developer/Tools/Rez
119 - RESMRG = /Developer/Tools/ResMerger
120 APPDIR = $(VIMNAME).app
121 RESDIR = $(APPDIR)/Contents/Resources
122 # FIXME: i'm sure someone else can do something clever with grep
126 ### Classic resources
127 # Resource fork (in the form of a .rsrc file) for Classic Vim (Mac OS 9)
128 # This file is also required for OS X Vim.
129 ! bundle-rsrc: gui_mac.rsrc
130 @echo "Creating resource fork"
131 ! $(RESMRG) gui_mac.rsrc -dstIs DF -o $(RESDIR)/$(VIMNAME).rsrc
134 ! open os_mac.rsr.hqx
137 ! @echo "--------------------"
138 ! @echo "If this fails, run make install again after StuffIt Expander quits."
139 ! @echo "--------------------"
142 # po/Make_osx.pl says something about generating a Mac message file
143 # for Ukrananian. Would somebody using Mac OS X in Ukranian
145 ### Classic resources
146 # Resource fork (in the form of a .rsrc file) for Classic Vim (Mac OS 9)
147 # This file is also required for OS X Vim.
148 ! bundle-rsrc: os_mac.rsr.hqx
149 @echo "Creating resource fork"
152 ! mv gui_mac.rsrc.rsrcfork $(RESDIR)/$(VIMNAME).rsrc
154 # po/Make_osx.pl says something about generating a Mac message file
155 # for Ukrananian. Would somebody using Mac OS X in Ukranian
156 *** ../vim-6.2.141/src/auto/configure Wed Oct 29 14:51:49 2003
157 --- src/auto/configure Sun Nov 2 15:28:41 2003
161 ac_default_prefix=/usr/local
162 # Any additions from configure.in:
164 + --disable-darwin Disable Darwin (Mac OS X) support."
166 --with-vim-name=NAME what to call the Vim executable"
168 --with-ex-name=NAME what to call the Ex executable"
173 echo $ac_n "checking for Darwin (Mac OS X)""... $ac_c" 1>&6
174 ! echo "configure:1177: checking for Darwin (Mac OS X)" >&5
175 if test "`(uname) 2>/dev/null`" = Darwin; then
176 echo "$ac_t""yes" 1>&6
178 - OS_EXTRA_SCR="os_macosx.c";
179 - OS_EXTRA_OBJ="objects/os_macosx.o"
180 - CFLAGS="$CFLAGS -DMACOS_X_UNIX -no-cpp-precomp"
182 ! ac_safe=`echo "Carbon/Carbon.h" | sed 'y%./+-%__p_%'`
183 echo $ac_n "checking for Carbon/Carbon.h""... $ac_c" 1>&6
184 ! echo "configure:1187: checking for Carbon/Carbon.h" >&5
185 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
186 echo $ac_n "(cached) $ac_c" 1>&6
188 cat > conftest.$ac_ext <<EOF
189 ! #line 1192 "configure"
190 #include "confdefs.h"
191 #include <Carbon/Carbon.h>
193 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
194 ! { (eval echo configure:1197: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
195 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
196 if test -z "$ac_err"; then
201 echo $ac_n "checking for Darwin (Mac OS X)""... $ac_c" 1>&6
202 ! echo "configure:1179: checking for Darwin (Mac OS X)" >&5
203 if test "`(uname) 2>/dev/null`" = Darwin; then
204 echo "$ac_t""yes" 1>&6
206 ! echo $ac_n "checking --disable-darwin argument""... $ac_c" 1>&6
207 ! echo "configure:1184: checking --disable-darwin argument" >&5
208 ! # Check whether --enable-darwin or --disable-darwin was given.
209 ! if test "${enable_darwin+set}" = set; then
210 ! enableval="$enable_darwin"
213 ! enable_darwin="yes"
216 ! if test "$enable_darwin" = "yes"; then
217 ! echo "$ac_t""no" 1>&6
218 ! echo $ac_n "checking if Darwin files are there""... $ac_c" 1>&6
219 ! echo "configure:1196: checking if Darwin files are there" >&5
220 ! if test -f os_macosx.c; then
221 ! echo "$ac_t""yes" 1>&6
223 ! echo "$ac_t""no, Darwin support disabled" 1>&6
227 ! echo "$ac_t""yes, Darwin support excluded" 1>&6
230 ! if test "$enable_darwin" = "yes"; then
232 ! OS_EXTRA_SCR="os_macosx.c";
233 ! OS_EXTRA_OBJ="objects/os_macosx.o"
234 ! CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp"
236 ! ac_safe=`echo "Carbon/Carbon.h" | sed 'y%./+-%__p_%'`
237 echo $ac_n "checking for Carbon/Carbon.h""... $ac_c" 1>&6
238 ! echo "configure:1215: checking for Carbon/Carbon.h" >&5
239 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
240 echo $ac_n "(cached) $ac_c" 1>&6
242 cat > conftest.$ac_ext <<EOF
243 ! #line 1220 "configure"
244 #include "confdefs.h"
245 #include <Carbon/Carbon.h>
247 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
248 ! { (eval echo configure:1225: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
249 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
250 if test -z "$ac_err"; then
254 echo "$ac_t""no" 1>&6
257 ! if test "x$CARBON" = "xyes"; then
258 ! if test -z "$with_x"; then
260 ! DEFAULT_VIMNAME=Vim
265 echo "$ac_t""no" 1>&6
268 ! if test "x$CARBON" = "xyes"; then
269 ! if test -z "$with_x"; then
271 ! DEFAULT_VIMNAME=Vim
276 *** ../vim-6.2.141/src/configure.in Wed Oct 29 14:51:49 2003
277 --- src/configure.in Sun Nov 2 13:08:39 2003
280 AC_MSG_CHECKING([for Darwin (Mac OS X)])
281 if test "`(uname) 2>/dev/null`" = Darwin; then
284 - OS_EXTRA_SCR="os_macosx.c";
285 - OS_EXTRA_OBJ="objects/os_macosx.o"
286 - CFLAGS="$CFLAGS -DMACOS_X_UNIX -no-cpp-precomp"
288 ! dnl If Carbon is found, assume we don't want X11
289 ! dnl unless it was specifically asked for (--with-x)
290 ! AC_CHECK_HEADER(Carbon/Carbon.h, CARBON=yes)
291 ! if test "x$CARBON" = "xyes"; then
292 ! if test -z "$with_x"; then
294 ! DEFAULT_VIMNAME=Vim
299 AC_MSG_CHECKING([for Darwin (Mac OS X)])
300 if test "`(uname) 2>/dev/null`" = Darwin; then
303 ! AC_MSG_CHECKING(--disable-darwin argument)
304 ! AC_ARG_ENABLE(darwin,
305 ! [ --disable-darwin Disable Darwin (Mac OS X) support.],
306 ! , [enable_darwin="yes"])
307 ! if test "$enable_darwin" = "yes"; then
309 ! AC_MSG_CHECKING(if Darwin files are there)
310 ! if test -f os_macosx.c; then
313 ! AC_MSG_RESULT([no, Darwin support disabled])
317 ! AC_MSG_RESULT([yes, Darwin support excluded])
320 ! if test "$enable_darwin" = "yes"; then
322 ! OS_EXTRA_SCR="os_macosx.c";
323 ! OS_EXTRA_OBJ="objects/os_macosx.o"
324 ! CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -I/Developer/Headers/FlatCarbon -no-cpp-precomp"
326 ! dnl If Carbon is found, assume we don't want X11
327 ! dnl unless it was specifically asked for (--with-x)
328 ! AC_CHECK_HEADER(Carbon/Carbon.h, CARBON=yes)
329 ! if test "x$CARBON" = "xyes"; then
330 ! if test -z "$with_x"; then
332 ! DEFAULT_VIMNAME=Vim
337 *** ../vim-6.2.141/src/dehqx.py Sun Nov 2 15:34:05 2003
338 --- src/dehqx.py Sat Oct 25 16:19:34 2003
342 + # Python script to get both the data and resource fork from a BinHex encoded
344 + # Author: Taro Muraoka
345 + # Last Change: 2003 Oct 25
350 + input = sys.argv[1]
351 + conv = binhex.HexBin(input)
355 + out_rsrc = out + '.rsrcfork'
356 + #print 'out_rsrc=' + out_rsrc
357 + print 'In file: ' + input
359 + outfile = open(out_data, 'wb')
360 + print ' Out data fork: ' + out_data
362 + d = conv.read(128000)
368 + d = conv.read_rsrc(128000)
370 + print ' Out rsrc fork: ' + out_rsrc
371 + outfile = open(out_rsrc, 'wb')
374 + d = conv.read_rsrc(128000)
381 + # vim:set ts=8 sts=4 sw=4 et:
382 *** ../vim-6.2.141/src/vim.h Wed Oct 29 14:45:27 2003
383 --- src/vim.h Sun Nov 2 12:22:17 2003
390 - # define FEAT_GUI_MAC
392 #if defined(FEAT_GUI_MOTIF) \
393 || defined(FEAT_GUI_GTK) \
394 || defined(FEAT_GUI_ATHENA) \
396 *** ../vim-6.2.141/src/version.c Sun Nov 2 15:27:38 2003
397 --- src/version.c Sun Nov 2 15:28:53 2003
401 { /* Add new patch number below this line */
407 So when I saw the post to comp.editors, I rushed over to the FTP site to
408 grab it. So I yank apart the tarball, light x candles, where x= the
409 vim version multiplied by the md5sum of the source divided by the MAC of
410 my NIC (8A3FA78155A8A1D346C3C4A), put on black robes, dim the lights,
411 wave a dead chicken over the hard drive, and summon the power of GNU GCC
412 with the magic words "make config ; make!".
413 [Jason Spence, compiling Vim 5.0]
415 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
416 /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
417 \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
418 \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///