makegcc.mk to be merged into makefile.mk soon.
p4raw-id: //depot/win32/perl@346
push(@m, "\t$self->{CP} \$(MYEXTLIB) \$\@\n") if $self->{MYEXTLIB};
push @m,
-q{ $(AR) }.($BORLAND ? '$@ $(OBJECT:^"+")' : '-out:$@ $(OBJECT)').q{
+q{ $(AR) }.($BORLAND ? '$@ $(OBJECT:^"+")'
+ : ($GCC ? '-ru $@ $(OBJECT)'
+ : '-out:$@ $(OBJECT)')).q{
}.$self->{NOECHO}.q{echo "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)\extralibs.ld
$(CHMOD) 755 $@
};
');
if ($GCC) {
push(@m,
- q{ $(LD) -o $@ -Wl,--base-file -Wl,dll.base $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) dll.exp
+ q{ dlltool --def $(EXPORT_LIST) --output-exp dll.exp
+ $(LD) -o $@ -Wl,--base-file -Wl,dll.base $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) dll.exp
dlltool --def $(EXPORT_LIST) --base-file dll.base --output-exp dll.exp
$(LD) -o $@ $(LDDLFLAGS) }.$ldfrom.q{ $(OTHERLDFLAGS) $(MYEXTLIB) $(PERL_ARCHIVE) $(LDLOADLIBS) dll.exp });
} else {
# newly built perl.
INST_DRV=c:
INST_TOP=$(INST_DRV)\perl5004.5x
-#BUILDOPT=-DUSE_THREADS
+BUILDOPT=-DUSE_THREADS
#BUILDOPT=-DMULTIPLICITY
#BUILDOPT=-DMULTIPLICITY -DUSE_THREADS
-BUILDOPT=-DPERL_GLOBAL_STRUCT -DMULTIPLICITY
-CORECCOPT=
+#BUILDOPT=-DPERL_GLOBAL_STRUCT -DMULTIPLICITY
#
# uncomment next line if you are using Visual C++ 2.x
INCLUDES = -I.\include -I. -I..
#PCHFLAGS = -Fp"$(INTDIR)/modules.pch" -YX
DEFINES = -DWIN32 -D_CONSOLE $(BUILDOPT)
-LOCDEFS = -DPERLDLL $(CORECCOPT)
+LOCDEFS = -DPERLDLL -DPERL_CORE
SUBSYS = console
!IF "$(RUNTIME)" == "-MD"
!IF "$(CFG)" == "Debug"
! IF "$(CCTYPE)" == "MSVC20"
-OPTIMIZE = -Od $(RUNTIME) -Z7 -D_DEBUG
+OPTIMIZE = -Od $(RUNTIME) -Z7 -D_DEBUG -DDEBUGGING
! ELSE
-OPTIMIZE = -Od $(RUNTIME)d -Z7 -D_DEBUG
+OPTIMIZE = -Od $(RUNTIME)d -Z7 -D_DEBUG -DDEBUGGING
! ENDIF
LINK_DBG = -debug -pdb:none
!ELSE
..\toke.obj \
..\universal.obj\
..\util.obj \
- ..\malloc.obj
+ ..\malloc.obj
WIN32_C = perllib.c \
win32.c \
WIN32_OBJ = win32.obj \
win32sck.obj \
- win32thread.obj
+ win32thread.obj
PERL95_OBJ = perl95.obj \
win32mt.obj \
$(OPCODE_DLL) \
$(SDBM_FILE_DLL)\
$(IO_DLL) \
- $(ATTRS_DLL) \
+ $(ATTRS_DLL) \
$(THREAD_DLL)
POD2HTML=$(PODDIR)\pod2html
.\config.h : $(CFGH_TMPL)
-del /f config.h
copy $(CFGH_TMPL) config.h
-
..\config.sh : config.w32 $(MINIPERL) config_sh.PL
- $(MINIPERL) -I..\lib config_sh.PL "INST_DRV=$(INST_DRV)" \
- "INST_TOP=$(INST_TOP)" "cc=$(CC)" "ccflags=$(OPTIMIZE) $(DEFINES)" \
- "cf_email=$(EMAIL)" "libs=$(LIBFILES)" "incpath=$(CCINCDIR)" \
- "libpth=$(CCLIBDIR)" "libc=$(LIBC)" \
- "static_ext=$(STATIC_EXT)" "dynamic_ext=$(DYNAMIC_EXT)" \
- "ldflags=$(LINK_FLAGS)" "optimize=$(OPTIMIZE)" \
- config.w32 > ..\config.sh
+ $(MINIPERL) -I..\lib config_sh.PL \
+ "INST_DRV=$(INST_DRV)" \
+ "INST_TOP=$(INST_TOP)" \
+ "cc=$(CC)" \
+ "ccflags=$(OPTIMIZE) $(DEFINES)" \
+ "cf_email=$(EMAIL)" \
+ "libs=$(LIBFILES)" \
+ "incpath=$(CCINCDIR)" \
+ "libpth=$(CCLIBDIR)" \
+ "libc=$(LIBC)" \
+ "static_ext=$(STATIC_EXT)" \
+ "dynamic_ext=$(DYNAMIC_EXT)" \
+ "ldflags=$(LINK_FLAGS)" \
+ "optimize=$(OPTIMIZE)" \
+ config.w32 > ..\config.sh
$(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl
cd .. && miniperl configpm
$(DLL_OBJ) : $(CORE_H)
$(PERL95_OBJ) : $(CORE_H)
-perldll.def : $(MINIPERL) $(CONFIGPM) makedef.pl ..\global.sym
- $(MINIPERL) -w makedef.pl $(DEFINES) $(CCTYPE) > perldll.def
+perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym makedef.pl
+ $(MINIPERL) -w makedef.pl $(OPTIMIZE) $(DEFINES) \
+ CCTYPE=$(CCTYPE) > perldll.def
$(PERLDLL): perldll.def $(CORE_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
$(LINK32) -dll -def:perldll.def -out:$@ @<<
afs='false'
alignbytes='8'
aphostname=''
-ar='lib'
+ar='ar'
archlib='~INST_TOP~\lib'
archobjs=''
awk='awk'
# that does not present in the WIN32 port but there is no easy
# way to find them so I just put a exception list here
-while (@ARGV && $ARGV[0] =~ /^-/)
+my $CCTYPE = "MSVC"; # default
+
+while (@ARGV)
{
my $flag = shift;
$define{$1} = 1 if ($flag =~ /^-D(\w+)$/);
+ $CCTYPE = $1 if ($flag =~ /^CCTYPE=(\w+)$/);
}
open(CFG,'config.h') || die "Cannot open config.h:$!";
warn join(' ',keys %define)."\n";
-my $CCTYPE = shift || "MSVC";
-
if ($CCTYPE ne 'GCC')
{
print "LIBRARY Perl\n";
Perl_sv_uv
Perl_sv_pvn
Perl_newRV_noinc)];
+ }
+unless ($define{'FAKE_THREADS'})
+ {
+ skip_symbols [qw(Perl_curthr)];
}
sub readvar
INST_DRV=c:
INST_TOP=$(INST_DRV)\perl5004.5x
BUILDOPT=-DUSE_THREADS
+#BUILDOPT=-DMULTIPLICITY
+#BUILDOPT=-DMULTIPLICITY -DUSE_THREADS
+#BUILDOPT=-DPERL_GLOBAL_STRUCT -DMULTIPLICITY
# -DUSE_PERLIO -D__STDC__=1 -DUSE_SFIO -DI_SFIO -I\sfio97\include
WINIOMAYBE =
.IF "$(CFG)" == "Debug"
-OPTIMIZE = -v $(RUNTIME)
+OPTIMIZE = -v $(RUNTIME) -DDEBUGGING
LINK_DBG = -v
.ELSE
OPTIMIZE = -5 -O2 $(RUNTIME)
LINK_DBG =
.ENDIF
-CFLAGS = -w -tWM -tWD $(INCLUDES) $(DEFINES) $(LOCDEFS) $(PCHFLAGS) $(OPTIMIZE)
+CFLAGS = -w -d -tWM -tWD $(INCLUDES) $(DEFINES) $(LOCDEFS) $(PCHFLAGS) $(OPTIMIZE)
LINK_FLAGS = $(LINK_DBG) -L$(CCLIBDIR)
OBJOUT_FLAG = -o
.IF "$(CFG)" == "Debug"
.IF "$(CCTYPE)" == "MSVC20"
-OPTIMIZE = -Od $(RUNTIME) -Z7 -D_DEBUG
+OPTIMIZE = -Od $(RUNTIME) -Z7 -D_DEBUG -DDEBUGGING
.ELSE
-OPTIMIZE = -Od $(RUNTIME)d -Z7 -D_DEBUG
+OPTIMIZE = -Od $(RUNTIME)d -Z7 -D_DEBUG -DDEBUGGING
.ENDIF
LINK_DBG = -debug -pdb:none
.ELSE
..\taint.obj \
..\toke.obj \
..\universal.obj\
- ..\util.obj \
+ ..\util.obj \
..\malloc.obj
WIN32_C = perllib.c \
..\XSUB.h \
.\config.h \
..\EXTERN.h \
+ ..\perlvars.h \
+ ..\intrpvar.h \
+ ..\thrdvar.h \
.\include\dirent.h \
.\include\netdb.h \
.\include\sys\socket.h \
copy $(CFGH_TMPL) config.h
..\config.sh : config.w32 $(MINIPERL) config_sh.PL
- $(MINIPERL) -I..\lib config_sh.PL "INST_DRV=$(INST_DRV)" \
- "INST_TOP=$(INST_TOP)" "cc=$(CC)" "ccflags=$(OPTIMIZE) $(DEFINES)" \
- "cf_email=$(EMAIL)" "libs=$(LIBFILES:f)" "incpath=$(CCINCDIR)" \
- "libpth=$(strip $(CCLIBDIR) $(LIBFILES:d))" "libc=$(LIBC)" \
- "static_ext=$(STATIC_EXT)" "dynamic_ext=$(DYNAMIC_EXT)" \
- "ldflags=$(LINK_FLAGS)" "optimize=$(OPTIMIZE)" \
- config.w32 > ..\config.sh
+ $(MINIPERL) -I..\lib config_sh.PL \
+ "INST_DRV=$(INST_DRV)" \
+ "INST_TOP=$(INST_TOP)" \
+ "cc=$(CC)" \
+ "ccflags=$(OPTIMIZE) $(DEFINES)" \
+ "cf_email=$(EMAIL)" \
+ "libs=$(LIBFILES:f)" \
+ "incpath=$(CCINCDIR)" \
+ "libpth=$(strip $(CCLIBDIR) $(LIBFILES:d))" \
+ "libc=$(LIBC)" \
+ "static_ext=$(STATIC_EXT)" \
+ "dynamic_ext=$(DYNAMIC_EXT)" \
+ "ldflags=$(LINK_FLAGS)" \
+ "optimize=$(OPTIMIZE)" \
+ config.w32 > ..\config.sh
$(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl
cd .. && miniperl configpm
$(DLL_OBJ) : $(CORE_H)
perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym makedef.pl
- $(MINIPERL) -w makedef.pl $(DEFINES) $(CCTYPE) > perldll.def
+ $(MINIPERL) -w makedef.pl $(OPTIMIZE) $(DEFINES) \
+ CCTYPE=$(CCTYPE) > perldll.def
$(PERLDLL): perldll.def $(CORE_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
.IF "$(CCTYPE)" == "BORLAND"
perlmain.obj : perlmain.c
$(CC) $(CFLAGS) -UPERLDLL -c perlmain.c
-
$(PERLEXE): $(PERLDLL) $(CONFIGPM) perlmain.obj
.IF "$(CCTYPE)" == "BORLAND"
$(LINK32) -Tpe -ap $(LINK_FLAGS) \
copy runperl.c perl95.c
perl95.obj : perl95.c
- $(CC) $(CFLAGS) -MT -UPERLDLL -c perl95.c
+ $(CC) $(CFLAGS) -MT -UPERLDLL -DWIN95FIX -c perl95.c
win32sckmt.obj : win32sck.c
- $(CC) $(CFLAGS) -MT -c $(OBJOUT_FLAG)win32sckmt.obj win32sck.c
+ $(CC) $(CFLAGS) -MT -UPERLDLL -DWIN95FIX -c $(OBJOUT_FLAG)win32sckmt.obj win32sck.c
win32mt.obj : win32.c
- $(CC) $(CFLAGS) -MT -c $(OBJOUT_FLAG)win32mt.obj win32.c
+ $(CC) $(CFLAGS) -MT -UPERLDLL -DWIN95FIX -c $(OBJOUT_FLAG)win32mt.obj win32.c
$(PERL95EXE): $(PERLDLL) $(CONFIGPM) $(PERL95_OBJ)
$(LINK32) -subsystem:console -out:perl95.exe $(LINK_FLAGS) $(LIBFILES) \
$(XCOPY) ..\*.h ..\lib\CORE\*.*
$(XCOPY) *.h ..\lib\CORE\*.*
$(RCOPY) include ..\lib\CORE\*.*
- $(MINIPERL) -I..\lib config_h.PL || $(MAKE) CCTYPE=$(CCTYPE) \
- RUNTIME=$(RUNTIME) CFG=$(CFG) $(CONFIGPM)
+ $(MINIPERL) -I..\lib config_h.PL || $(MAKE) -f makegcc.mk \
+ CCTYPE=$(CCTYPE) RUNTIME=$(RUNTIME) CFG=$(CFG) $(CONFIGPM)
LKPRE = INPUT (
LKPOST = )
/* Compiler-specific stuff. */
-#ifdef __BORLANDC__ /* Microsoft Visual C++ */
+#ifdef __BORLANDC__ /* Borland C++ */
#define _access access
#define _chdir chdir
#pragma warn -csu
#pragma warn -pro
-#else
+#endif
#ifdef _MSC_VER /* Microsoft Visual C++ */
#endif /* _MSC_VER */
+#ifdef __MINGW32__ /* Minimal Gnu-Win32 */
+
+typedef long uid_t;
+typedef long gid_t;
+
+#endif /* __MINGW32__ */
+
/* compatibility stuff for other compilers goes here */
-#endif
START_EXTERN_C