@@ -42,7 +42,8 @@ DIRECTX=no
4242FEATURES =HUGE
4343# Set to one of i386, i486, i586, i686 as the minimum target processor.
4444# For amd64/x64 architecture set ARCH=x86-64 .
45- ARCH =i686
45+ # If not set, it will be automatically detected. (Normally i686 or x86-64.)
46+ # ARCH=i686
4647# Set to yes to cross-compile from unix; no=native Windows (and Cygwin).
4748CROSS =no
4849# Set to path to iconv.h and libiconv.a to enable using 'iconv.dll'.
@@ -112,6 +113,46 @@ INTLLIB=gnu_gettext
112113# INTLPATH=$(GETTEXT)/lib
113114# INTLLIB=intl
114115
116+
117+ # Command definitions (depends on cross-compiling and shell)
118+ ifeq ($(CROSS ) ,yes)
119+ # cross-compiler prefix:
120+ ifndef CROSS_COMPILE
121+ CROSS_COMPILE = i586-pc-mingw32msvc-
122+ endif
123+ DEL = rm
124+ MKDIR = mkdir -p
125+ DIRSLASH = /
126+ else
127+ # normal (Windows) compilation:
128+ ifndef CROSS_COMPILE
129+ CROSS_COMPILE =
130+ endif
131+ ifneq (sh.exe, $(SHELL ) )
132+ DEL = rm
133+ MKDIR = mkdir -p
134+ DIRSLASH = /
135+ else
136+ DEL = del
137+ MKDIR = mkdir
138+ DIRSLASH = \\
139+ endif
140+ endif
141+ CC := $(CROSS_COMPILE ) gcc
142+ CXX := $(CROSS_COMPILE ) g++
143+ ifeq ($(UNDER_CYGWIN ) ,yes)
144+ WINDRES := $(CROSS_COMPILE ) windres
145+ else
146+ WINDRES := windres
147+ endif
148+ WINDRES_CC = $(CC )
149+
150+ # Get the default ARCH.
151+ ifndef ARCH
152+ ARCH := $(shell $(CC ) -dumpmachine | sed -e 's/-.* //')
153+ endif
154+
155+
115156# Perl interface:
116157# PERL=[Path to Perl directory] (Set inside Make_cyg.mak or Make_ming.mak)
117158# DYNAMIC_PERL=yes (to load the Perl DLL dynamically)
@@ -383,37 +424,6 @@ DEFINES=-DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \
383424ifeq ($(ARCH ) ,x86-64)
384425DEFINES+ =-DMS_WIN64
385426endif
386- ifeq ($(CROSS ) ,yes)
387- # cross-compiler prefix:
388- ifndef CROSS_COMPILE
389- CROSS_COMPILE = i586-pc-mingw32msvc-
390- endif
391- DEL = rm
392- MKDIR = mkdir -p
393- DIRSLASH = /
394- else
395- # normal (Windows) compilation:
396- ifndef CROSS_COMPILE
397- CROSS_COMPILE =
398- endif
399- ifneq (sh.exe, $(SHELL ) )
400- DEL = rm
401- MKDIR = mkdir -p
402- DIRSLASH = /
403- else
404- DEL = del
405- MKDIR = mkdir
406- DIRSLASH = \\
407- endif
408- endif
409- CC := $(CROSS_COMPILE ) gcc
410- CXX := $(CROSS_COMPILE ) g++
411- ifeq ($(UNDER_CYGWIN ) ,yes)
412- WINDRES := $(CROSS_COMPILE ) windres
413- else
414- WINDRES := windres
415- endif
416- WINDRES_CC = $(CC )
417427
418428# >>>>> end of choices
419429# ##########################################################################
0 commit comments