]> rtime.felk.cvut.cz Git - orte.git/blobdiff - configure.in
ORTE: add support for param structure in TypeRegister
[orte.git] / configure.in
index ac9a4e4631bde44e0c3c3e479fc9c0ad36a39db1..fe076bd8b1a662e8865f703d090dc91fd5ba46fd 100644 (file)
@@ -1,48 +1,82 @@
 # Process this file with autoconf to produce a configure script.
 #
-# $Id: configure.in,v 1.4 2004/02/15 22:23:51 smolik Exp $
+# $Id: configure.in,v 1.15 2008/10/07 21:19:01 smolik Exp $
 
 # autoconf requirement
 
 AC_PREREQ([2.56])
 
-AC_INIT([orte],[0.2.0],[petr.smolik@wo.cz])
+AC_INIT([orte],[0.3.3],[petr.smolik@wo.cz])
 AC_CONFIG_AUX_DIR(admin)
 
-#Check for CPU / vendor / OS
-AC_CANONICAL_HOST
-AC_CANONICAL_TARGET
-AM_CONFIG_HEADER(orte/include/config.h)
-AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
-# Activate maintainer mode
-AM_MAINTAINER_MODE
-
-DS_LINUX()
-
 ###############################
 # Package info
 ORTE_MAJOR_VERSION=0
-ORTE_MINOR_VERSION=2
-ORTE_MICRO_VERSION=0
+ORTE_MINOR_VERSION=3
+ORTE_MICRO_VERSION=3
+ORTE_INTERFACE_AGE=0
+ORTE_BINARY_AGE=0
 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)
+AC_SUBST(ORTE_INTERFACE_AGE)
+AC_SUBST(ORTE_BINARY_AGE)
+#Libtool versioning
+ORTE_MICRO_VERSION_NUM=`echo $ORTE_MICRO_VERSION | sed 's/[[a-zA-Z]]//g'`
+LT_RELEASE=$ORTE_MAJOR_VERSION.$ORTE_MINOR_VERSION
+LT_CURRENT=`expr $ORTE_MICRO_VERSION_NUM - $ORTE_INTERFACE_AGE`
+LT_REVISION=$ORTE_INTERFACE_AGE
+LT_AGE=`expr $ORTE_BINARY_AGE - $ORTE_INTERFACE_AGE`
+AC_SUBST(LT_RELEASE)
+AC_SUBST(LT_CURRENT)
+AC_SUBST(LT_REVISION)
+AC_SUBST(LT_AGE)
+VERSION=$ORTE_VERSION
+PACKAGE=orte
+
+echo
+echo "ORTE version $PACKAGE_VERSION"
+echo "Configuring..."
+echo
+
+#Check for CPU / vendor / OS
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
+AM_CONFIG_HEADER(orte/include/orte/orte_config.h)
+AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
+
+
+# Activate maintainer mode
+AM_MAINTAINER_MODE
 
+DS_LINUX()
 
 ###############################
 # target
 WIN='no'
+MINGW='no'
+CYGWIN='no'
 UNIX='no'
 case "$target" in
-  *-cygwin* | *-mingw*)
+  *-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.
+    # Assume Unix.
     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])
@@ -50,6 +84,8 @@ case "$target" in
     ;;
 esac
 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)
 
 ###############################
@@ -78,14 +114,35 @@ fi
 
 ###############################
 # Checks for programs.
+# Initialize libtool
 AC_PROG_CC
-AC_PROG_RANLIB
+AC_PROG_LIBTOOL
+
+###############################
+# Checks for ability to compile ORTE_IDL
+AM_ORTE_IDL
+
+###############################
+# Checks for ability to compile JORTE
+AM_JORTE
 
 ###############################
-# Checks for libraries (not for RT)
+# Checks for libraries and init libtools
 if test -z ${CONFIG_ORTE_RT} ; then
-AC_CHECK_LIB([ws2_32], [main])
-AC_CHECK_LIB([pthread], [main])
+  AC_CHECK_LIB([ws2_32], [main])
+  AC_CHECK_LIB([socket], [main])
+  AC_CHECK_LIB([nsl], [main])
+  dnl Check for pthreads
+  AC_CHECK_LIB(pthread, pthread_create, ,
+         AC_CHECK_LIB(c_r, pthread_create, ,
+              if test ${MINGW} == 'yes' ; then
+                     LIBS=$LIBS' -L$(top_srcdir)/orte/contrib/win_pthread/ -lpthread'
+                     AC_MSG_NOTICE([Using internal version of pthreads!!!])
+              else
+                     AC_MSG_ERROR([Can't compile without pthreads!!!])
+              fi       
+         )
+  )
 fi
 
 ###############################
@@ -102,15 +159,30 @@ AH_VERBATIM([_GNU_SOURCE],[
 if test ${UNIX} == 'yes' -o ${WIN} == 'yes' ; then
     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 sys/types.h net/if.h byteswap.h getopt.h \
-    ctype.h semaphore.h signal.h],,,[[]])
+    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 errno.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],,,[[]])
+    winsock2.h ws2tcpip.h windows.h w32api/windows.h],,,[[]])
 fi
 # kernel
 if test ${CONFIG_ORTE_KERNEL} == 'yes' ; then
@@ -127,7 +199,7 @@ fi
 # RTLinux
 if test ${USE_RTLINUX} == 'yes' ; then
     AC_CHECK_HEADERS([\
-    string.h pthread.h semaphore.h \
+    string.h pthread.h \
     rtl.h rtl_malloc.h udp.h nic.h time.h],,,[[]])
     AC_CHECK_HEADERS([nictab.h],,,[
     #ifdef HAVE_UDP_H
@@ -137,6 +209,17 @@ if test ${USE_RTLINUX} == 'yes' ; then
       #include <nic.h>
     #endif
     ])
+    AC_CHECK_HEADERS([onetd.h],,,[
+    #ifdef HAVE_LINUX_IF_H
+      #include <linux/if.h>
+    #endif
+    #ifdef HAVE_LINUX_IN_H
+      #include <linux/in.h>
+    #endif
+    #ifdef HAVE_PTHREAD_H
+      #include <pthread.h>
+    #endif
+    ])
 fi
 # RTAI
 if test ${USE_RTAI} == 'yes' ; then
@@ -146,7 +229,7 @@ fi
 
 ###############################
 # includes
-INCLUDES='-I$(top_srcdir)/orte/include'
+INCLUDES='-I$(top_srcdir)/orte/include -I$(top_builddir)/orte/include'
 AC_SUBST(INCLUDES)
 
 ###############################
@@ -159,7 +242,7 @@ AC_C_INLINE
 # Checks for library functions.
 AC_PROG_GCC_TRADITIONAL
 if test -z ${CONFIG_ORTE_RT} ; then
-AC_CHECK_FUNCS([strdup gethostbyname])
+AC_CHECK_FUNCS([gethostbyname getopt_long])
 fi
 
 AC_CONFIG_FILES([Makefile
@@ -168,9 +251,14 @@ AC_CONFIG_FILES([Makefile
                 orte/liborte/rtl/Makefile
                 orte/examples/Makefile
                 orte/examples/hello/Makefile
+                orte/examples/multicast/Makefile
                 orte/examples/reliable/Makefile
                 orte/examples/ping/Makefile
                 orte/examples/spy/Makefile
+                orte/examples/schneider/Makefile
+                orte/examples/mpo/Makefile
+                orte/idl-compiler/Makefile
+                orte/libjorte/Makefile
                  orte/manager/Makefile])
 
 
@@ -179,19 +267,18 @@ modtool
 ])
 chmod +x modtool
 
-
 # ======================================================================
-#              generate orte/include/orte_config.h
+#              generate orte/include/orte/orte_config.h
 # ======================================================================
 
-AC_MSG_NOTICE([creating orte/include/orte_config.h])
+AC_MSG_NOTICE([creating orte/include/orte/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])
+    orte/include/orte/orte_config.h >orte/include/orte/orte_config.h.new
+if cmp -s orte/include/orte/orte_config.h.new orte/include/orte/orte_config.h; then
+       rm orte/include/orte/orte_config.h.new
+       AC_MSG_NOTICE([orte/include/orte/orte_config.h is unchanged])
 else
-       mv orte/include/orte_config.h.new orte/include/orte_config.h
+       mv orte/include/orte/orte_config.h.new orte/include/orte/orte_config.h
 fi
 
 echo \
@@ -203,6 +290,10 @@ Configuration ORTE:
   Compiler flags:             ${CFLAGS}
   Host System Type:           ${host}
   
-  See config.h for further configuration information.
+  See orte_config.h for future configuration information.
+  
+  Now you can run
+  make  
+  
 ------------------------------------------------------------------------"