GEOSPolygonize_full [RT-SIGTA]
[geos.git] / macros / ruby.m4
blob311b51be47394b7bcdc51f9550396957ce6681dd
1 ## ------------------------       
2 ## Ruby file handling
3 ## From Charlie Savage
4 ## ------------------------
5 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
6 # Free Software Foundation, Inc.
8 # This file is free software; the Free Software Foundation
9 # gives unlimited permission to copy and/or distribute it,
10 # with or without modifications, as long as this notice is preserved.
13 AC_DEFUN([AC_RUBY_DEVEL],
15         dnl Find a Ruby interpreter     
16   AC_PATH_PROG([RUBY],[ruby])
17   
18   if test -z "$RUBY" ; then
19                 AC_MSG_ERROR([Could not find ruby interpreter.])
20     RUBY=''
21   else
22                 dnl Get Ruby version number
23                 RUBY_VERSION=`$RUBY -e "puts RUBY_VERSION"`
25                 dnl Get Ruby bin directory
26                 RUBY_BIN_DIR=`$RUBY -rrbconfig -e 'puts Config::CONFIG[["bindir"]]'`
27                 
28                 dnl Get Ruby include directory
29                 RUBY_INCLUDE_DIR=`$RUBY -rrbconfig -e 'puts Config::CONFIG[["archdir"]]'`
30         
31                 dnl Get Ruby lib directory
32                 RUBY_LIB_DIR=`$RUBY -rrbconfig -e 'puts Config::CONFIG[["libdir"]]'`
34                 dnl Get Ruby extensions directory
35                 RUBY_EXTENSION_DIR=`$RUBY -rrbconfig -e 'puts Config::CONFIG[["sitearchdir"]]'`
37                 dnl Get Ruby shared library name, this does not include the lib prefix or extension name
38                 RUBY_SO_NAME=`$RUBY -rrbconfig -e 'puts Config::CONFIG[["RUBY_SO_NAME"]]'`
39                 
40                 dnl Get Ruby shared libary name
41                 RUBY_SHARED_LIB=`$RUBY -rrbconfig -e 'puts Config::CONFIG[["LIBRUBY"]]'`
42                 
43     AC_MSG_NOTICE([Ruby executable is '$RUBY'])
44     AC_MSG_NOTICE([Ruby version is '$RUBY_VERSION'])
45     AC_MSG_NOTICE([Ruby bin directory is '$RUBY_BIN_DIR'])
46     AC_MSG_NOTICE([Ruby include directory is '$RUBY_INCLUDE_DIR'])
47     AC_MSG_NOTICE([Ruby library directory is '$RUBY_LIB_DIR'])
48     AC_MSG_NOTICE([Ruby extension directory is '$RUBY_EXTENSION_DIR'])
49     AC_MSG_NOTICE([Ruby library is '$RUBY_SO_NAME'])
50     AC_MSG_NOTICE([Ruby import library is '$RUBY_SHARED_LIB'])
51    
52     AC_SUBST([RUBY_VERSION])
53     AC_SUBST([RUBY_BIN_DIR])
54     AC_SUBST([RUBY_INCLUDE_DIR])
55     AC_SUBST([RUBY_LIB_DIR])
56     AC_SUBST([RUBY_EXTENSION_DIR])
57     AC_SUBST([RUBY_SO_NAME])
58     AC_SUBST([RUBY_SHARED_LIB])
59         fi
60   AC_SUBST([RUBY])