~ubuntu-branches/ubuntu/intrepid/ruby1.9/intrepid-updates

« back to all changes in this revision

Viewing changes to win32/Makefile.sub

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-09-04 16:01:17 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20070904160117-i15zckg2nhxe9fyw
Tags: 1.9.0+20070830-2ubuntu1
* Sync from Debian; remaining changes:
  - Add -g to CFLAGS.
* Fixes build failure on ia64.
* Fixes build failure with gcc-4.2 on lpia.
* Robustify check for target_os, fixing build failure on lpia.
* Set Ubuntu maintainer address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
!endif
35
35
###############
36
36
 
37
 
VPATH = $(srcdir);$(srcdir)/missing;$(srcdir)/win32
38
37
.SUFFIXES: .y .def .lib
39
38
 
40
39
!if !defined(CC)
92
91
!error RT not defined.  Retry from configure pass.
93
92
!endif
94
93
 
 
94
arch = $(ARCH)-$(OS)
 
95
 
95
96
!ifndef RUBY_SO_NAME
96
97
RUBY_SO_NAME = $(RT)-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)
97
98
!endif
150
151
CC = $(CC) -nologo
151
152
LD = $(CC)
152
153
LDSHARED = $(LD) -LD
153
 
XCFLAGS = -DRUBY_EXPORT -I. -I$(srcdir) -I$(srcdir)/missing
 
154
XCFLAGS = -DRUBY_EXPORT -I. -I$(arch_hdrdir) -I$(hdrdir) -I$(srcdir) -I$(srcdir)/missing
154
155
!if $(MSC_VER) >= 1400
155
156
# Prevents VC++ 2005 (cl ver 14) warnings
156
157
CPPFLAGS = $(CPPFLAGS) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
199
200
WINMAINOBJ    = winmain.$(OBJEXT)
200
201
MINIOBJS      = dmydln.$(OBJEXT)
201
202
 
 
203
arch_hdrdir = $(EXTOUT)/include/$(arch)
 
204
hdrdir = $(srcdir)/include
 
205
VPATH = $(arch_hdrdir)/ruby;$(hdrdir)/ruby;$(srcdir);$(srcdir)/missing;$(srcdir)/win32
 
206
 
202
207
all: $(srcdir)/win32/Makefile.sub $(srcdir)/common.mk
203
208
 
204
209
ruby: $(PROGRAM)
210
215
        $(COMSPEC) /C $(srcdir:/=\)\win32\configure.bat $(configure_args)
211
216
        @echo $(MKFILES) should be updated, re-run $(MAKE).
212
217
 
 
218
RUBY_CONFIG_H = $(arch_hdrdir)/ruby/config.h
213
219
CONFIG_H = ./.config.h.time
214
220
 
215
221
config: config.status
218
224
 
219
225
$(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub
220
226
        @echo Creating config.h
221
 
        @$(COMSPEC) /C $(srcdir:/=\)\win32\ifchange.bat config.h <<
 
227
!if !exist("$(arch_hdrdir)")
 
228
        @md $(arch_hdrdir:/=\)
 
229
!endif
 
230
!if !exist("$(arch_hdrdir)/ruby")
 
231
        @md $(arch_hdrdir:/=\)\ruby
 
232
!endif
 
233
        @$(COMSPEC) /C $(srcdir:/=\)\win32\ifchange.bat $(RUBY_CONFIG_H:/=\) <<
222
234
#if _MSC_VER != $(MSC_VER)
223
 
#error MSC version unmatch
 
235
#error MSC version unmatch: _MSC_VER: $(MSC_VER) is expected.
224
236
#endif
225
237
#define STDC_HEADERS 1
226
238
#define HAVE_SYS_TYPES_H 1
243
255
#define SIZEOF___INT64 8
244
256
#define _INTEGRAL_MAX_BITS 64
245
257
#define SIZEOF_OFF_T 8
 
258
!if "$(ARCH)" == "x64" || "$(ARCH)" == "ia64"
 
259
#define SIZEOF_VOIDP 8
 
260
!else
246
261
#define SIZEOF_VOIDP 4
 
262
!endif
247
263
#define SIZEOF_FLOAT 4
248
264
#define SIZEOF_DOUBLE 8
249
265
!if $(MSC_VER) >= 1400
263
279
!endif
264
280
#define FUNC_STDCALL(x) __stdcall x
265
281
#define FUNC_CDECL(x) __cdecl x
 
282
#define FUNC_FASTCALL(x) __fastcall x
266
283
#define RUBY_EXTERN extern __declspec(dllimport)
267
284
#define HAVE_DECL_SYS_NERR 1
268
285
#define HAVE_LIMITS_H 1
329
346
#define RUBY_LIB "/lib/ruby/$(MAJOR).$(MINOR)"
330
347
#define RUBY_SITE_LIB "/lib/ruby/site_ruby"
331
348
#define RUBY_SITE_LIB2 "/lib/ruby/site_ruby/$(MAJOR).$(MINOR)"
332
 
#define RUBY_PLATFORM "$(ARCH)-$(OS)"
 
349
#define RUBY_PLATFORM "$(arch)"
333
350
#define RUBY_ARCHLIB "/lib/ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(OS)"
334
351
#define RUBY_SITE_ARCHLIB "/lib/ruby/site_ruby/$(MAJOR).$(MINOR)/$(ARCH)-$(RT)"
335
352
<<
336
353
        @exit > $(@:/=\)
337
354
 
338
 
#!if exist(config.h)
 
355
#!if exist($(RUBY_CONFIG_H))
339
356
#! if exist(config_h.bak)
340
 
#       @del config_h.bak
 
357
#       @del $(RUBY_CONFIG_H:.h=_h).bak
341
358
#! endif
342
 
#       @ren config.h config_h.bak
 
359
#       @copy $(RUBY_CONFIG_H) $(RUBY_CONFIG_H:.h=_h).bak
343
360
#!endif
344
 
#       @ren config_h~ config.h
345
 
#!if exist(config.h)
 
361
#!if exist($(RUBY_CONFIG_H))
346
362
#       @echo NMAKE will abort if config.h is changed, then restart NMAKE.
347
 
#       @fc.exe config.h config_h.bak > nul
348
 
#       @echo config.h unchanged.
349
 
#       @del config.h
350
 
#       @ren config_h.bak config.h
 
363
#       @fc.exe $(RUBY_CONFIG_H) $(RUBY_CONFIG_H:.h=_h).bak > nul
 
364
#       @echo $(RUBY_CONFIG_H) unchanged.
 
365
#       @del $(RUBY_CONFIG_H)
 
366
#       @ren $(RUBY_CONFIG_H:.h=_h).bak $(RUBY_CONFIG_H)
351
367
#!endif
352
368
 
353
369
config.status: $(MKFILES) $(srcdir)/win32/Makefile.sub $(srcdir)/common.mk
456
472
s,@COMPILE_C@,$$(CC) $$(INCFLAGS) $$(CFLAGS) $$(CPPFLAGS) -c -Tc$$(<:\=/),;t t
457
473
s,@COMPILE_CXX@,$$(CXX) $$(INCFLAGS) $$(CXXFLAGS) $$(CPPFLAGS) -c -Tp$$(<:\=/),;t t
458
474
s,@COMPILE_RULES@,{$$(hdrdir)}.%s{}.%s: {$$(topdir)}.%s{}.%s: {$$(srcdir)}.%s{}.%s: .%s.%s:,;t t
459
 
s,@RULE_SUBST@,{.;$$(srcdir);$$(topdir);$$(hdrdir)}%s,;t t
 
475
s,@RULE_SUBST@,{.;$$(VPATH)}%s,;t t
460
476
s,@TRY_LINK@,$$(CC) -Feconftest $$(INCFLAGS) -I$$(hdrdir) $$(CPPFLAGS) $$(CFLAGS) $$(src) $$(LOCAL_LIBS) $$(LIBS) -link $$(LDFLAGS) $$(LIBPATH) $$(XLDFLAGS),;t t
461
477
s,@COMMON_LIBS@,m,;t t
462
478
s,@COMMON_MACROS@,WIN32_LEAN_AND_MEAN,;t t
466
482
s,@arch@,$(ARCH)-$(OS),;t t
467
483
s,@sitearch@,$(ARCH)-$(RT),;t t
468
484
s,@sitedir@,$${prefix}/lib/ruby/site_ruby,;t t
 
485
s,@rubyhdrdir@,$$(includedir)/ruby-$$(MAJOR).$$(MINOR),;t t
 
486
s,@sitehdrdir@,$$(rubyhdrdir)/site_ruby,;t t
469
487
s,@configure_args@,--with-make-prog=nmake --enable-shared $(configure_args),;t t
470
488
s,@configure_input@,$$configure_input,;t t
471
489
s,@srcdir@,$(srcdir),;t t
507
525
                $(LDSHARED_2)
508
526
 
509
527
$(RUBYDEF):     $(LIBRUBY_A) $(PREP)
510
 
                $(MINIRUBY) $(srcdir)/win32/mkexports.rb -output=$@ $(LIBRUBY_A)
 
528
                $(MINIRUBY) $(srcdir)/win32/mkexports.rb \
 
529
                  -output=$@ -arch=$(ARCH) $(LIBRUBY_A)
511
530
 
512
531
{$(srcdir)/win32}.def.lib:
513
532
                $(AR) $(ARFLAGS)$@ -def:$<
549
568
.rc.res:
550
569
        $(RC) -I. -I$(<D) $(iconinc) -I$(srcdir)/win32 $(RFLAGS) -fo$@ $(<:\=/)
551
570
 
 
571
lex.c: {$(srcdir)}lex.c.blt
 
572
        copy $(?:/=\) $@
 
573
 
552
574
{$(srcdir)}.y.c:
553
575
        $(YACC) $(YFLAGS) $(<:\=/)
554
576
        sed -e "s!^ *extern char \*getenv();!/* & */!;s/^\(#.*\)y\.tab/\1parse/" y.tab.c > $@
555
577
        @del y.tab.c
556
578
 
557
 
$(OBJS): {$(srcdir)}win32/win32.h
 
579
$(OBJS): {$(hdrdir)/ruby}win32.h
558
580
 
559
581
dir.$(OBJEXT) win32.$(OBJEXT): {$(srcdir)}win32/dir.h
560
582