File: configure.ac

package info (click to toggle)
octplot 0.3.9-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,572 kB
  • ctags: 1,494
  • sloc: cpp: 7,570; ansic: 4,595; sh: 617; makefile: 122
file content (224 lines) | stat: -rw-r--r-- 7,656 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# Copyright (C) 2003 Shai Ayal <shaiay@users.sourceforge.net>
#  
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without 
# modifications, as long as this notice is preserved.
# 
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

AC_INIT(octplot, 0.3.9)
AC_CONFIG_SRCDIR(src/object.h)
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)

AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_PROG_LN_S
AC_CHECK_PROG(RM,rm,rm)
AC_PROG_CC
AC_PROG_CXX
AC_CHECK_HEADERS(ieeefp.h)

dnl -------------------------------------------------------------
dnl spirit.hpp needs to be tested with c++ obviously
dnl AC_LANG_PUSH(C++)
dnl compile_femtotex="no"
dnl AC_ARG_WITH(spirit,
dnl         [  --with-spirit-path      path to boost/spirit.hpp],
dnl         [ spirit_inc=-I$withval ],
dnl 	[ spirit_inc="" ])
dnl 
dnl CXXFLAGS="$spirit_inc $CXXFLAGS"
dnl AC_CHECK_HEADERS(
dnl 	[boost/spirit/core.hpp],
dnl 	[compile_femtotex="yes"],
dnl 	AC_MSG_WARN([spirit was not found on your system. femtoTeX support will not be compiled])
dnl )
dnl AM_CONDITIONAL(COMPILE_FEMTOTEX, test x$compile_femtotex = xyes)

dnl revert back since some tests assume it (notably FT2)
dnl AC_LANG_POP(C++)

dnl -------------------------------------------------------------
dnl Checks related to octave, mostly swiped form octave-forge
dnl
dnl
dnl

dnl Check for mkoctfile
AC_CHECK_PROG(MKOCTFILE,mkoctfile,mkoctfile)
test -z "$MKOCTFILE" && AC_MSG_WARN([no mkoctfile found on path])
                                                                                
AC_SUBST(ver)
AC_SUBST(subver)
AC_SUBST(minpath)
AC_SUBST(path)
AC_SUBST(opath)
dnl AC_SUBST(compile_femtotex)
                                                                                
AC_ARG_WITH(path,
        [  --with-path             install path prefix],
        [ path=$withval ])
AC_ARG_WITH(opath,
        [  --with-opath            override path for octplot-files],
        [ opath=$withval ])
AC_ARG_WITH(minpath,
        [  --with-minpath          override path for toggle_octplot (should be in your path)],
        [ minpath=$withval ])
                                                                                
if test -n "$path" ; then
   test -z "$opath" && opath=$path/octplot-$VERSION
fi

dnl Don't query if path/ver are given in the configure environment
if test -z "$opath" || test -z "$minpath";
then
                                                                                
   dnl Construct program to get mkoctfile version and local install paths
   cat > conftest.cc <<EOF
#include <octave/config.h>
#include <octave/version.h>
#include <octave/defaults.h>
                                                                                
#define INFOV "\nINFOV=" OCTAVE_VERSION "\n"
                                                                                
#ifdef OCTAVE_LOCALVERFCNFILEDIR
# define INFOM "\nINFOM=" OCTAVE_LOCALVERFCNFILEDIR "\n"
#else
# define INFOM "\nINFOM=" OCTAVE_LOCALFCNFILEPATH "\n"
#endif
                                                                                
#ifdef OCTAVE_LOCALVEROCTFILEDIR
# define INFOO "\nINFOO=" OCTAVE_LOCALVEROCTFILEDIR "\n"
#else
# define INFOO "\nINFOO=" OCTAVE_LOCALOCTFILEPATH  "\n"
#endif
                                                                                
#ifdef OCTAVE_LOCALVERARCHLIBDIR
# define INFOX "\nINFOX=" OCTAVE_LOCALVERARCHLIBDIR  "\n"
#else
# define INFOX "\nINFOX=" OCTAVE_LOCALARCHLIBDIR  "\n"
#endif
                                                                                
const char *infom = INFOM;
const char *infoo = INFOO;
const char *infox = INFOX;
const char *infov = INFOV;
EOF
                                                                                
   dnl Compile program perhaps with a special version of mkoctfile
   $MKOCTFILE conftest.cc || AC_MSG_ERROR(Could not run $MKOCTFILE)
                                                                                
 
   dnl Strip the config info from the compiled file
   eval `strings conftest.o | grep "^INFO.=" | sed -e "s,//.*$,,"`
   rm -rf conftest*
                                                                                
   dnl set the appropriate variables if they are not already set
   ver=`echo $INFOV | sed -e "s/\.//" -e "s/\..*$//"`
   subver=`echo $INFOV | sed -e "s/^[^.]*[.][^.]*[.]//"`
   alt_obase=`echo $INFOO | sed -e "[s,/site.*$,/site,]"`
   test -z "$opath"   && opath=$alt_obase/octplot-$VERSION
   test -z "$minpath" && minpath=$INFOM/octplot
fi
                                                                                
AC_CHECK_PROG(OCTAVE,octave,octave)
OCTAVE_VERSION=`echo "disp(OCTAVE_VERSION)" | $OCTAVE -qf`

dnl -------------------------------------------------------------
dnl Check for the fltk library
dnl
dnl Get the cflags and libraries from the fltk-config script
dnl

AC_ARG_WITH(fltk-prefix,
	[  --with-fltk-prefix=PFX   Prefix where FLTK is installed (optional)],
        fltk_prefix="$withval",
	fltk_prefix="")
AC_ARG_WITH(fltk-exec-prefix,
	[  --with-fltk-exec-prefix=PFX Exec prefix where FLTK is installed (optional)],
        fltk_exec_prefix="$withval", 
	fltk_exec_prefix="")

if test x$fltk_exec_prefix != x ; then
     fltk_args="$fltk_args --exec-prefix=$fltk_exec_prefix"
     if test x${FLTK_CONFIG+set} != xset ; then
        FLTK_CONFIG=$fltk_exec_prefix/bin/fltk-config
     fi
fi
if test x$fltk_prefix != x ; then
     fltk_args="$fltk_args --prefix=$fltk_prefix"
     if test x${FLTK_CONFIG+set} != xset ; then
        FLTK_CONFIG=$fltk_prefix/bin/fltk-config
     fi
fi
AC_PATH_PROG(FLTK_CONFIG, fltk-config, no)
no_fltk=""
if test "$FLTK_CONFIG" = "no" ; then
    AC_MSG_ERROR([
*** Unable to find Fltk2 library (http://www.fltk.org/)
])
else
    CFLAGS="$CFLAGS `$FLTK_CONFIG $fltkconf_args --use-gl --cflags`"
    CXXFLAGS="`$FLTK_CONFIG $fltkconf_args --use-gl --cxxflags` $CXXFLAGS"
    LIBS="$LIBS `$FLTK_CONFIG $fltkconf_args --use-gl --libs`"
    LIBS="$LIBS `$FLTK_CONFIG $fltkconf_args --use-gl --ldflags`"
    FLTK_VERSION=`$FLTK_CONFIG $fltkconf_args --version`
fi

AC_MSG_CHECKING(for OpenGL support in fltk)
cat > conftest.cc <<EOF
#include <FL/gl.h>
int nothing=0;
EOF
$CXX $CXXFLAGS -c conftest.cc || AC_MSG_ERROR([
*** your fltk was not compiled with OpenGL support
*** consult README for help
])
AC_MSG_RESULT(yes)


dnl -----------------------------------------------------------
dnl FTGL flags
dnl
dnl
dnl
dnl

AC_CHECK_FT2([9.0.3],[],
             [AC_MSG_ERROR([FreeType2 is required to compile this library])])

dnl the duplication of FTGL_LIBS is needed in cygwin since the linker
dnl is dependent on the order of the libs in the command line
LIBS="$LIBS $FT2_LIBS"

AC_DEFINE_UNQUOTED(
	MINPATH, 
	"$minpath", 
	m-file install path -- in the normal octave path)
AC_DEFINE_UNQUOTED(
	OPATH, 
	"$opath", 
	octplot install path -- all of octplot will go here)

AC_CONFIG_FILES(Makefile src/Makefile src/tests/Makefile fonts/Makefile demos/Makefile src/toggle_octplot.m)
AC_OUTPUT

AC_MSG_RESULT([
===================================================================

octplot files will install into:
   $opath

toggle_octplot.m will install into:
   $minpath

octplot is configured with:
   fltk:        version $FLTK_VERSION with OpenGl support
   octave:      $OCTAVE (version $OCTAVE_VERSION)
   mkoctfile:   $MKOCTFILE for Octave $subver
   femtoTeX:    work in progress ...
])