summaryrefslogtreecommitdiff
path: root/Jamrules
blob: cf0c3e637fc754efcb5f6bfbcf6ee632f822538c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# -------------------------------------------------------------------------
#
# Jamrules -- the build flags for Fitz and GhostPDF
# This file is sourced by Jamfile when making
# Put all configuration stuff here
#

if $(OS) = MINGW
{
	FREETYPECC ?= -Ih:/package/include ;
	FREETYPELD ?= -lfreetype ;
}

FREETYPECC ?= "`freetype-config --cflags`" ;
FREETYPELD ?= "`freetype-config --libs`" ;

# Optional modules:

HAVE_JBIG2DEC ?= no ;
HAVE_JASPER ?= no ;

# Select one of these for the GhostPDF GUI application if you are on unix

HAVE_X11 ?= no ;
HAVE_GTK ?= no ;

# -------------------------------------------------------------------------

# Default optimize/profile/debug compiler/linker switches
# Basic system should be mostly SUSv3 compliant
# These are good for GCC

FLAG_CCALL = -Wall -D_XOPEN_SOURCE=600 $(FREETYPECC) ;
FLAG_CCDEBUG = -g ;
FLAG_CCRELEASE = -O3 ;
FLAG_CCPROFILE = -g -pg ;
FLAG_LDPROFILE = -pg ;

# Now it gets hairy...

switch $(OS)
{
	case LINUX :
		NEED_STRLCPY = yes ;
		NEED_STRLCAT = yes ;
		NEED_STRSEP = yes ;
		FLAG_LDALL += -L/usr/X11R6/lib ;

		switch $(CC)-$(OSPLAT)
		{
		case icc-X86 :
			FLAG_CCRELEASE = -DARCH_X86 -O3 -ip -tpp6 -xM ;
			FLAG_CCPROFILE = -g -qp ;
		case gcc-X86 :
			# add -msse -msse2 when such functions exist...
			FLAG_CCRELEASE = -DARCH_X86 -O3 -march=pentium -mmmx ;
		}

	case MACOSX :
		FLAG_LDALL += -L/usr/X11R6/lib ;
		FLAG_CCALL += -std=gnu99 -DHAVE_C99 ;
		FLAG_CCRELEASE = -DARCH_PPC -faltivec -fast ;

	case MINGW :
		NEED_GETOPT = yes ;
		NEED_STRSEP = yes ;
		NEED_STRLCAT = yes ;
		NEED_STRLCPY = yes ;
		FLAG_CCALL += -std=gnu99 -DHAVE_C99 -DWIN32 ;
		NOARSCAN = yes ;

	case SOLARIS :
		NEED_STRSEP = yes ;
		FLAG_CCALL += -std=c89 ;
		FLAG_CCRELEASE += -DARCH_SPARC ;

	# Additional platforms go here

	case * :
		Echo "OS '$(OS)' not known by build system." ;
		Echo "If you get errors, please edit Jamrules." ;
		FLAG_CCALL += -std=c89 ;
}

# -------------------------------------------------------------------------
#
# Switch on BUILD type (profile, debug or release)
#

BUILD ?= debug ;

switch $(BUILD)
{
	case debug :
		Echo "Building DEBUG target" ;
		CCFLAGS = $(FLAG_CCALL) $(FLAG_CCDEBUG) ;
		LINKFLAGS = $(FLAG_LDALL) $(FLAG_LDDEBUG) ;
	case release :
		Echo "Building RELEASE target" ;
		CCFLAGS = $(FLAG_CCALL) $(FLAG_CCRELEASE) ;
		LINKFLAGS = $(FLAG_LDALL) $(FLAG_LDRELEASE) ;
	case profile :
		Echo "Building PROFILE target" ;
		CCFLAGS = $(FLAG_CCALL) $(FLAG_CCPROFILE) ;
		LINKFLAGS = $(FLAG_LDALL) $(FLAG_LDPROFILE) ;
	case * :
		Exit "Unknown BUILD target:" $(BUILD) ;
}