GNUmakefile 5.36 KB
Newer Older
1
2
3
4
5
6
# $Id$

SRC_ROOT = ../../src
# Cross platform/compiler definitions
include $(SRC_ROOT)/build/Common.gmake	# defines clean and output directory rules

7
JS_CONFIGURE_ARGS += $(EXTRA_JS_CONFIGURE_ARGS) --with-system-nspr --disable-tests --disable-shared-js --enable-threadsafe --prefix=$(shell echo `pwd`$(DIRSEP)$(JS_IDIR))
8
ifdef DEBUG
9
 JS_CONFIGURE_ARGS += --enable-debug-symbols --disable-optimize
10
11
12
else
 JS_CONFIGURE_ARGS += --enable-optimize=-O3
endif
13
CXXFLAGS = -std=gnu++98
14
15
16
17
18
19
20
ifeq ($(shell perl -e 'print "$(machine)"=~/\.arm/?"YES":"NO"'),YES)
 ifeq ($(shell perl -e 'print "$(machine)"=~/\.armv[1-6]/?"YES":"NO"'),YES)
  JS_CONFIGURE_ARGS += --with-cpu-arch=armv5te
 endif
 ifeq ($(shell perl -e 'print `gcc -v 2>&1`=~/--with-fpu=vfp/?"YES":"NO"'),YES)
  ifeq ($(shell perl -e 'print `gcc -v 2>&1`=~/--with-float=hard/?"YES":"NO"'),YES)
   JS_CONFIGURE_ENV += 'CFLAGS=-mfpu=vfp -mfloat-abi=hard'
21
   CXXFLAGS += -mfpu=vfp -mfloat-abi=hard
22
23
24
   JS_CONFIGURE_ENV += 'ASFLAGS=-mfpu=vfp -mfloat-abi=hard'
  else
   JS_CONFIGURE_ENV += 'CFLAGS=-msoft-float'
25
   CXXFLAGS += -msoft-float
26
27
28
29
   JS_CONFIGURE_ENV += 'ASFLAGS=-msoft-float'
  endif
 endif
endif
30
JS_CONFIGURE_ENV += 'CXXFLAGS=$(CXXFLAGS)'
31

32
33
34
35
.PHONY: cryptlib libmozjs
cryptlib: $(CRYPTLIB_BUILD)
libmozjs: $(JSLIB_BUILD)

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
###############
# Directories #
###############
$(3RDPODIR):
	$(QUIET)$(IFNOTEXIST) mkdir $(3RDPODIR)

$(3RDPSRCDIR):
	$(QUIET)$(IFNOTEXIST) mkdir $(3RDPSRCDIR)

$(JS_SRC): | $(3RDPSRCDIR)
	$(QUIET)$(IFNOTEXIST) mkdir $(JS_SRC)

$(JS_IDIR): | $(3RDPODIR)
	$(QUIET)$(IFNOTEXIST) mkdir $(JS_IDIR)

51
$(JSLIB_BUILD): $(3RDP_ROOT)$(DIRSEP)dist/libmozjs.tgz $(3RDP_ROOT)$(DIRSEP)build/js_src_jsnativestack_cpp.patch $(3RDP_ROOT)$(DIRSEP)build/js-configure.patch $(3RDP_ROOT)$(DIRSEP)build/js-configure.in.patch | $(JS_SRC) $(JS_IDIR)
52
	@echo Creating $@ ...
53
	$(QUIET)-rm -rf $(JS_SRC)/*
54
	$(QUIET)tar -xzC $(JS_SRC) -f $(3RDPDISTDIR)$(DIRSEP)libmozjs.tgz
55
	$(QUIET)echo "pthread_np.h" >> $(JS_SRC)$(DIRSEP)js-1.8.5$(DIRSEP)js$(DIRSEP)src$(DIRSEP)config$(DIRSEP)system-headers
56
	$(QUIET)patch -p0 -d $(JS_SRC)$(DIRSEP)js-1.8.5 < js_src_jsnativestack_cpp.patch
57
	$(QUIET)patch -p0 -d $(JS_SRC) < js-configure.patch
58
	$(QUIET)patch -p0 -d $(JS_SRC) < js-configure.in.patch
59
	-$(QUIET)cd $(JS_SRC)$(DIRSEP)js-1.8.5$(DIRSEP)js$(DIRSEP)src && autoconf-2.13
60
	$(QUIET)cd $(JS_SRC)$(DIRSEP)js-1.8.5$(DIRSEP)js$(DIRSEP)src && env $(JS_CONFIGURE_ENV) ./configure $(JS_CONFIGURE_ARGS)
61
62
63
64
65
66
67
68
69
	$(QUIET)$(MAKE) -C $(JS_SRC)$(DIRSEP)js-1.8.5$(DIRSEP)js$(DIRSEP)src
	$(QUIET)$(MAKE) -C $(JS_SRC)$(DIRSEP)js-1.8.5$(DIRSEP)js$(DIRSEP)src install

$(CRYPT_SRC): | $(3RDPSRCDIR)
	$(QUIET)$(IFNOTEXIST) mkdir $(CRYPT_SRC)

$(CRYPT_IDIR): | $(3RDPODIR)
	$(QUIET)$(IFNOTEXIST) mkdir $(CRYPT_IDIR)

70
$(CRYPTLIB_BUILD): $(3RDP_ROOT)$(DIRSEP)dist/cryptlib.zip $(3RDP_ROOT)$(DIRSEP)build/SSL-fix.patch $(3RDP_ROOT)$(DIRSEP)build/Dynamic-linked-static-lib.patch $(3RDP_ROOT)$(DIRSEP)build/terminal-params.patch $(3RDP_ROOT)$(DIRSEP)build/cl-mingw32-static.patch $(3RDP_ROOT)$(DIRSEP)build/cl-ranlib.patch $(3RDP_ROOT)$(DIRSEP)build/cl-PAM-noprompts.patch $(3RDP_ROOT)$(DIRSEP)build/cl-getseed64.patch $(3RDP_ROOT)$(DIRSEP)build/cl-endian.patch $(3RDP_ROOT)$(DIRSEP)build/cl-win32-compile.patch $(3RDP_ROOT)$(DIRSEP)build/cl-win32-compile2.patch $(3RDP_ROOT)$(DIRSEP)build/cl-win32-noasm.patch $(3RDP_ROOT)$(DIRSEP)build/cl-zz-country.patch $(3RDP_ROOT)$(DIRSEP)build/cl-algorithms.patch $(3RDP_ROOT)$(DIRSEP)build/cl-allow-duplicate-ext.patch $(3RDP_ROOT)$(DIRSEP)build/cl-select-fix.patch $(3RDP_ROOT)$(DIRSEP)build/cl-short-client-name.patch | $(CRYPT_SRC) $(CRYPT_IDIR)
71
	@echo Creating $@ ...
72
	$(QUIET)-rm -rf $(CRYPT_SRC)/*
73
	$(QUIET)unzip -oa $(3RDPDISTDIR)$(DIRSEP)cryptlib.zip -d $(CRYPT_SRC)
74
	$(QUIET)perl -pi.bak -e 's/\r//' $(CRYPT_SRC)/crypt32.vcxproj
75
	$(QUIET)patch -p0 -d $(CRYPT_SRC) < SSL-fix.patch
76
	$(QUIET)patch -p0 -d $(CRYPT_SRC) < Dynamic-linked-static-lib.patch
77
	$(QUIET)patch -p0 -d $(CRYPT_SRC) < terminal-params.patch
deuce's avatar
deuce committed
78
79
	$(QUIET)patch -p0 -d $(CRYPT_SRC) < cl-mingw32-static.patch
	$(QUIET)patch -p0 -d $(CRYPT_SRC) < cl-ranlib.patch
80
	$(QUIET)patch -p0 -d $(CRYPT_SRC) < cl-vcxproj.patch
81
	$(QUIET)patch -p0 -d $(CRYPT_SRC) < cl-PAM-noprompts.patch
82
83
84
85
86
	$(QUIET)patch -p0 -d $(CRYPT_SRC) < cl-getseed64.patch
	$(QUIET)patch -p0 -d $(CRYPT_SRC) < cl-endian.patch
	$(QUIET)patch -p0 -d $(CRYPT_SRC) < cl-win32-compile.patch
	$(QUIET)patch -p0 -d $(CRYPT_SRC) < cl-win32-compile2.patch
	$(QUIET)patch -p0 -d $(CRYPT_SRC) < cl-win32-noasm.patch
87
	$(QUIET)patch -p0 -d $(CRYPT_SRC) < cl-zz-country.patch
deuce's avatar
deuce committed
88
	$(QUIET)patch -p0 -d $(CRYPT_SRC) < cl-algorithms.patch
89
	$(QUIET)patch -p0 -d $(CRYPT_SRC) < cl-allow-duplicate-ext.patch
90
	$(QUIET)patch -p0 -d $(CRYPT_SRC) < cl-select-fix.patch
91
	$(QUIET)patch -p0 -d $(CRYPT_SRC) < cl-short-client-name.patch
deuce's avatar
deuce committed
92
ifeq ($(CC),mingw32-gcc)
93
94
95
	$(QUIET)cd $(CRYPT_SRC) && env - PATH="$(PATH)" CC="$(CC)" AR="$(AR)" RANLIB="$(RANLIB)" make directories
	$(QUIET)cd $(CRYPT_SRC) && env - PATH="$(PATH)" CC="$(CC)" AR="$(AR)" RANLIB="$(RANLIB)" make toolscripts
	$(QUIET)cd $(CRYPT_SRC) && env - PATH="$(PATH)" CC="$(CC)" AR="$(AR)" RANLIB="$(RANLIB)" make MINGW32_NT-6.1 OSNAME=win32
deuce's avatar
deuce committed
96
97
else
ifdef MINGW32
98
	$(QUIET)cd $(CRYPT_SRC) && env - PATH="$(PATH)" CC="$(CC)" AR="$(AR)" RANLIB="$(RANLIB)" make target-mingw
deuce's avatar
deuce committed
99
else
100
	$(QUIET)cd $(CRYPT_SRC) && env - PATH="$(PATH)" CC="$(CC)" AR="$(AR)" RANLIB="$(RANLIB)" make
deuce's avatar
deuce committed
101
102
endif
endif
103
104
	$(QUIET)cp $(CRYPT_SRC)$(DIRSEP)libcl.a $(CRYPT_IDIR)
	$(QUIET)cp $(CRYPT_SRC)$(DIRSEP)cryptlib.h $(CRYPT_IDIR)