File: extconf.rb

package info (click to toggle)
mapserver 5.0.3-3%2Blenny7
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 13,556 kB
  • ctags: 12,645
  • sloc: ansic: 168,024; cs: 8,534; python: 4,618; sh: 4,213; cpp: 4,059; perl: 2,781; makefile: 787; lex: 564; java: 415; yacc: 334; tcl: 158; ruby: 53
file content (30 lines) | stat: -rwxr-xr-x 912 bytes parent folder | download | duplicates (5)
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
#!/usr/bin/env ruby 
require 'mkmf'

mapscriptvars = File.open("../../mapscriptvars")
make_home = mapscriptvars.gets.chomp
make_define = mapscriptvars.gets.chomp
make_inc = mapscriptvars.gets.chomp
make_libs = mapscriptvars.gets.chomp
make_static_libs = mapscriptvars.gets.chomp
mapscriptvars.close

# $CFLAGS works only with 1.8 ??? -> the -Wall argument is not needed !!!
$CFLAGS = ""
$CPPFLAGS = make_inc + " -idirafter $(rubylibdir)/$(arch) " + make_define
$LDFLAGS += " -fPIC"
$LOCAL_LIBS += " -L../.. " + make_libs + " " + make_static_libs

# if the source file 'mapscript_wrap.c' is missing nothing works
# this is a workaround !!
if !FileTest.exist?("mapscript_wrap.c")
	$objs = []
	$objs.push("mapscript_wrap.o")
end

create_makefile("mapscript")

make_file = File.open("Makefile", "a")
make_file << "\nmapscript_wrap.c: ../mapscript.i\n\tswig -ruby -o mapscript_wrap.c ../mapscript.i"
make_file.close