Project

General

Profile

Actions

Bug #1057

closed

ripper does not compile with mingw

Added by cfis (Charlie Savage) about 12 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
ruby -v:
Backport:
[ruby-core:21570]

Description

=begin
Mingw, vista, gcc 3.4.5

When building ruby 1.9.1-rc2:

make[1]: Entering directory /usr/src/ruby-1.9.1-rc2/ext/ripper'
make[1]: *** No rule to make target
lex.c', needed by ripper.o'. Stop.
make[1]: Leaving directory
/usr/src/ruby-1.9.1-rc2/ext/ripper'
make: *** [exts] Error 1

In the makefile:

ripper.o: ripper.c lex.c eventids1.c eventids2.c eventids2table.c \

$ flex --version
flex 2.5.33

$ bison --version
bison (GNU Bison) 2.3

But lex.c is nowhere to be found. Simply removing it from the makefile fixes the issue. So:

ripper.o: ripper.c eventids1.c eventids2.c eventids2table.c \

Is this the right solution?
=end

Actions #1

Updated by matz (Yukihiro Matsumoto) about 12 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r21783.
=end

Actions #2

Updated by matz (Yukihiro Matsumoto) about 12 years ago

  • Status changed from Closed to Open

=begin
re-opened.
=end

Actions #3

Updated by matz (Yukihiro Matsumoto) about 12 years ago

  • Status changed from Open to Closed

=begin
Applied in changeset r21787.
=end

Actions #4

Updated by cfis (Charlie Savage) about 12 years ago

=begin
Thanks Matz - fix verified.
=end

Actions #5

Updated by nobu (Nobuyoshi Nakada) about 12 years ago

  • Status changed from Closed to Open

=begin
Hi,

At Tue, 27 Jan 2009 02:53:14 +0900,
Charlie Savage wrote in [ruby-core:21570]:

Mingw, vista, gcc 3.4.5

What do you call Mingw? gcc -mno-cygwin on cygwin, or gcc on
msys?

And what configure options did you use?

--
Nobu Nakada

=end

Actions #6

Updated by cfis (Charlie Savage) about 12 years ago

=begin
gcc on msys.

config options for ruby:

./configure --prefix=c:/Development/ruby-1.9.1-mingw

=end

Actions #7

Updated by nobu (Nobuyoshi Nakada) about 12 years ago

=begin
Hi,

At Tue, 27 Jan 2009 17:22:42 +0900,
Charlie Savage wrote in [ruby-core:21602]:

gcc on msys.

config options for ruby:

./configure --prefix=c:/Development/ruby-1.9.1-mingw

How are macros "top_srcdir", "srcdir", "topdir", "hdrdir",
"arch_hdrdir" defined in ext/ripper/Makefile?

I suspect it might be a VPATH problem of make on msys. If it
is true, the trunk r21749 or later could compile.

Anyway, the fix of ext/ripper/depend was wrong and has been
reverted.

--
Nobu Nakada

=end

Actions #8

Updated by nobu (Nobuyoshi Nakada) about 12 years ago

  • Status changed from Open to Closed

=begin

=end

Actions #9

Updated by cfis (Charlie Savage) about 12 years ago

=begin
Hi Nobu,

How are macros "top_srcdir", "srcdir", "topdir", "hdrdir",
"arch_hdrdir" defined in ext/ripper/Makefile?

I pasted the generated make file below

I suspect it might be a VPATH problem of make on msys. If it
is true, the trunk r21749 or later could compile.

Anyway, the fix of ext/ripper/depend was wrong and has been
reverted.

I just recompiled against trunk - and it works fine now.

Thanks,

Charlie


SHELL = /bin/sh

#### Start of system configuration section. ####
top_srcdir = $(topdir)/.
srcdir = $(top_srcdir)/ext/ripper
topdir = ../..
hdrdir = $(top_srcdir)/include
arch_hdrdir = $(extout)/include/$(arch)
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby:$(topdir):$(top_srcdir)
RUBYLIB = -
RUBYOPT = -r$(top_srcdir)/ext/purelib.rb

DESTDIR = C:
prefix = $(DESTDIR)/Development/ruby-1.9.1-mingw
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
sbindir = $(exec_prefix)/sbin
libexecdir = $(exec_prefix)/libexec
datarootdir = $(prefix)/share
datadir = $(datarootdir)
sysconfdir = $(prefix)/etc
sharedstatedir = $(prefix)/com
localstatedir = $(prefix)/var
includedir = $(prefix)/include
oldincludedir = $(DESTDIR)/usr/include
docdir = $(datarootdir)/doc/$(PACKAGE)
infodir = $(datarootdir)/info
htmldir = $(docdir)
dvidir = $(docdir)
pdfdir = $(docdir)
psdir = $(docdir)
libdir = $(exec_prefix)/lib
localedir = $(datarootdir)/locale
mandir = $(datarootdir)/man
sitedir = $(libdir)/$(RUBY_INSTALL_NAME)/site_ruby
vendordir = $(libdir)/$(RUBY_INSTALL_NAME)/vendor_ruby
rubyhdrdir = $(includedir)/$(RUBY_INSTALL_NAME)-$(ruby_version)
sitehdrdir = $(rubyhdrdir)/site_ruby
vendorhdrdir = $(rubyhdrdir)/vendor_ruby
rubylibdir = $(libdir)/$(ruby_install_name)/$(ruby_version)
archdir = $(rubylibdir)/$(arch)
sitelibdir = $(sitedir)/$(ruby_version)
sitearchdir = $(sitelibdir)/$(sitearch)
vendorlibdir = $(vendordir)/$(ruby_version)
vendorarchdir = $(vendorlibdir)/$(sitearch)

CC = gcc
CXX = g++
LIBRUBY = lib$(RUBY_SO_NAME).dll.a
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
OUTFLAG = -o
COUTFLAG = -o

RUBY_EXTCONF_H = extconf.h
cflags = $(optflags) $(debugflags) $(warnflags)
optflags = -O2
debugflags = -g
warnflags = -Wall -Wno-parentheses
CFLAGS = $(cflags)
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir) -I$(topdir)
-I$(top_srcdir)
DEFS =
CPPFLAGS = -DRUBY_EXTCONF_H=\"$(RUBY_EXTCONF_H)\"
-Ic:/Development/msys/local/include $(DEFS) $(cppflags)
CXXFLAGS = $(CFLAGS) $(cxxflags)
ldflags = -L. -Lc:/Development/msys/local/lib
dldflags = -Wl,--enable-auto-image-base,--enable-auto-import
archflag =
DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
LDSHARED = gcc -shared $(if $(filter-out -g -g0,$(debugflags)),,-s)
LDSHAREDXX = g++ -shared $(if $(filter-out -g -g0,$(debugflags)),,-s)
AR = ar
EXEEXT = .exe

RUBY_INSTALL_NAME = ruby
RUBY_SO_NAME = msvcrt-ruby191
arch = i386-mingw32
sitearch = i386-msvcrt
ruby_version = 1.9.1
ruby = $(topdir)/miniruby.exe -I'$(topdir)' -I'$(top_srcdir)/lib'
-I'$(extout)/$(arch)' -I'$(extout)/common' -I./- -I'$(top_srcdir)/ext'
-rpurelib.rb
RUBY = $(ruby)
RM = rm -f
RM_RF = $(RUBY) -run -e rm -- -rf
RMDIRS = $(top_srcdir)/tool/rmdirs
MAKEDIRS = mkdir -p
INSTALL = /bin/install -c
INSTALL_PROG = $(INSTALL) -m 0755
INSTALL_DATA = $(INSTALL) -m 644
COPY = cp

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

preload =

libpath = . $(topdir)
LIBPATH = -L. -L$(topdir)
DEFFILE =

CLEANFILES = mkmf.log ripper.y ripper.c ripper.E ripper.output y.output
eventids1.c eventids2table.c
DISTCLEANFILES =
DISTCLEANDIRS =

extout = $(topdir)/.ext
extout_prefix = $(extout)$(target_prefix)/
target_prefix =
LOCAL_LIBS =
LIBS = $(LIBRUBYARG_SHARED) -lshell32 -lws2_32
SRCS = ripper.c
OBJS = ripper.o
TARGET = ripper
DLLIB = $(TARGET).so
EXTSTATIC =
STATIC_LIB = $(TARGET).a

BINDIR = $(extout)/bin
RUBYCOMMONDIR = $(extout)/common
RUBYLIBDIR = $(RUBYCOMMONDIR)$(target_prefix)
RUBYARCHDIR = $(extout)/$(arch)$(target_prefix)
HDRDIR = $(extout)/include/ruby$(target_prefix)
ARCHHDRDIR = $(extout)/include/$(arch)/ruby$(target_prefix)

TARGET_SO = $(RUBYARCHDIR)/$(DLLIB)
CLEANLIBS = $(RUBYARCHDIR)/$(TARGET).so
CLEANOBJS = *.o *.bak

all: install
static: $(STATIC_LIB) install-rb

clean-rb-default::
clean-rb::
clean-so::
clean: clean-so clean-rb-default clean-rb
@-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)

distclean-rb-default::
distclean-rb::
distclean-so::
distclean: clean distclean-so distclean-rb-default distclean-rb
@-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
@-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
@-$(RMDIRS) $(DISTCLEANDIRS)

realclean: distclean
install: install-so install-rb

install-so: $(RUBYARCHDIR)
install-so: $(RUBYARCHDIR)/$(DLLIB)
clean-so::
@-$(RM) $(RUBYARCHDIR)/$(DLLIB)
@-$(RMDIRS) $(RUBYARCHDIR)
install-rb: pre-install-rb install-rb-default
install-rb-default: pre-install-rb-default
pre-install-rb: Makefile
pre-install-rb-default: Makefile
pre-install-rb-default: $(RUBYLIBDIR)/ripper
install-rb-default: $(RUBYLIBDIR)/ripper/core.rb
$(RUBYLIBDIR)/ripper/core.rb: $(srcdir)/lib/ripper/core.rb
$(COPY) $(srcdir)/lib/ripper/core.rb $(@D)
clean-rb-default::
@-$(RM) $(RUBYLIBDIR)/ripper/core.rb
install-rb-default: $(RUBYLIBDIR)/ripper/filter.rb
$(RUBYLIBDIR)/ripper/filter.rb: $(srcdir)/lib/ripper/filter.rb
$(COPY) $(srcdir)/lib/ripper/filter.rb $(@D)
clean-rb-default::
@-$(RM) $(RUBYLIBDIR)/ripper/filter.rb
install-rb-default: $(RUBYLIBDIR)/ripper/lexer.rb
$(RUBYLIBDIR)/ripper/lexer.rb: $(srcdir)/lib/ripper/lexer.rb
$(COPY) $(srcdir)/lib/ripper/lexer.rb $(@D)
clean-rb-default::
@-$(RM) $(RUBYLIBDIR)/ripper/lexer.rb
install-rb-default: $(RUBYLIBDIR)/ripper/sexp.rb
$(RUBYLIBDIR)/ripper/sexp.rb: $(srcdir)/lib/ripper/sexp.rb
$(COPY) $(srcdir)/lib/ripper/sexp.rb $(@D)
clean-rb-default::
@-$(RM) $(RUBYLIBDIR)/ripper/sexp.rb
pre-install-rb-default: $(RUBYLIBDIR)
install-rb-default: $(RUBYLIBDIR)/ripper.rb
$(RUBYLIBDIR)/ripper.rb: $(srcdir)/lib/ripper.rb
$(COPY) $(srcdir)/lib/ripper.rb $(@D)
clean-rb-default::
@-$(RM) $(RUBYLIBDIR)/ripper.rb
clean-rb-default::
@-$(RMDIRS) $(RUBYLIBDIR)
@-$(RMDIRS) $(RUBYLIBDIR)/ripper
$(RUBYARCHDIR):
$(MAKEDIRS) $@
$(RUBYLIBDIR):
$(MAKEDIRS) $@
$(RUBYLIBDIR)/ripper:
$(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 .o

.cc.o:
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<

.cxx.o:
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<

.cpp.o:
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<

.c.o:
$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<

$(RUBYARCHDIR)/$(DLLIB): $(OBJS) Makefile
@-$(RM) $(@)
@-$(MAKEDIRS) $(@D)
$(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)

$(STATIC_LIB): $(OBJS)
@-$(RM) $(@)
$(AR) cru $@ $(OBJS)
@-ranlib $(DLLIB) 2> /dev/null || true

###
$(OBJS): $(RUBY_EXTCONF_H)

.SUFFIXES: .y .c

GEN = $(srcdir)/tools/generate.rb
SRC1 = $(top_srcdir)/parse.y
SRC2 = $(srcdir)/eventids2.c
BISON = bison

src: ripper.c eventids1.c eventids2table.c

ripper.o: ripper.c lex.c eventids1.c eventids2.c eventids2table.c \
$(hdrdir)/ruby/ruby.h $(arch_hdrdir)/ruby/config.h \
$(hdrdir)/ruby/defines.h $(hdrdir)/ruby/intern.h \
$(hdrdir)/ruby/encoding.h $(hdrdir)/ruby/missing.h \
$(hdrdir)/../node.h $(hdrdir)/ruby/oniguruma.h \
$(hdrdir)/ruby/regex.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/util.h

.y.c:
$(BISON) -t -v -oy.tab.c $<
sed -f $(top_srcdir)/tool/ytab.sed -e "/#/s!y.tab.c!$@!" y.tab.c > $@
@$(RM) y.tab.c

all: check
static: check

ripper.y: $(srcdir)/tools/preproc.rb $(top_srcdir)/parse.y
$(RUBY) $(srcdir)/tools/preproc.rb $(top_srcdir)/parse.y --output=$@

check: $(GEN) $(SRC1) $(SRC2)
$(RUBY) $(GEN) --mode=check --ids1src=$(SRC1) --ids2src=$(SRC2)

eventids1.c: $(srcdir)/tools/generate.rb $(SRC1)
$(RUBY) $(GEN) --mode=eventids1 --ids1src=$(SRC1) --output=$@

eventids2table.c: $(srcdir)/tools/generate.rb $(SRC2)
$(RUBY) $(GEN) --mode=eventids2table --ids2src=$(SRC2) --output=$@

# Entries for Ripper maintainer

preproc: ripper.E
ripper.E: ripper.c
$(CC) -E $(CPPFLAGS) ripper.c | $(RUBY) $(srcdir)/tools/strip.rb > $@

Attachment: smime.p7s
=end

Actions

Also available in: Atom PDF