File: configure.in

package info (click to toggle)
swi-prolog-packages 5.0.1-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 50,688 kB
  • ctags: 25,904
  • sloc: ansic: 195,096; perl: 91,425; cpp: 7,660; sh: 3,046; makefile: 2,750; yacc: 843; awk: 14; sed: 12
file content (105 lines) | stat: -rw-r--r-- 2,296 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
dnl Process this file with autoconf to produce a configure script.

AC_INIT(install-sh)
AC_CONFIG_HEADER(config.h)

AC_ARG_WITH(prolog,
   [ --with-prolog=PLBINARY   use given SWI Prolog binary])

AC_SUBST(PL)
AC_SUBST(LD)
AC_SUBST(PLLD)
AC_SUBST(PLLIBS)
AC_SUBST(PLBASE)
AC_SUBST(PLARCH)
AC_SUBST(PLINCL)
AC_SUBST(COFLAGS)
AC_SUBST(CWFLAGS)
AC_SUBST(CMFLAGS)
AC_SUBST(ETAGS)
AC_SUBST(SO)
AC_SUBST(LDSOFLAGS)
AC_SUBST(RUNTEX)

AC_ARG_ENABLE(mt, [  --enable-mt		  Enable Multi-threading],
	      [case "$enableval" in
		   yes) AC_DEFINE(_REENTRANT)
			;;
		   *)  ;;
	       esac])

AC_PROG_CC
LD=$CC

# Do not cache this, it changes too often in many configurations
unset ac_cv_prog_PL

if test -z "$PLINCL"; then
plcandidates="$with_prolog pl swipl swi-prolog"
AC_CHECK_PROGS(PL, $plcandidates, "none")
AC_CHECK_PROGS(PLLD, plld, "none")
if test $PLLD = "none"; then
   AC_ERROR("Cannot find SWI-Prolog plld utility. SWI-Prolog must be installed first")
fi
if test $PL = "none"; then
   AC_ERROR("Cannot find SWI-Prolog. SWI-Prolog must be installed first")
else
   AC_CHECKING("Running $PL -dump-runtime-variables")
   eval `$PL -dump-runtime-variables`
fi
PLINCL="$PLBASE/include"
AC_MSG_RESULT("		PLBASE=$PLBASE")
AC_MSG_RESULT("		PLARCH=$PLARCH")
AC_MSG_RESULT("		PLLIBS=$PLLIBS")
AC_MSG_RESULT("		PLLDFLAGS=$PLLDFLAGS")
AC_MSG_RESULT("		PLSHARED=$PLSHARED")
else
PLLD=../../$BUILDDIR/plld
fi

CC=$PLLD
LD=$PLLD
LDSOFLAGS=-shared
CMFLAGS=-fpic
SO="$PLSOEXT"

case "$PLARCH" in
  *irix*)	if test -z "$GCC"; then
  		    CWFLAGS="-woff 1164"
		fi
		;;
  *)		;;
esac

AC_CHECK_PROGS(MAKE, gmake make, "make")
AC_MSG_CHECKING("whether make is GNU-make")
if ($MAKE -v 2>&1) | grep GNU > /dev/null; then
    AC_MSG_RESULT(yes)
    gmake=yes
else
    VPATH="VPATH = "
    gmake=no
fi
AC_CHECK_PROGS(ETAGS, etags ctags, ":")
AC_CHECK_PROGS(RUNTEX, runtex, ":")
AC_PROG_INSTALL
AC_PROG_CPP
AC_ISC_POSIX
AC_HEADER_STDC
if test ! -z "$GCC"; then
    if test $gmake = yes; then
        COFLAGS='$(shell if test -r .coflags; then cat .coflags; else echo "-O2"; fi)'
    else
	COFLAGS=-O2
    fi
    CWFLAGS="$CWFLAGS -Wall"
else
    COFLAGS=-O
fi
CFLAGS="$CMFLAGS"
AC_C_BIGENDIAN

AC_CHECK_HEADERS(malloc.h unistd.h sys/time.h fcntl.h floatingpoint.h)
AC_CHECK_FUNCS(mmap strerror)

AC_OUTPUT(Makefile)