File: build.templ

package info (click to toggle)
swi-prolog 5.10.1-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 76,436 kB
  • ctags: 45,143
  • sloc: ansic: 290,417; perl: 215,108; sh: 5,411; java: 5,136; makefile: 5,021; cpp: 2,168; yacc: 843; xml: 77; sed: 12
file content (170 lines) | stat: -rwxr-xr-x 5,558 bytes parent folder | download
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#!/bin/bash
#
# This is the script we use to   build  SWI-Prolog and all its packages.
# Copy the script to  `build',  edit   to  suit  the  local installation
# requirements and run it. Once correct, upgrading   to a new release is
# now limited to getting the new sources and run ./build.

# [EDIT] Prefix location of the installation. It is _not_ adviced to use
# a    versioned    prefix.    The    system      will     install    in
# $PREFIX/lib/pl-<version> and create symlinks from  $PREFIX/bin for the
# main  programs.  Users  can  always  use  older  versions  by  running
# $PREFIX/lib/pl-<version>/bin/<arch>/pl
#
# If you change PREFIX such that the system  is installed in a place for
# which you have no write access, set  SUDO   to  the command to run the
# remainder of the commandline as privilaged   user. E.g., if you change
# PREFIX to /usr/local/bin you typically must change SUDO to "sudo"

PREFIX=$HOME
SUDO=
#SUDO="sudo"

# [EDIT] Version of make  to  use.  This   must  be  GNU-make.  On  many
# proprietary Unix systems this is installed   as  'gmake'. On most open
# systems make is GNU-make. You can   use  'make --jbobs=<max>' to build
# the system faster using all your cores.   The  optimal value depends a
# lot on your hardware. Using  4  jobs   on  a  dual-core machines seems
# enough to keep both cores busy. (experimental).

MAKE=make
# MAKE='make --jobs=4'

# [EDIT] Compiler and options.
#
#	CC:	 Which C-compiler to use
#	COFLAGS: Flags for the optimizer such as "-O3" or "-g"
# 	CMFLAGS: Machine flags such as "-m64" (64-bits on gcc)
# 	CIFLAGS: Include-path such as "-I/opt/include"
# 	LDFLAGS: Link flags such as "-L/opt/lib"
#
# Leaving an option blank leaves the  choice to configure. The commented
# values below enable much better C-level debugging with almost the same
# performance on GCC based systems (the default is to compile using -O3)
# For optiomal performance, see also --enable-useprofile below.

# export CC=
# export COFLAGS="-O2 -gdwarf-2 -g3 -fno-strict-aliasing"
# export CMFLAGS=
# export CIFLAGS=
# export LDFLAGS="-O2 -g"

# On MacOS you need this to get some libraries from Macports
if [ "`uname`" = Darwin ]; then
  export LIBRARY_PATH=/usr/lib:/opt/local/lib
  export CPATH=/usr/include:/opt/local/include
  export PKG_CONFIG_PATH=/usr/X11R6/lib/pkgconfig:/opt/local/lib/pkgconfig
  export CXXCPP="g++ -E"
fi

# [EDIT] On Solaris also puts there stuff everywhere ...
# export CIFLAGS=-I/opt/csw/include/ncurses
# export LDFLAGS=-L/opt/csw/lib

export CFLAGS="$CMFLAGS $CIFLAGS"

################################################################
# Package (add-ons) selection
################################################################

# [EDIT] Packages to configure. Leaving it   blank  compiles all default
# packages. The final set of packages is
#
#	${PKG-<default>} + $EXTRA_PKGS - $DISABLE_PKGS

# export PKG=

# [EDIT] Packages to skip.  Leaving it blank compiles all packages.
# export DISABLE_PKGS="jpl ssl odbc"

# [EDIT] Packages to add.
# export EXTRA_PKGS="db ltx2htm space"

# [EDIT] Where to find the jar for Junit 3.8.  Needed to test jpl
# export JUNIT=/opt/local/share/java/junit.jar

################################################################
# Misc stuff
################################################################

# [EDIT] Extra options to pass to the toplevel configure.

# --link
# Using --link, the system is installed using symbolic links. This means
# you cannot remove or clean  the   sources,  but  it largely simplifies
# editing the system Prolog files during development.
#
# --enable-useprofile
# The config --enable-useprofile exploits GCC  -fprofile-use option. The
# system  is  compiled,  profiled   and    re-compiled   to  get  better
# branch-prediction. This makes the system approx.   10%  faster. Do not
# use this for developing the kernel because it complicates maintenance.
#
# --disable-libdirversion
# By default, the system is  installed in $libdir/swipl-<version>. Using
# this option drops <version>. Using versions,  you can install multiple
# versions side-by-site and run old  versions   at  any time by starting
# $libdir/swipl-<version>/bin/$arch/swipl. Without, the system is always
# at a nice stable place, so external foreign objects linked against the
# binary need not be updated with a Prolog update.
#
# EXTRACFG+=" --link"
# EXTRACFG+=" --enable-useprofile"
# EXTRACFG+=" --disable-libdirversion"
export EXTRACFG

################################################################
# No edit should be needed below this line
################################################################

V=`cat VERSION`
config=true
make=true
install=true
done=false
setvars=false

while test "$done" = false; do
case "$1" in
   --config)	make=false
		install=false
		shift
		;;
   --make)	config=false
		install=false
		shift
		;;
   --install)	config=false
		make=false
		shift
		;;
   --prefix=*)  PREFIX=`echo "$1" | sed 's/--prefix=//'`
   		shift
		;;
   --setvars)	setvars=true
   		shift
		;;
   *)		done=true
		;;
esac
done

if [ "$setvars" = "false" ]; then

  if [ "$config" = "true" ]; then
    ./configure --prefix=$PREFIX --with-world $EXTRACFG $@ 2>&1 | tee configure.out
    if [ "${PIPESTATUS[0]}" != 0 ]; then exit 1; fi
  fi

  if [ "$make" = "true" ]; then
    $MAKE $@ 2>&1 | tee make.out
    if [ "${PIPESTATUS[0]}" != 0 ]; then exit 1; fi
  fi

  if [ "$install" = "true" ]; then
    $MAKE install $@ 2>&1 | tee make-install.out
    if [ "${PIPESTATUS[0]}" != 0 ]; then exit 1; fi
  fi

fi # setvars