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
|
define([AC_CACHE_LOAD], )dnl
define([AC_CACHE_SAVE], )dnl
AC_INIT(vsn.mk)
if test -z "$ERL_TOP" || test ! -d $ERL_TOP ; then
AC_CONFIG_AUX_DIRS(autoconf)
else
erl_top=${ERL_TOP}
AC_CONFIG_AUX_DIRS($erl_top/erts/autoconf)
fi
if test "X$host" != "Xfree_source" -a "X$host" != "Xwin32"; then
AC_CANONICAL_HOST
else
host_os=win32
fi
dnl ----------------------------------------------------------------------
dnl Checks for programs.
dnl ----------------------------------------------------------------------
dnl
dnl flex is needed by megaco. lex wont do!
dnl
AC_PROG_LEX
if test "$LEX" != flex; then
ENABLE_MEGACO_FLEX_SCANNER=false
else
ENABLE_MEGACO_FLEX_SCANNER=true
fi
AC_SUBST(ENABLE_MEGACO_FLEX_SCANNER)
dnl
dnl For increased performance it is possible to disable lineno
dnl
AC_ARG_ENABLE(megaco_flex_scanner_lineno,
[ --disable-megaco-flex-scanner-lineno disable megaco flex scanner lineno],
if test x${enable_megaco_flex_scanner_lineno} = xno ; then
ENABLE_MEGACO_FLEX_SCANNER_LINENO=false
else
ENABLE_MEGACO_FLEX_SCANNER_LINENO=true
fi,
ENABLE_MEGACO_FLEX_SCANNER_LINENO=true)
AC_SUBST(ENABLE_MEGACO_FLEX_SCANNER_LINENO)
dnl
dnl C compiler (related) defs
dnl
AC_PROG_CC
dnl Magic test for clearcase.
if test -d ../../system; then
OTP_EXTRA_FLAGS=-DOTP_RELEASE
else
OTP_EXTRA_FLAGS=
fi
dnl
dnl Flags to the C compiler
dnl
dnl make sure we find config.h
CFLAGS="$CFLAGS -I${ERL_TOP}/erts/$host $OTP_EXTRA_FLAGS"
if test "X$host" = "Xwin32"; then
DED_CFLAGS="$CFLAGS"
else
case $host_os in
darwin*)
CFLAGS="$CFLAGS -no-cpp-precomp"
;;
esac
if test "x$GCC" = xyes; then
DED_CFLAGS="$CFLAGS -fPIC $DED_CFLAGS"
else
DED_CFLAGS="$CFLAGS $DED_CFLAGS"
fi
fi
AC_SUBST(DED_CFLAGS)
AC_CHECK_PROGS(DED_LD, [ld.sh ld], no_ld)
if test "$DED_LD" = no_ld; then
AC_MSG_ERROR([ld is required to build the flex scanner!])
fi
AC_MSG_CHECKING(for linker flags for loadable drivers)
case $host_os in
win32)
DED_LDFLAGS="-dll"
;;
solaris2*|sysv4*)
DED_LDFLAGS="-G"
;;
aix4*)
DED_LDFLAGS="-G -bnoentry -bexpall"
;;
freebsd2*)
# Non-ELF GNU linker
DED_LDFLAGS="-Bshareable"
;;
darwin*)
# Mach-O linker, a shared lib and a loadable
# object file is not the same thing.
DED_LDFLAGS="-bundle -flat_namespace -undefined suppress"
DED_CFLAGS="$DED_CFLAGS -fno-common"
;;
*)
# assume GNU linker and ELF
DED_LDFLAGS="-shared"
;;
esac
AC_MSG_RESULT([$DED_LDFLAGS])
AC_SUBST(DED_LDFLAGS)
AC_CHECK_PROG(PERL, perl, perl, no_perl)
if test "$PERL" = no_perl; then
AC_MSG_ERROR([Perl is required to build the flex scanner!])
fi
dnl This is the os flavour, should be unix, vxworks or win32
if test "X$host" = "Xwin32"; then
ERLANG_OSTYPE=win32
else
ERLANG_OSTYPE=unix
fi
AC_SUBST(ERLANG_OSTYPE)
AC_OUTPUT(src/flex/$host/Makefile:src/flex/Makefile.in)
|