gpon_optic_drv/configure.in

354 lines
8.9 KiB
Plaintext

dnl Process this file with autoconf to produce a configure script.
AC_REVISION($Revision: 1.10 $)
AC_INIT([GPON Optic Driver],[4.5.0],[],[gpon_optic_drv])
AC_PROG_CC
ifdef([AC_PROG_CC_STDC], [AC_PROG_CC_STDC])
AC_LANG([C])
AC_PROG_RANLIB
AC_CONFIG_SRCDIR(src/drv_optic_common.c)
AM_INIT_AUTOMAKE
AM_PROG_CC_C_O
AC_PROG_CXX
AC_CONFIG_HEADER(src/drv_optic_config.h)
AH_TOP([
/******************************************************************************
Copyright (c) 2011
Lantiq Deutschland GmbH
For licensing information, see the file 'LICENSE' in the root folder of
this software module.
******************************************************************************/
#ifndef _GPON_OPTIC_CONFIG_H
#define _GPON_OPTIC_CONFIG_H])
AH_BOTTOM([
#endif /* _GPON_OPTIC_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 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(OPTIC_SIMULATION, false)
AC_ARG_WITH(optic-simulation,
AS_HELP_STRING(
[--with-optic-simulation],
[OPTIC simulation]
),
[
echo OPTIC simulation = $withval
case $withval in
0|no)
;;
1|yes)
AC_DEFINE(OPTIC_SIMULATION,,[OPTIC simulation])
AM_CONDITIONAL(OPTIC_SIMULATION, true)
ENABLE_LINUX=false
;;
*) AC_MSG_ERROR([ OPTIC simulation ]);
;;
esac
],
[
echo OPTIC simulation disabled
]
)
dnl Build os independend library
AM_CONDITIONAL(OPTIC_LIBRARY, false)
AC_ARG_WITH(optic-library,
AS_HELP_STRING(
[--with-optic-library],
[OPTIC library]
),
[
echo OPTIC library = $withval
case $withval in
0|no)
;;
1|yes)
AC_DEFINE(OPTIC_LIBRARY,,[OPTIC library])
AM_CONDITIONAL(OPTIC_LIBRARY, true)
ENABLE_LINUX=false
;;
*) AC_MSG_ERROR([ OPTIC library ]);
;;
esac
],
[
echo OPTIC 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 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 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 ONU
AM_CONDITIONAL(INCLUDE_REMOTE_ONLY_ONU, false)
]
)
AC_CONFIG_FILES([Makefile src/Makefile tools/optic/Makefile tools/otop/Makefile])
AC_OUTPUT