Bugs: Browse | Submit New | Admin

[#2308] Problem with mkmf and spaces in directory names?

Date:
2005-08-25 17:42
Priority:
3
Submitted By:
Tim Smith (tsmith)
Assigned To:
Nobuyoshi Nakada (nobu)
Category:
None
State:
Open
Platform:
 
Summary:
Problem with mkmf and spaces in directory names?

Detailed description
See: http://www.ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-talk/104505

The problem remains as of ruby 1.8.2 (2004-12-25) [i386-mswin32].  With c:/program files/ruby, mkmf does not quote or
shorten (progra~1) the path, causing, for example:

Error makefile 99: Redefinition of target 'c:/program'

Can this be fixed?

Add A Comment: Notepad

Please login


Followup

Message
Date: 2005-09-07 19:39
Sender: Tim Smith

Just tried nobu's patch on the 22 Jul 2005 mkmf.rb from ruby
1.9.0 (2005-07-22) [i386-mswin32].  Still:

Error makefile 114: Redefinition of target 'C:/Documents'
Error makefile 114: Redefinition of target 'and'
Error makefile 116: Redefinition of target 'C:/Documents'
Error makefile 116: Redefinition of target 'and'
*** 4 errors during make ***
Date: 2005-09-07 19:22
Sender: Tim Smith

I just applied nobu's patch to the 22 Jul 2005 mkmf.rb from
ruby 1.8.3 (2005-07-22).  No luck; with ruby in C:\Documents
and
Settings\tsmith\Desktop\ruby-1.8.3-20050722-i386-mswin32, I get:

Error makefile 112: Redefinition of target 'C:/Documents'
Error makefile 112: Redefinition of target 'and'
Error makefile 114: Redefinition of target 'C:/Documents'
Error makefile 114: Redefinition of target 'and'

Here's the makefile:

SHELL = /bin/sh

#### Start of system configuration section. ####

srcdir = .
topdir = "C:/Documents and
Settings/tsmith/Desktop/ruby-1.8.3-20050722-i386-mswin32/lib/ruby
/1.8/i386-mswin32"
hdrdir = $(topdir)
VPATH = $(srcdir);$(topdir);$(hdrdir)

DESTDIR = C:
prefix = $(DESTDIR)/Documents and
Settings/tsmith/Desktop/ruby-1.8.3-20050722-i386-mswin32
exec_prefix = $(prefix)
sitedir = $(prefix)/lib/ruby/site_ruby
rubylibdir = $(libdir)/ruby/$(ruby_version)
top_srcdir = $(DESTDIR)/develop/win/ruby/stable
archdir = $(rubylibdir)/$(arch)
sbindir = $(exec_prefix)/sbin
datadir = $(prefix)/share
includedir = $(prefix)/include
infodir = $(prefix)/info
sysconfdir = $(prefix)/etc
mandir = $(prefix)/man
libdir = $(exec_prefix)/lib
sharedstatedir = $(DESTDIR)/etc
oldincludedir = $(DESTDIR)/usr/include
sitearchdir = $(sitelibdir)/$(sitearch)
localstatedir = $(DESTDIR)/var
bindir = $(exec_prefix)/bin
sitelibdir = $(sitedir)/$(ruby_version)
libexecdir = $(exec_prefix)/libexec

CC = cl -nologo
LIBRUBY = $(RUBY_SO_NAME).lib
LIBRUBY_A = $(RUBY_SO_NAME)-static.lib
LIBRUBYARG_SHARED = $(LIBRUBY)
LIBRUBYARG_STATIC = $(LIBRUBY_A)

CFLAGS   =  -MD -Zi -O2b2xg- -G6 
CPPFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir)  -I.
-IC:/develop/win/ruby/stable
-IC:/develop/win/ruby/stable/missing
CXXFLAGS = $(CFLAGS) 
DLDFLAGS =  -link -incremental:no -debug -opt:ref -opt:icf
-dll $(LIBPATH) -def:$(DEFFILE)
-implib:$(*F:.so=)-$(arch).lib -pdb:$(*F:.so=)-$(arch).pdb 
LDSHARED = cl -nologo -LD
AR = lib -nologo
EXEEXT = .exe

RUBY_INSTALL_NAME = ruby
RUBY_SO_NAME = msvcrt-ruby18
arch = i386-mswin32
sitearch = i386-msvcrt
ruby_version = 1.8
ruby = C:/Documents and
Settings/tsmith/Desktop/ruby-1.8.3-20050722-i386-mswin32/bin/ruby
RUBY = $(ruby:/=\)
RM = $(RUBY) -run -e rm -- -f
MAKEDIRS = @$(RUBY) -run -e mkdir -- -p
INSTALL = copy > nul
INSTALL_PROG = $(INSTALL)
INSTALL_DATA = $(INSTALL)
COPY = copy > nul

#### End of system configuration section. ####

preload = 

libpath = $(libdir)
LIBPATH =  -libpath:"$(libdir)"
DEFFILE = $(TARGET)-$(arch).def

CLEANFILES = 
DISTCLEANFILES = vc*.pdb $(DEFFILE)

extout = 
extout_prefix = 
target_prefix = 
LOCAL_LIBS = 
LIBS = $(LIBRUBYARG_SHARED)  oldnames.lib user32.lib
advapi32.lib wsock32.lib  
SRCS = rb_serial_wrapper.c serial.c
OBJS = rb_serial_wrapper.obj serial.obj
TARGET = Win32Serial
DLLIB = $(TARGET).so
STATIC_LIB = 

RUBYCOMMONDIR = $(sitedir)$(target_prefix)
RUBYLIBDIR    = $(sitelibdir)$(target_prefix)
RUBYARCHDIR   = $(sitearchdir)$(target_prefix)

TARGET_SO     = $(DLLIB)
CLEANLIBS     = $(TARGET).so $(TARGET).il? $(TARGET).tds
$(TARGET).map
CLEANOBJS     = *.obj *.lib *.s[ol] *.pdb *.exp *.bak

all:		$(DLLIB)
static:		$(STATIC_LIB)

clean:
		@-$(RM) $(CLEANLIBS:/=\) $(CLEANOBJS:/=\) $(CLEANFILES:/=\)

distclean:	clean
		@-$(RM) Makefile extconf.h conftest.* mkmf.log
		@-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES:/=\)

realclean:	distclean
install: install-so install-rb

install-so: $(RUBYARCHDIR)
install-so: $(RUBYARCHDIR)/$(DLLIB)
$(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
	$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
install-rb: pre-install-rb install-rb-default
install-rb-default: pre-install-rb-default
pre-install-rb pre-install-rb-default: $(RUBYLIBDIR)
$(RUBYARCHDIR):
	$(MAKEDIRS) $@
$(RUBYLIBDIR):
	$(MAKEDIRS) $@

site-install: site-install-so site-install-rb
site-install-so: install-so
site-install-rb: install-rb

.SUFFIXES: .c .m .cc .cxx .cpp .obj

{$(srcdir)}.cc{}.obj:
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)

{$(topdir)}.cc{}.obj:
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)

{$(hdrdir)}.cc{}.obj:
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)

.cc.obj:
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)

{$(srcdir)}.cxx{}.obj:
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)

{$(topdir)}.cxx{}.obj:
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)

{$(hdrdir)}.cxx{}.obj:
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)

.cxx.obj:
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)

{$(srcdir)}.cpp{}.obj:
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)

{$(topdir)}.cpp{}.obj:
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)

{$(hdrdir)}.cpp{}.obj:
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)

.cpp.obj:
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)

{$(srcdir)}.c{}.obj:
	$(CC) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)

{$(topdir)}.c{}.obj:
	$(CC) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)

{$(hdrdir)}.c{}.obj:
	$(CC) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)

.c.obj:
	$(CC) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)

$(DLLIB): $(DEFFILE) $(OBJS)
	@-$(RM) $@
	$(LDSHARED) -Fe$(@) $(OBJS) $(LIBS) $(LOCAL_LIBS) $(DLDFLAGS)



$(DEFFILE): 
	$(RUBY) -e "puts 'EXPORTS', 'Init_$(TARGET)'"  >
$@

$(OBJS): {.;$(srcdir);$(topdir);$(hdrdir)}ruby.h
{.;$(srcdir);$(topdir);$(hdrdir)}defines.h
Date: 2005-08-29 16:20
Sender: Tim Smith

nobu's patch is for a 12 Jul 2005 mkmf.rb; my mkmf.rb is 18
Sep 2004, from ruby 1.8.2.  I applied it anyway and it
didn't help; I still get:

Error makefile 99: Redefinition of target 'c:/program'

But maybe it would have worked with a more recent version of
ruby.  Anyway, here's the makefile that gives the error:

SHELL = /bin/sh

#### Start of system configuration section. ####

srcdir = .
topdir = "c:/program
files/ruby/lib/ruby/1.8/i386-mswin32"
hdrdir = $(topdir)
VPATH = $(srcdir)

DESTDIR = c:
prefix = $(DESTDIR)/program files/ruby
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
sitelibdir = $(sitedir)/$(ruby_version)
datadir = $(prefix)/share
sitedir = $(prefix)/lib/ruby/site_ruby
sharedstatedir = $(DESTDIR)/etc
archdir = $(rubylibdir)/$(arch)
localstatedir = $(DESTDIR)/var
infodir = $(prefix)/info
oldincludedir = $(DESTDIR)/usr/include
libexecdir = $(exec_prefix)/libexec
compile_dir =
$(DESTDIR)/Dev/RubyDev/rubyinstaller/cvs-repo/installer-win/stabl
e/download/ruby-1.8.2/win32
sbindir = $(exec_prefix)/sbin
includedir = $(prefix)/include
sysconfdir = $(prefix)/etc
sitearchdir = $(sitelibdir)/$(sitearch)
mandir = $(prefix)/man
libdir = $(exec_prefix)/lib
rubylibdir = $(libdir)/ruby/$(ruby_version)

CC = cl -nologo
LIBRUBY = $(RUBY_SO_NAME).lib
LIBRUBY_A = $(RUBY_SO_NAME)-static.lib
LIBRUBYARG_SHARED = $(LIBRUBY)
LIBRUBYARG_STATIC = $(LIBRUBY_A)

CFLAGS   =  -MD -Zi -O2b2xg- -G6 
CPPFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir)  -I.
-I./.. -I./../missing
CXXFLAGS = $(CFLAGS) 
DLDFLAGS =  -link -incremental:no -debug -opt:ref -opt:icf
-dll $(LIBPATH) -def:$(DEFFILE) 
LDSHARED = cl -nologo -LD
AR = lib -nologo
EXEEXT = .exe

RUBY_INSTALL_NAME = ruby
RUBY_SO_NAME = msvcrt-ruby18
arch = i386-mswin32
sitearch = i386-msvcrt
ruby_version = 1.8
ruby = c:/program files/ruby/bin/ruby
RUBY = $(ruby:/=\)
RM = $(RUBY) -run -e rm -- -f
MAKEDIRS = $(RUBY) -run -e mkdir -- -p
INSTALL_PROG = $(RUBY) -run -e install -- -vpm 0755
INSTALL_DATA = $(RUBY) -run -e install -- -vpm 0644

#### End of system configuration section. ####


LIBPATH =  -libpath:"$(libdir)"
DEFFILE = $(TARGET)-$(arch).def

CLEANFILES = 
DISTCLEANFILES = $(DEFFILE)

target_prefix = 
LOCAL_LIBS = 
LIBS = $(LIBRUBYARG_SHARED)  oldnames.lib user32.lib
advapi32.lib wsock32.lib  
OBJS = rb_serial_wrapper.obj serial.obj
TARGET = Win32Serial
DLLIB = $(TARGET).so
STATIC_LIB = $(TARGET).lib

RUBYCOMMONDIR = $(sitedir)$(target_prefix)
RUBYLIBDIR    = $(sitelibdir)$(target_prefix)
RUBYARCHDIR   = $(sitearchdir)$(target_prefix)

CLEANLIBS     = "$(TARGET).{lib,exp,il?,tds,map}"
$(DLLIB)
CLEANOBJS     = "*.{obj,lib,s[ol],pdb,bak}"

all:		$(DLLIB)
static:		$(STATIC_LIB)

clean:
		@$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)

distclean:	clean
		@$(RM) Makefile extconf.h conftest.* mkmf.log
		@$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)

realclean:	distclean
install: $(RUBYARCHDIR)
install: $(RUBYARCHDIR)/$(DLLIB)
$(RUBYARCHDIR)/$(DLLIB): $(DLLIB) $(RUBYARCHDIR)
	@$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
$(RUBYARCHDIR):
	@$(MAKEDIRS) $(RUBYARCHDIR)

site-install: install

.SUFFIXES: .c .cc .m .cxx .cpp .C .obj

{$(srcdir)}.cc{}.obj:
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)

.cc.obj:
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)

{$(srcdir)}.cpp{}.obj:
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)

.cpp.obj:
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)

{$(srcdir)}.cxx{}.obj:
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)

.cxx.obj:
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)

{$(srcdir)}.C{}.obj:
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)

.C.obj:
	$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -Tp$(<:\=/)

{$(srcdir)}.c{}.obj:
	$(CC) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)

.c.obj:
	$(CC) $(CFLAGS) $(CPPFLAGS) -c -Tc$(<:\=/)

$(DLLIB): $(OBJS) $(DEFFILE)
	@-$(RM) $@
	@-$(RM) $(TARGET).lib
	$(LDSHARED) -Fe$(@) $(OBJS) $(LIBS) $(LOCAL_LIBS) $(DLDFLAGS)

$(STATIC_LIB): $(OBJS)
	$(AR) -machine:x86 -out:$@ $(OBJS)

$(DEFFILE): 
	$(RUBY) -e "puts 'EXPORTS', 'Init_$(TARGET)'"  >
$@
Date: 2005-08-27 23:11
Sender: Hirokazu Yamamoto

I'm heavily sorry. IE asked me if I want to reload the page
at the time backing to index page, and I accepted several
times... (actually 5 times)

I didn't know this would cause such a noise. ;-(
Date: 2005-08-27 23:01
Sender: Hirokazu Yamamoto

nobu replied on http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby
/ruby-core/5684. (Just for pointer)

> nobuyoshi nakada wrote...
> Does this patch help?
Date: 2005-08-27 23:00
Sender: Hirokazu Yamamoto

nobu replied on http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby
/ruby-core/5684. (Just for pointer)

> nobuyoshi nakada wrote...
> Does this patch help?
Date: 2005-08-27 22:59
Sender: Hirokazu Yamamoto

nobu replied on http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby
/ruby-core/5684. (Just for pointer)

> nobuyoshi nakada wrote...
> Does this patch help?
Date: 2005-08-27 22:57
Sender: Hirokazu Yamamoto

nobu replied on http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby
/ruby-core/5684. (Just for pointer)

> nobuyoshi nakada wrote...
> Does this patch help?
Date: 2005-08-27 22:56
Sender: Hirokazu Yamamoto

nobu replied on http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby
/ruby-core/5684. (Just for pointer)

> nobuyoshi nakada wrote...
> Does this patch help?

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

Field Old Value Date By
resolution_idNone2007-06-13 02:55nobu
assigned_tonone2005-09-07 21:08ocean