549 lines
13 KiB
Plaintext
549 lines
13 KiB
Plaintext
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
AC_REVISION($Revision: 1.10 $)
|
|
|
|
AC_INIT([GPON Optical Network Unit Driver],[4.5.0],[],[gpon_onu_drv])
|
|
|
|
AC_CONFIG_AUX_DIR([build-aux])
|
|
|
|
AC_PROG_CC
|
|
ifdef([AC_PROG_CC_STDC], [AC_PROG_CC_STDC])
|
|
AC_LANG([C])
|
|
AC_PROG_RANLIB
|
|
|
|
AC_CONFIG_SRCDIR(src/drv_onu_common.c)
|
|
AM_INIT_AUTOMAKE
|
|
AM_PROG_CC_C_O
|
|
AC_PROG_CXX
|
|
|
|
AC_CONFIG_HEADER(src/drv_onu_config.h tools/onu/onu_control_config.h:src/drv_onu_config.h.in)
|
|
AH_TOP([
|
|
/******************************************************************************
|
|
|
|
Copyright (c) 2012
|
|
Lantiq Deutschland GmbH
|
|
|
|
For licensing information, see the file 'LICENSE' in the root folder of
|
|
this software module.
|
|
|
|
******************************************************************************/
|
|
#ifndef _GPON_ONU_CONFIG_H
|
|
#define _GPON_ONU_CONFIG_H])
|
|
AH_BOTTOM([
|
|
#endif /* _GPON_ONU_CONFIG_H */])
|
|
|
|
#
|
|
# save the configure arguments
|
|
#
|
|
CONFIGURE_OPTIONS="$ac_configure_args"
|
|
AC_SUBST(CONFIGURE_OPTIONS)
|
|
|
|
AC_CHECK_TYPES([ulong_t])
|
|
|
|
dnl enable linux kernel 2.6.x support
|
|
AM_CONDITIONAL(KERNEL_2_6, true)
|
|
AC_ARG_ENABLE(linux-26,
|
|
AS_HELP_STRING(--enable-linux-26,Enable support for linux kernel 2.6.x),
|
|
[
|
|
AM_CONDITIONAL(KERNEL_2_6, true)
|
|
if test -z "$ARCH" ; then
|
|
[ARCH=`$CC -dumpmachine | sed -e s'/-.*//' \
|
|
-e 's/i[3-9]86/i386/' \
|
|
-e 's/mipsel/mips/' \
|
|
-e 's/powerpc/ppc/' \
|
|
-e 's/sh[234]/sh/' \
|
|
`]
|
|
fi
|
|
if test -n "$ARCH" ; then
|
|
echo "Set the kernel architecture to $ARCH"
|
|
AC_SUBST([KERNEL_ARCH],[$ARCH])
|
|
else
|
|
AC_MSG_ERROR([Kernel architecture not set!])
|
|
fi
|
|
]
|
|
)
|
|
|
|
dnl Set kernel include path (Linux, eCos, ...)
|
|
DEFAULT_KERNEL_INCL_PATH='.'
|
|
AC_ARG_ENABLE(kernelincl,
|
|
AS_HELP_STRING([--enable-kernelincl=x],[Set the target kernel include path
|
|
]),
|
|
[
|
|
if test -n $enableval; then
|
|
echo Set the kernel include path $enableval
|
|
AC_SUBST([KERNEL_INCL_PATH],[$enableval])
|
|
else
|
|
echo Set the default kernel include path $DEFAULT_KERNEL_INCL_PATH
|
|
AC_SUBST([KERNEL_INCL_PATH],[$DEFAULT_KERNEL_INCL_PATH])
|
|
fi
|
|
],
|
|
[
|
|
echo Set the default kernel include path $DEFAULT_KERNEL_INCL_PATH
|
|
AC_SUBST([KERNEL_INCL_PATH],[$DEFAULT_KERNEL_INCL_PATH])
|
|
]
|
|
)
|
|
|
|
dnl Set kernel build path
|
|
AC_ARG_ENABLE(kernelbuild,
|
|
AS_HELP_STRING(--enable-kernelbuild=x,Set the target kernel build path (only for kernel 2.6.x)),
|
|
[
|
|
if test -e $enableval/include/linux/autoconf.h -o -e $enableval/include/generated/autoconf.h; then
|
|
AC_SUBST([KERNEL_BUILD_PATH],[$enableval])
|
|
else
|
|
AC_MSG_ERROR([The kernel build directory is not valid or not configured!])
|
|
fi
|
|
],
|
|
[
|
|
if test -z $KERNEL_BUILD_PATH; then
|
|
# assume kernel was build in source dir...
|
|
AC_SUBST([KERNEL_BUILD_PATH],[$KERNEL_INCL_PATH/..])
|
|
fi
|
|
]
|
|
)
|
|
|
|
dnl set libifxos.a library path
|
|
DEFAULT_IFXOS_LIBRARY_PATH='-L.'
|
|
AC_ARG_ENABLE(ifxos-library,
|
|
AS_HELP_STRING([--enable-ifxos-library=/path/to/your/lib_ifxos/src] , [Set the lib_ifxos library path. In this location the libifxos.a should be found]),
|
|
[
|
|
if test -n "$enableval"; then
|
|
echo Set the libifxos.a library path to $enableval
|
|
AC_SUBST([IFXOS_LIBRARY_PATH],[$enableval])
|
|
else
|
|
echo Set the lib_board_config library path $DEFAULT_IFXOS_LIBRARY_PATH
|
|
AC_SUBST([IFXOS_LIBRARY_PATH],[$DEFAULT_IFXOS_LIBRARY_PATH])
|
|
fi
|
|
],
|
|
[
|
|
echo Set the libifxos.a library path $DEFAULT_IFXOS_LIBRARY_PATH
|
|
AC_SUBST([IFXOS_LIBRARY_PATH],[$DEFAULT_IFXOS_LIBRARY_PATH])
|
|
]
|
|
)
|
|
|
|
dnl set lib_ifxos include path
|
|
DEFAULT_IFXOS_INCLUDE_PATH='-I.'
|
|
AC_ARG_ENABLE(ifxos-include,
|
|
AS_HELP_STRING([--enable-ifxos-include=-I/path/to/your/lib_ifxos/src/include],[Set the lib_ifxos include path.]),
|
|
[
|
|
if test -n "$enableval"; then
|
|
echo Set the lib_ifxos include path $enableval
|
|
AC_SUBST([IFXOS_INCLUDE_PATH],[$enableval])
|
|
else
|
|
echo -e Set the default lib_ifxos include path $DEFAULT_IFXOS_INCLUDE_PATH
|
|
AC_SUBST([IFXOS_INCLUDE_PATH],[$DEFAULT_IFXOS_INCLUDE_PATH])
|
|
fi
|
|
],
|
|
[
|
|
echo -e Set the default lib_ifxos include path $DEFAULT_IFXOS_INCLUDE_PATH
|
|
AC_SUBST([IFXOS_INCLUDE_PATH],[$DEFAULT_IFXOS_INCLUDE_PATH])
|
|
]
|
|
)
|
|
|
|
dnl set device type
|
|
AC_ARG_ENABLE(device,
|
|
AS_HELP_STRING(
|
|
[--enable-device=type],
|
|
[Set the device type. Available options: PSB98010, PSB98020, PSB98030]
|
|
),
|
|
[
|
|
case $enableval in
|
|
PSB98010|PSB98020|PSB98030)
|
|
AC_DEFINE_UNQUOTED(ONU_DEVICE_PSB980xx,ONU_DEVICE_$enableval,[Selected device type])
|
|
echo "Selected device type: $enableval"
|
|
;;
|
|
*) AC_MSG_ERROR([Device selection invalid: $enableval]);
|
|
;;
|
|
esac
|
|
],
|
|
[
|
|
echo "Automatically selected device type: PSB98030"
|
|
AC_DEFINE(ONU_DEVICE_PSB980xx,ONU_DEVICE_PSB98030,[Selected device type])
|
|
]
|
|
)
|
|
|
|
dnl compile for linux kernel
|
|
ENABLE_LINUX=true
|
|
AC_ARG_ENABLE(linux,
|
|
AS_HELP_STRING(
|
|
[--enable-linux],
|
|
[Enable linux support]
|
|
),
|
|
[
|
|
case $enableval in
|
|
0|no)
|
|
ENABLE_LINUX=false
|
|
;;
|
|
1|yes)
|
|
;;
|
|
*) AC_MSG_ERROR([linux support]);
|
|
;;
|
|
esac
|
|
]
|
|
)
|
|
|
|
|
|
dnl Build simulation application
|
|
AM_CONDITIONAL(ONU_SIMULATION, false)
|
|
AC_ARG_WITH(onu-simulation,
|
|
AS_HELP_STRING(
|
|
[--with-onu-simulation],
|
|
[ONU simulation]
|
|
),
|
|
[
|
|
echo ONU simulation = $withval
|
|
|
|
case $withval in
|
|
0|no)
|
|
;;
|
|
1|yes)
|
|
AC_DEFINE(ONU_SIMULATION,,[ONU simulation])
|
|
AM_CONDITIONAL(ONU_SIMULATION, true)
|
|
ENABLE_LINUX=false
|
|
;;
|
|
*) AC_MSG_ERROR([ ONU simulation ]);
|
|
;;
|
|
esac
|
|
],
|
|
[
|
|
echo ONU simulation disabled
|
|
]
|
|
)
|
|
|
|
dnl Build os independend library
|
|
AM_CONDITIONAL(ONU_LIBRARY, false)
|
|
AC_ARG_WITH(onu-library,
|
|
AS_HELP_STRING(
|
|
[--with-onu-library],
|
|
[ONU library]
|
|
),
|
|
[
|
|
echo ONU library = $withval
|
|
|
|
case $withval in
|
|
0|no)
|
|
;;
|
|
1|yes)
|
|
AC_DEFINE(ONU_LIBRARY,,[ONU library])
|
|
AM_CONDITIONAL(ONU_LIBRARY, true)
|
|
ENABLE_LINUX=false
|
|
;;
|
|
*) AC_MSG_ERROR([ ONU library ]);
|
|
;;
|
|
esac
|
|
],
|
|
[
|
|
echo ONU library disabled
|
|
]
|
|
)
|
|
|
|
AM_CONDITIONAL(ENABLE_LINUX, $ENABLE_LINUX)
|
|
if test "$ENABLE_LINUX" == "true" ; then
|
|
AC_DEFINE(ENABLE_LINUX,,[compile for linux kernel])
|
|
fi
|
|
|
|
dnl Include Command Line Interface
|
|
AC_ARG_WITH(cli,
|
|
AS_HELP_STRING(
|
|
[--with-cli],
|
|
[Command Line Interface]
|
|
),
|
|
[
|
|
echo Command Line Interface = $withval
|
|
|
|
case $withval in
|
|
0|no)
|
|
;;
|
|
1|yes)
|
|
AC_DEFINE(INCLUDE_CLI_SUPPORT,,[Command Line Interface])
|
|
;;
|
|
*) AC_MSG_ERROR([ Command Line Interface ]);
|
|
;;
|
|
esac
|
|
],
|
|
[
|
|
echo Command Line Interface enabled
|
|
AC_DEFINE(INCLUDE_CLI_SUPPORT,,[Command Line Interface])
|
|
]
|
|
)
|
|
|
|
dnl Include procfs support
|
|
AC_ARG_WITH(procfs,
|
|
AS_HELP_STRING(
|
|
[--with-procfs],
|
|
[proc filesystem]
|
|
),
|
|
[
|
|
echo proc filesystem = $withval
|
|
|
|
case $withval in
|
|
0|no)
|
|
;;
|
|
1|yes)
|
|
AC_DEFINE(INCLUDE_PROCFS_SUPPORT,,[proc filesystem])
|
|
;;
|
|
*) AC_MSG_ERROR([ proc filesystem ]);
|
|
;;
|
|
esac
|
|
],
|
|
[
|
|
echo procfs support enabled
|
|
AC_DEFINE(INCLUDE_PROCFS_SUPPORT,,[proc filesystem])
|
|
]
|
|
)
|
|
|
|
dnl Include SCE debug support
|
|
AC_ARG_WITH(sce-dbg,
|
|
AS_HELP_STRING(
|
|
[--with-sce-dbg],
|
|
[SCE debug]
|
|
),
|
|
[
|
|
echo SCE debug = $withval
|
|
|
|
case $withval in
|
|
0|no)
|
|
;;
|
|
1|yes)
|
|
AC_DEFINE(INCLUDE_SCE_DEBUG,,[SCE debug])
|
|
;;
|
|
*) AC_MSG_ERROR([ SCE debug ]);
|
|
;;
|
|
esac
|
|
],
|
|
[
|
|
echo SCE debug support enabled
|
|
AC_DEFINE(INCLUDE_SCE_DEBUG,,[SCE debug])
|
|
]
|
|
)
|
|
|
|
dnl Include COP debug support
|
|
AC_ARG_WITH(cop-dbg,
|
|
AS_HELP_STRING(
|
|
[--with-cop-dbg],
|
|
[COP debug]
|
|
),
|
|
[
|
|
echo COP debug = $withval
|
|
|
|
case $withval in
|
|
0|no)
|
|
;;
|
|
1|yes)
|
|
AC_DEFINE(INCLUDE_COP_DEBUG,,[COP debug])
|
|
;;
|
|
*) AC_MSG_ERROR([ COP debug ]);
|
|
;;
|
|
esac
|
|
],
|
|
[
|
|
echo COP debug support enabled
|
|
AC_DEFINE(INCLUDE_COP_DEBUG,,[COP debug])
|
|
]
|
|
)
|
|
|
|
dnl Include Command Line Interface Dump
|
|
AC_ARG_WITH(cli-dump,
|
|
AS_HELP_STRING(
|
|
[--with-cli-dump],
|
|
[Command Line Interface Dump]
|
|
),
|
|
[
|
|
echo Command Line Interface Dump = $withval
|
|
|
|
case $withval in
|
|
0|no)
|
|
;;
|
|
1|yes)
|
|
AC_DEFINE(INCLUDE_CLI_DUMP_SUPPORT,,[Command Line Interface Dump])
|
|
;;
|
|
*) AC_MSG_ERROR([ Command Line Interface Dump ]);
|
|
;;
|
|
esac
|
|
],
|
|
[
|
|
echo Command Line Interface Dump disabled
|
|
]
|
|
)
|
|
|
|
dnl Add debugging information
|
|
AC_ARG_WITH(debug-support,
|
|
AS_HELP_STRING(
|
|
[--with-debug-support],
|
|
[Debug Support]
|
|
),
|
|
[
|
|
echo Debug Support = $withval
|
|
|
|
case $withval in
|
|
0|no)
|
|
;;
|
|
1|yes)
|
|
AC_DEFINE(INCLUDE_DEBUG_SUPPORT,,[Debug Support])
|
|
;;
|
|
*) AC_MSG_ERROR([Debug Support]);
|
|
;;
|
|
esac
|
|
],
|
|
[
|
|
echo Debug Support enabled
|
|
AC_DEFINE(INCLUDE_DEBUG_SUPPORT,,[Debug Support])
|
|
]
|
|
)
|
|
|
|
dnl Print TOD output on ASC1
|
|
AC_ARG_WITH(tod-asc1,
|
|
AS_HELP_STRING(
|
|
[--with-tod-asc1],
|
|
[Print TOD output on ASC1]
|
|
),
|
|
[
|
|
echo TOD output on ASC1 = $withval
|
|
|
|
case $withval in
|
|
0|no)
|
|
;;
|
|
1|yes)
|
|
AC_DEFINE(ONU_TOD_ASC1,,[TOD output on ASC1])
|
|
;;
|
|
*) AC_MSG_ERROR([ TOD output on ASC1 ]);
|
|
;;
|
|
esac
|
|
],
|
|
[
|
|
echo no TOD output
|
|
]
|
|
)
|
|
|
|
dnl Export debug symbols
|
|
AC_ARG_WITH(dbg-exports,
|
|
AS_HELP_STRING(
|
|
[--with-dbg-exports],
|
|
[Export debug symbols]
|
|
),
|
|
[
|
|
echo Export debug symbols = $withval
|
|
|
|
case $withval in
|
|
0|no)
|
|
;;
|
|
1|yes)
|
|
AC_DEFINE(ONU_DBG_EXPORTS,,[Export debug symbols])
|
|
;;
|
|
*) AC_MSG_ERROR([ Do not export debug symbols ]);
|
|
;;
|
|
esac
|
|
],
|
|
[
|
|
echo Do not export debug symbols
|
|
]
|
|
)
|
|
|
|
dnl Enable XML & JSON SCE tables wrappers
|
|
AM_CONDITIONAL(ONU_SCE_TABLES_WRAPPERS, false)
|
|
AC_ARG_WITH(sce-tables-wrappers,
|
|
AS_HELP_STRING(
|
|
[--with-sce-tables-wrappers],
|
|
[Enable XML and JSON SCE tables wrappers]
|
|
),
|
|
[
|
|
echo Enable XML and JSON SCE tables wrappers = $withval
|
|
|
|
case $withval in
|
|
0|no)
|
|
;;
|
|
1|yes)
|
|
AC_DEFINE(ONU_SCE_TABLES_WRAPPERS,,[Enable XML and JSON SCE tables wrappers])
|
|
AM_CONDITIONAL(ONU_SCE_TABLES_WRAPPERS, true)
|
|
;;
|
|
*) AC_MSG_ERROR([ Disable XML and JSON SCE tables wrappers ]);
|
|
;;
|
|
esac
|
|
],
|
|
[
|
|
echo Disable XML and JSON SCE tables wrappers
|
|
]
|
|
)
|
|
|
|
dnl Maximum number of supported LAN ports
|
|
DEFAULT_ONU_MAX_ETH_UNI=4
|
|
AC_ARG_WITH(max-eth-uni,
|
|
AS_HELP_STRING(
|
|
[--with-max-eth-uni],
|
|
[Maximum number of supported LAN ports]
|
|
),
|
|
[
|
|
if test -n $withval; then
|
|
echo Maximum number of supported LAN ports = $withval
|
|
AC_DEFINE_UNQUOTED(ONU_MAX_ETH_UNI,[$withval],[Maximum number of supported LAN ports])
|
|
else
|
|
echo Maximum number of supported LAN ports = $DEFAULT_ONU_MAX_ETH_UNI
|
|
AC_DEFINE_UNQUOTED(ONU_MAX_ETH_UNI,$DEFAULT_ONU_MAX_ETH_UNI,[Maximum number of supported LAN ports])
|
|
fi
|
|
],
|
|
[
|
|
echo Maximum number of supported LAN ports = $DEFAULT_ONU_MAX_ETH_UNI
|
|
AC_DEFINE_UNQUOTED(ONU_MAX_ETH_UNI,$DEFAULT_ONU_MAX_ETH_UNI,[Maximum number of supported LAN ports])
|
|
]
|
|
)
|
|
|
|
dnl set Event Logger includes path
|
|
AM_CONDITIONAL(EVENT_LOGGER_DEBUG, false)
|
|
AC_ARG_WITH(el-incl,
|
|
AC_HELP_STRING(
|
|
[--with-el-incl@<:@=-IDIR@:>@],
|
|
[Event Logger includes path]
|
|
),
|
|
[
|
|
AC_SUBST([EVENT_LOGGER_INCL_PATH],[$withval])
|
|
AC_DEFINE([EVENT_LOGGER_DEBUG],[1],[enable event logger debugging])
|
|
AM_CONDITIONAL(EVENT_LOGGER_DEBUG, true)
|
|
]
|
|
)
|
|
|
|
dnl enable\disable remote ONU
|
|
AC_ARG_ENABLE(remote-onu,
|
|
AS_HELP_STRING([--enable-remote-onu],
|
|
[enable remote ONU]),
|
|
[
|
|
if test "$enableval" = yes; then
|
|
echo Enable remote ONU
|
|
AC_DEFINE([INCLUDE_REMOTE_ONU], [1], [Enable remote ONU])
|
|
AC_SUBST([INCLUDE_REMOTE_ONU],[$enableval])
|
|
AM_CONDITIONAL(INCLUDE_REMOTE_ONU, true)
|
|
else
|
|
echo Disable remote ONU
|
|
AM_CONDITIONAL(INCLUDE_REMOTE_ONU, false)
|
|
fi
|
|
],
|
|
[
|
|
echo Enable remote ONU
|
|
AC_DEFINE([INCLUDE_REMOTE_ONU], [1], [Enable remote ONU])
|
|
AC_SUBST([INCLUDE_REMOTE_ONU],[$enableval])
|
|
AM_CONDITIONAL(INCLUDE_REMOTE_ONU, true)
|
|
]
|
|
)
|
|
|
|
dnl enable\disable remote-only ONU
|
|
AC_ARG_ENABLE(remote-only-onu,
|
|
AS_HELP_STRING([--enable-remote-only-onu],
|
|
[enable remote-only ONU]),
|
|
[
|
|
if test "$enableval" = yes; then
|
|
echo Enable remote-only ONU
|
|
AC_DEFINE([INCLUDE_REMOTE_ONLY_ONU], [1], [Enable remote-only ONU])
|
|
AC_SUBST([INCLUDE_REMOTE_ONLY_ONU],[$enableval])
|
|
AM_CONDITIONAL(INCLUDE_REMOTE_ONLY_ONU, true)
|
|
else
|
|
echo Disable remote-only ONU
|
|
AM_CONDITIONAL(INCLUDE_REMOTE_ONLY_ONU, false)
|
|
fi
|
|
],
|
|
[
|
|
echo Disable remote-only ONU
|
|
AM_CONDITIONAL(INCLUDE_REMOTE_ONLY_ONU, false)
|
|
]
|
|
)
|
|
|
|
AC_CONFIG_FILES([Makefile netdev/Makefile led-trigger/Makefile src/Makefile tools/gtop/Makefile tools/gexdump/Makefile tools/onu/Makefile tools/rpc/Makefile])
|
|
AC_OUTPUT
|