configure.ac 2.27 KB
Newer Older
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
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.67])
AC_INIT([codes-net], [0.2], [http://trac.mcs.anl.gov/projects/codes/newticket],[],[http://trac.mcs.anl.gov/projects/codes/wiki])

AC_CANONICAL_TARGET
AC_CANONICAL_SYSTEM
AC_CANONICAL_HOST

AM_INIT_AUTOMAKE([foreign subdir-objects -Wall])

m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

AC_CONFIG_SRCDIR([README.txt])
AC_CONFIG_HEADERS([codes_net_config.h])

# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_RANLIB

AC_REQUIRE_CPP

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h unistd.h execinfo.h pthread.h malloc.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_INT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T

# Checks for library functions.
AC_CHECK_FUNCS([memset])
AC_CHECK_LIB([pthread],[pthread_create],,[AC_MSG_ERROR([Could not find pthread_create!])])
AC_CHECK_LIB([m],[sqrt],,[AC_MSG_ERROR([Could not find sqrt!])])

USE_CODES_BASE=UNKNOWN
AC_ARG_WITH(codes-base,
       [  --with-codes-base=<dir>         Location of codes-base installation],
       [
        AC_CHECK_FILE(${withval}/lib/pkgconfig/codes-base.pc)
        USE_CODES_BASE=${withval}
       ],
       [
        AC_MSG_ERROR([Requires --with-codes-base])
       ])
CODES_BASE_LIBS=`PKG_CONFIG_PATH=${withval}/lib/pkgconfig pkg-config codes-base --libs`
CODES_BASE_CFLAGS=`PKG_CONFIG_PATH=${withval}/lib/pkgconfig pkg-config codes-base --cflags`
AC_SUBST(CODES_BASE_LIBS)
AC_SUBST(CODES_BASE_CFLAGS)

# put include files in a codes/ subdir 
includedir="${includedir}/codes"

AC_CONFIG_FILES([Makefile])
69
AC_CONFIG_FILES([tests/modelnet-test.sh],[chmod +x tests/modelnet-test.sh])
70
71
AC_CONFIG_FILES([tests/modelnet-test-dragonfly.sh],[chmod +x tests/modelnet-test-dragonfly.sh])
AC_CONFIG_FILES([tests/modelnet-test-torus.sh],[chmod +x tests/modelnet-test-torus.sh])
72
AC_CONFIG_FILES([tests/modelnet-test-loggp.sh],[chmod +x tests/modelnet-test-loggp.sh])
Philip Carns's avatar
Philip Carns committed
73
AC_CONFIG_FILES([tests/modelnet-p2p-bw-loggp.sh],[chmod +x tests/modelnet-p2p-bw-loggp.sh])
74
AC_OUTPUT([maint/codes-net.pc])