File: configure.in

package info (click to toggle)
gp2c 0.0.5pl2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,508 kB
  • ctags: 1,114
  • sloc: ansic: 8,284; sh: 544; lex: 337; yacc: 158; makefile: 135
file content (185 lines) | stat: -rw-r--r-- 5,893 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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/gp2c.c)
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE(gp2c,0.0.5pl2)
AM_MAINTAINER_MODE dnl Be nice with packagers.
AM_CONFIG_HEADER(src/config.h)
dnl AC_PREFIX_PROGRAM(gp)
dnl Checks for programs.
AC_PROG_CC
AM_PROG_LEX
AC_PROG_YACC

dnl look for perl
AC_ARG_WITH(perl,
[  --with-perl[=FILE]  Perl is needed to compile the description files, but gp2c
               come with a precompiled description for PARI 2.3. so you can
	       use it without perl.  Default is to use perl if it is found.
	       You can specify the path to perl with --with-perl=PATH.])
if test "$with_perl" = "no"; then
  PERL_PATH=/bin/false
elif test -x "$with_perl"; then
  PERL_PATH="$with_perl"
else
  AC_PATH_PROG(PERL_PATH,perl,/bin/false)
fi

dnl check for PARI configuration
AC_ARG_WITH(paricfg,
[  --with-paricfg[=FILE]  PARI configuration is needed to build plug-ins.
               gp2c itself can be compiled without it, but gp2c-run and 
	       'make check' will not work.
	       You must specify the path to the 'pari.cfg' file  with 
               --with-paricfg=PATH.])
  

if test "$with_paricfg" = "no" ; then
  PARI_CONFIG=
else
  AC_MSG_CHECKING(for PARI configuration)
  if test "$with_paricfg" = "yes" || test "x$with_paricfg" = "x" ; then
    test -f /usr/lib/pari/pari.cfg && PARI_CONFIG=/usr/lib/pari/pari.cfg
    test -f /usr/local/lib/pari/pari.cfg && PARI_CONFIG=/usr/local/lib/pari/pari.cfg
    test -f "$srcdir/../pari.cfg" && PARI_CONFIG="$srcdir/../pari.cfg"
    test -f "$srcdir/pari.cfg" && PARI_CONFIG="$srcdir/pari.cfg"
  else
    test -f "$with_paricfg" && PARI_CONFIG="$with_paricfg"
  fi
  if test "x$with_paricfg" != "x" && test "x$PARI_CONFIG" = "x" ; then
    AC_MSG_ERROR([pari.cfg file not found. Please use 
--with-paricfg=PATH where PATH is the path to pari.cfg or 
dft.Config.in file.])
  fi
  if test "x$PARI_CONFIG" = "x"; then
    AC_MSG_RESULT("not found")
  else
    AC_MSG_RESULT($PARI_CONFIG)
  fi
fi

AC_ARG_WITH(paricfg-dbg,
[  --with-paricfg-dbg[=FILE] gp2c-dbg is more useful with the debugging version
               of PARI. You can specify the path to the 'pari.cfg' file of a
               debugging version with --with-paricfg-dbg=PATH while still using
               the optimised version with gp2c-run. ])

if test "$with_paricfg_dbg" = "no" ; then
  PARI_CONFIG_DBG=
else
  AC_MSG_CHECKING([for PARI configuration (debugging)])
  if test "$with_paricfg_dbg" = "yes" || test "x$with_paricfg_dbg" = "x" ; then
    test -f "$srcdir/../pari.cfg.dbg" && PARI_CONFIG_DBG="$srcdir/../pari.cfg.dbg"
    test -f "$srcdir/pari.cfg.dbg" && PARI_CONFIG_DBG="$srcdir/pari.cfg.dbg"
  else
    test -f "$with_paricfg_dbg" && PARI_CONFIG_DBG="$with_paricfg_dbg"
  fi
  if test "x$with_paricfg_dbg" != "x" && test "x$PARI_CONFIG_DBG" = "x" ; then
    AC_MSG_ERROR([pari.cfg[.dbg] file not found. Please use 
--with-paricfg-dbg=PATH where PATH is the path to pari.cfg[.dbg] or 
dft.Config.in file.])
  fi
  if test "x$PARI_CONFIG_DBG" = "x"; then
    AC_MSG_RESULT("not found")
  else
    AC_MSG_RESULT($PARI_CONFIG_DBG)
  fi
fi

if test "x$PARI_CONFIG" !=  "x" ; then 
  AC_MSG_CHECKING(for PARI version)
  PARI_VERSION=`$srcdir/config/pari-version $PARI_CONFIG`
  AC_MSG_RESULT($PARI_VERSION)
  
  AC_MSG_CHECKING(for PARI module build)
  PARI_MODULE_BUILD=`$srcdir/config/module-build $PARI_CONFIG`
  AC_MSG_RESULT($PARI_MODULE_BUILD)

  AC_MSG_CHECKING(for GP path)
  GP_PATH=`$srcdir/config/pari-conf $PARI_CONFIG bindir`/gp
  AC_MSG_RESULT($GP_PATH)
  
  AC_MSG_CHECKING(for PARI data directory)
  PARI_DATADIR=`$srcdir/config/pari-conf $PARI_CONFIG datadir`
  AC_MSG_RESULT($PARI_DATADIR)
  
  AC_MSG_CHECKING(for PARI description database)
  PARI_DESC="$PARI_DATADIR/pari.desc";
  test -f "$PARI_DESC" || PARI_DESC="pari21.desc";
  AC_MSG_RESULT($PARI_DESC)
else
  PARI_VERSION='2.1.x (released)'
  PARI_MODULE_BUILD="`pwd`/$srcdir/config/missing $PARI_CONF";
  GP_PATH="gp"
  PARI_DESC="pari21.desc";
fi

if test "x$PARI_CONFIG_DBG" !=  "x" ; then 
  AC_MSG_CHECKING([for PARI module build (debugging)])
  PARI_MODULE_DEBUG=`$srcdir/config/module-build $PARI_CONFIG_DBG`
  AC_MSG_RESULT($PARI_MODULE_DEBUG)

  AC_MSG_CHECKING([for GP path (debugging)])
  GP_PATH_DBG=`$srcdir/config/pari-conf $PARI_CONFIG_DBG bindir`/gp
  AC_MSG_RESULT($GP_PATH_DBG)
  GP2C_DBG="gp2c-dbg"
  GP2C_DBG1="gp2c-dbg.1"
else
  PARI_MODULE_DEBUG=$PARI_MODULE_BUILD
  GP_PATH_DBG=$GP_PATH
  GP2C_DBG=""
  GP2C_DBG1=""
fi


AC_DEFINE_UNQUOTED(PARI_VERSION,"$PARI_VERSION",[target PARI version])
AC_DEFINE_UNQUOTED(PARI_MODULE_BUILD,"$PARI_MODULE_BUILD",[target PARI module build])
AC_SUBST(PARI_MODULE_BUILD)
AC_SUBST(GP_PATH)
AC_SUBST(PARI_DATADIR)
AC_SUBST(PARI_DESC)
AC_SUBST(PARI_MODULE_DEBUG)
AC_SUBST(GP_PATH_DBG)
AC_SUBST(GP2C_DBG)
AC_SUBST(GP2C_DBG1)

dnl Checks for libraries.

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(malloc.h unistd.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_STRUCT_TM

dnl Checks for library functions.
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(strdup strtol getopt strcmp memccpy strrchr)

dnl How to use echo

ECHON=${ECHO_N-"$ac_n"}
ECHOC=${ECHO_C-"$ac_c"}
ECHOT=${ECHO_T-"$ac_t"}

AC_SUBST(ECHON)
AC_SUBST(ECHOC)
AC_SUBST(ECHOT)

if  test "$bindir" = '${exec_prefix}/bin'; then
  if test "x${exec_prefix}" != xNONE; then
    mybindir=${exec_prefix}/bin
  elif test "x${prefix}" != xNONE; then
    mybindir=${prefix}/bin
  else
    mybindir=${ac_default_prefix}/bin
  fi
else
  mybindir=$bindir
fi

AC_SUBST(mybindir)

AC_OUTPUT([Makefile src/Makefile desc/Makefile doc/Makefile test/Makefile scripts/Makefile scripts/822_desc.pl scripts/dotest scripts/gp2c-run scripts/gp2c-dbg doc/gp2c-run.1 doc/gp2c-dbg.1],[chmod a+x scripts/822_desc.pl scripts/dotest scripts/gp2c-run scripts/gp2c-dbg])