-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmakefile.optimizer
More file actions
executable file
·101 lines (83 loc) · 2.67 KB
/
Copy pathmakefile.optimizer
File metadata and controls
executable file
·101 lines (83 loc) · 2.67 KB
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
#This file is part of SECONDO.
#
#Copyright (C) 2004, University in Hagen, Department of Computer Science,
#Database Systems for New Applications.
#
#SECONDO is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2 of the License, or
#(at your option) any later version.
#
#SECONDO is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with SECONDO; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Check if Prolog variables are set and define macros used for
# compilation of the optimizer.
ifneq ($(OptMsg),"true")
ifeq ($(platform),win32)
ifndef SWI_HOME_DIR
$(warning Variable SWI_HOME_DIR not defined. If you want to use the optimizer you have to set it up!)
endif
endif
ifdef PL_INCLUDE_DIR
ifdef PL_LIB_DIR
optimizer := "true"
else
$(warning Variable PL_LIB_DIR not defined. If you want to use the optimizer you have to set it up!)
endif
else
$(warning Variable PL_INCLUDE_DIR not defined. If you want to use the optimizer you have to set it up!)
endif
ifndef PL_LIB
ifeq ($(platform),mac_osx)
PL_LIB = swipl
else
PL_LIB = pl
endif
endif
export PL_LIB_DIR PL_INCLUDE_DIR PL_LIB optimizer
export OptMsg := "true"
endif
ifeq ($(optimizer),"true")
# When the optimizer is compiled in, the default build must also generate the
# concatenated optimizer program (Optimizer/optimizer). It is consulted at
# runtime by the kernel server and the TTY, which embed the optimizer to run
# the SQL dialect. optimizer2 builds it.
OPTIMIZER_SERVER := optimizer2
AUXLIBS := $(SECONDO_SDK)/auxtools/lib
STDPLLDFLAGS := -L$(PL_LIB_DIR) -l$(PL_LIB)
ifdef STATIC_PL_LIB
STDPLLDFLAGS := $(STATIC_PL_LIB)
endif
# compilation options for the PROLOG shell
ifeq ($(platform),win32)
PLLDFLAGS := $(STDPLLDFLAGS) -lm
endif
platform2 := $(subst 64,,$(platform))
ifeq ($(platform2),linux)
ifndef GMP_LIB
LD_GMP := -lgmpxx -lgmp
else
LD_GMP := -l$(GMP_LIB)
endif
PLLDFLAGS := $(STDPLLDFLAGS) -lreadline -lncurses -lm -L$(AUXLIBS) $(LD_GMP)
endif
ifndef LIBREADLINE
LIBREADLINE=$(AUXLIBS)/libreadline.a
endif
ifeq ($(platform),mac_osx)
ifdef SECONDO_READLINE_DIR
MAC_READLINE := -L$(SECONDO_READLINE_DIR)/lib -lreadline
else
MAC_READLINE := -lreadline
endif
PLLDFLAGS := $(STDPLLDFLAGS) $(MAC_READLINE) -lncurses -lm
endif
PLLDFLAGS += -loptparser
endif