# Process this file with autoconf to produce a configure script.
#
-# $Id: configure.in,v 1.1 2004/01/13 12:39:53 ppisa Exp $
+# $Id: configure.in,v 1.8 2004/04/20 08:36:14 smolik Exp $
# autoconf requirement
-AC_PREREQ([2.57])
-AC_INIT([orte],[0.2.0],[petr.smolik@wo.cz])
+AC_PREREQ([2.56])
+
+AC_INIT([orte],[0.2.2],[petr.smolik@wo.cz])
AC_CONFIG_AUX_DIR(admin)
#Check for CPU / vendor / OS
# Package info
ORTE_MAJOR_VERSION=0
ORTE_MINOR_VERSION=2
-ORTE_MICRO_VERSION=0
+ORTE_MICRO_VERSION=2
ORTE_VERSION=$ORTE_MAJOR_VERSION.$ORTE_MINOR_VERSION.$ORTE_MICRO_VERSION
AC_SUBST(ORTE_MAJOR_VERSION)
AC_SUBST(ORTE_MINOR_VERSION)
AC_SUBST(ORTE_MICRO_VERSION)
AC_SUBST(ORTE_VERSION)
+
###############################
-# includes
+# target
+WIN='no'
+MINGW='no'
+CYGWIN='no'
+UNIX='no'
case "$target" in
- *-cygwin* | *-mingw*)
- INCLUDES='-I$(top_srcdir)/orte/include -I$(top_srcdir)/orte/include/win32'
- WIN_LIB='yes'
+ *-cygwin*)
+ CFLAGS="$CFLAGS"
+ WIN='yes'
+ CYGWIN='yes'
+ AC_DEFINE([CONFIG_ORTE_WIN],[1],[Define if is target windows])
+ AC_DEFINE([CONFIG_ORTE_CYGWIN],[1],[Define if is target CYGWIN])
+ ;;
+ *-mingw*)
+ CFLAGS="$CFLAGS"
+ WIN='yes'
+ MINGW='yes'
+ AC_DEFINE([CONFIG_ORTE_WIN],[1],[Define if is target windows])
+ AC_DEFINE([CONFIG_ORTE_MINGW],[1],[Define if is target MINGW])
+ AC_DEFINE([HAVE_GETPOT_LONG_ORTE],[1],[Define for ORTE getopt_long self implemetation])
;;
*)
# Assume Unix.
- if test ${USE_RTLINUX} == "yes" ; then
- INCLUDES='-I$(top_srcdir)/orte/include -I$(top_srcdir)/orte/include/rtl -I$(top_srcdir)/RTL_UDP/include'
- else
- INCLUDES='-I$(top_srcdir)/orte/include'
+ if test -z ${CONFIG_ORTE_RT} -a ${CONFIG_ORTE_KERNEL} ; then
+ UNIX='yes'
+ AC_DEFINE([CONFIG_ORTE_UNIX],[1],[Define if is target a unix system])
fi
;;
esac
-AC_SUBST(INCLUDES)
-AM_CONDITIONAL(CONFIG_ORTE_WIN, test x$WIN_LIB = xyes)
+AM_CONDITIONAL(CONFIG_ORTE_WIN, test x$WIN = xyes)
+AM_CONDITIONAL(CONFIG_ORTE_CYGWIN, test x$CIGWIN = xyes)
+AM_CONDITIONAL(CONFIG_ORTE_MINGW, test x$MINGW = xyes)
+AM_CONDITIONAL(CONFIG_ORTE_UNIX, test x$UNIX = xyes)
###############################
# modules
-moduledir="\$(libdir)/modules/\$(LINUX_KERNELRELEASE)/comedi"
+moduledir="\$(libdir)/modules/\$(LINUX_KERNELRELEASE)/orte"
modulePROGRAMS_INSTALL="\$(top_builddir)/modtool --install"
modulePROGRAMS_UNINSTALL="\$(top_builddir)/modtool --uninstall"
AC_SUBST(moduledir)
AC_SUBST(modulePROGRAMS_INSTALL)
+###############################
+# CFLAGS
+CFLAGS="$CFLAGS -Wall"
+if test ${USE_RTLINUX} == 'yes' ; then
+ CFLAGS="$CFLAGS $RTLINUX_CFLAGS"
+ CC="$RTLINUX_CC"
+else
+ if test ${USE_RTAI} == 'yes' ; then
+ CFLAGS="$CFLAGS $RTAI_CFLAGS $LINUX_CFLAGS"
+ else
+ if test -n ${CONFIG_ORTE_KERNEL} ; then
+ CFLAGS="$CFLAGS $LINUX_CFLAGS"
+ fi
+ fi
+fi
+
###############################
# Checks for programs.
AC_PROG_CC
AC_PROG_RANLIB
###############################
-# Checks for libraries (no for RT)
-if test ${USE_RTLINUX} != "yes" ; then
-AC_CHECK_LIB([ws2_32], [main])
-AC_CHECK_LIB([pthread], [main])
+# Checks for libraries
+if test -z ${CONFIG_ORTE_RT} ; then
+ AC_CHECK_LIB([ws2_32], [main])
+ AC_CHECK_LIB([pthread], [main])
+ AC_CHECK_LIB([socket], [main])
+ AC_CHECK_LIB([nsl], [main])
fi
+###############################
+# enable GNU source
+AH_VERBATIM([_GNU_SOURCE],[
+#ifndef _GNU_SOURCE
+ #define _GNU_SOURCE
+#endif
+])
+
###############################
# Checks for header files.
-AC_HEADER_STDC
-AC_CHECK_HEADERS(
-[arpa/inet.h fcntl.h stdio.h netdb.h netinet/in.h stdlib.h \
-string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h pthread.h \
-stdarg.h getopt.h sys/types.h net/if.h byteswap.h signal.h errno.h \
-ctype.h sys/stat.h winsock2.h ws2tcpip.h])
+# user space
+if test ${UNIX} == 'yes' -o ${WIN} == 'yes' ; then
+ AC_HEADER_STDC
+ AC_CHECK_HEADERS([\
+ arpa/inet.h fcntl.h stdio.h netdb.h stdlib.h \
+ string.h sys/ioctl.h sys/time.h unistd.h pthread.h \
+ sys/types.h sys/sockio.h stdarg.h byteswap.h getopt.h \
+ ctype.h signal.h stdint.h],,,[[]])
+ AC_CHECK_HEADERS([sys/socket.h], [], [],
+ [#ifdef HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif])
+ AC_CHECK_HEADERS([netinet/in.h], [], [],
+ [#ifdef HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif])
+ AC_CHECK_HEADERS([net/if.h], [], [],
+ [#ifdef HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+ #ifdef HAVE_SYS_SOCKET_H
+ #include <sys/socket.h>
+ #endif])
+fi
+# win32
+if test ${WIN} == 'yes' ; then
+ AC_CHECK_HEADERS([\
+ winsock2.h ws2tcpip.h windows.h],,,[[]])
+fi
+# kernel
+if test ${CONFIG_ORTE_KERNEL} == 'yes' ; then
+ AC_CHECK_HEADERS([\
+ asm/byteorder.h linux/ctype.h linux/string.h \
+ linux/module.h linux/if.h linux/socket.h \
+ linux/time.h linux/types.h],,,[[]])
+ AC_CHECK_HEADERS([linux/in.h],,,[
+ #ifdef HAVE_LINUX_SOCKET_H
+ #include <linux/socket.h>
+ #endif
+ ])
+fi
+# RTLinux
+if test ${USE_RTLINUX} == 'yes' ; then
+ AC_CHECK_HEADERS([\
+ string.h pthread.h \
+ rtl.h rtl_malloc.h udp.h nic.h time.h],,,[[]])
+ AC_CHECK_HEADERS([nictab.h],,,[
+ #ifdef HAVE_UDP_H
+ #include <udp.h>
+ #endif
+ #ifdef HAVE_NIC_H
+ #include <nic.h>
+ #endif
+ ])
+fi
+# RTAI
+if test ${USE_RTAI} == 'yes' ; then
+ AC_CHECK_HEADERS([\
+ rtnet.h],,,[[]])
+fi
+
+###############################
+# includes
+INCLUDES='-I$(top_srcdir)/orte/include'
+AC_SUBST(INCLUDES)
###############################
# Checks for typedefs, structures, and compiler characteristics.
AC_C_BIGENDIAN
AC_C_CONST
AC_C_INLINE
-AC_TYPE_PID_T
-AC_TYPE_SIZE_T
-AC_HEADER_TIME
###############################
# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
-AC_FUNC_MALLOC
-AC_CHECK_FUNCS([strdup])
-
-###############################
-# Add obsolute directory for header files
-CFLAGS="$CFLAGS -Wall"
+if test -z ${CONFIG_ORTE_RT} ; then
+AC_CHECK_FUNCS([strdup gethostbyname getopt_long])
+fi
AC_CONFIG_FILES([Makefile
orte/Makefile
- RTL_UDP/Makefile
- RTL_UDP/udp/Makefile
orte/liborte/Makefile
orte/liborte/rtl/Makefile
orte/examples/Makefile
orte/examples/hello/Makefile
orte/examples/reliable/Makefile
- orte/examples/ORTEPing/Makefile
- orte/examples/ORTESpy/Makefile
+ orte/examples/ping/Makefile
+ orte/examples/spy/Makefile
orte/manager/Makefile])
+
AC_OUTPUT([
modtool
])
chmod +x modtool
+
+# ======================================================================
+# generate orte/include/orte_config.h
+# ======================================================================
+
+AC_MSG_NOTICE([creating orte/include/orte_config.h])
+sed -e "s/ PACKAGE/ ORTE_PACKAGE/" -e "s/ VERSION/ ORTE_VERSION/" \
+ orte/include/config.h >orte/include/orte_config.h.new
+if cmp -s orte/include/orte_config.h.new orte/include/orte_config.h; then
+ rm orte/include/orte_config.h.new
+ AC_MSG_NOTICE([orte/include/orte_config.h is unchanged])
+else
+ mv orte/include/orte_config.h.new orte/include/orte_config.h
+fi
+
echo \
"------------------------------------------------------------------------
Configuration ORTE:
See config.h for further configuration information.
------------------------------------------------------------------------"
-
\ No newline at end of file
+