source: sources/configure.ac @ 41

Last change on this file since 41 was 41, checked in by buchmann, 15 years ago

Add:

  • openmp support:
    • add flags to test_regression makefile
    • configure.ac now checks for openmp
    • Makefile.am add openmp flags
    • a new testbench to check benefits due to openmp
File size: 3.5 KB
Line 
1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.63)
5AC_INIT([SystemCASS],[1.0.0])
6AC_CANONICAL_TARGET
7
8AC_CONFIG_HEADER([config.h])
9
10AM_INIT_AUTOMAKE
11
12# Checks for programs.
13AC_PROG_CXX
14AC_PROG_CC
15AC_PROG_CPP
16AC_PROG_INSTALL
17AC_PROG_LN_S
18AC_PROG_MAKE_SET
19AC_PROG_LIBTOOL
20
21AC_CHECK_PROG(has_latex, latex, yes)
22AC_CHECK_PROG(has_bibtex, bibtex, yes)
23AC_CHECK_PROG(has_fig2dev, fig2dev, yes)
24AC_CHECK_PROG(has_ps2pdf, ps2pdf, yes)
25AC_CHECK_PROG(has_dvips, dvips, yes)
26
27
28# User choices
29AC_DEFUN([MY_ARG_ENABLE],
30            [AC_ARG_ENABLE(m4_translit([[$1]], [_], [-]),
31               [AS_HELP_STRING([--enable-m4_translit([$1], [_], [-])],
32                               [$2 (default is $3)])],
33                                                   [do_$1=${enableval}],
34                                                   [do_$1=$3])
35             AS_IF([test x${do_$1} != "xno"],
36                         AC_DEFINE(m4_toupper([CONFIG_$1]), [], [$2]),
37                         )])
38
39MY_ARG_ENABLE(check_fsm_rules, [Enable FSM rule checking], [no])
40MY_ARG_ENABLE(check_multiwriting2port, [Report if port is written twice], [no])
41MY_ARG_ENABLE(check_multiwriting2register, [Report if unconnected signal is written twice], [no])
42MY_ARG_ENABLE(debug, [Enable debugging], [no])
43
44MY_ARG_ENABLE(default_runtime_compilation, [Compile scheduling code], [no])
45
46# Also set -DNDEBUG when not debugging, this disables assert()s
47AS_IF([test "x$do_debug"  = "xyes"], [CXXFLAGS="-g"         ],
48      [test "x$do_debug" != "xyes"], [CXXFLAGS="-O2 -DNDEBUG"])
49
50case $target_os in
51         linux*)
52                AC_DEFINE(CONFIG_OS_LINUX,1,We have a linux system)
53                AC_SUBST(SC_LIB_TARGET,linux)
54                ;;
55         darwin*)
56                AC_DEFINE(CONFIG_OS_DARWIN,1,We have a MacOS system)
57                AC_SUBST(SC_LIB_TARGET,macosx)
58                ;;
59         *)
60                AC_SUBST(SC_LIB_TARGET,unknown)
61                ;;
62esac
63
64AC_ARG_WITH([pat],
65            [AS_HELP_STRING([--with-pat=PATH],
66              [Use PAT trace format, this needs Alliance in PATH])],
67            [],
68            [with_pat=no])
69
70# Checks for libraries.
71AS_IF([test "x$with_pat" != "xno"],
72          ALLIANCE_CFLAGS="-I$with_pat/include"
73          [AC_CHECK_HEADER([pat.h],,
74                   [AC_MSG_ERROR([You asked for PAT trace format but no pat.h dnl
75can be found. Try --with-pat=/search/dir/])])
76      AC_SEARCH_LIBS([pat_message], [Pat],
77                   AC_DEFINE(CONFIG_PAT_TRACE_FORMAT,1,Use PAT trace format),
78                   AC_MSG_ERROR([You asked for PAT trace format but no libpat dnl
79can be found. Try --with-pat=/search/dir/]),
80                   [-lMut -lPpt -lPgn])]
81          AC_SUBST(ALLIANCE_PATH, $withval)
82          AC_SUBST(ALLIANCE_CFLAGS)
83)
84
85AM_CONDITIONAL(WITH_ALLIANCE, test x$with_pat != xno)
86
87AC_ARG_WITH([soclib],
88            [AS_HELP_STRING([--with-soclib=PATH],
89              [Use SoCLib in PATH to compile examples])],
90            [AC_SUBST(SOCLIB_PATH, $withval)],
91                        [with_soclib=no])
92AM_CONDITIONAL(HAS_SOCLIB, test x$with_soclib != xno)
93
94# OpenMP
95AC_OPENMP([C])
96
97AM_CONDITIONAL(BUILD_DOCS,
98[test x$has_latex$has_bibtex$has_fig2dev$has_ps2pdf$has_dvips = xyesyesyesyesyes])
99
100# Checks for header files.
101AC_HEADER_STDC
102AC_CHECK_HEADERS([stdint.h stdlib.h sys/time.h unistd.h])
103
104# Checks for typedefs, structures, and compiler characteristics.
105AC_HEADER_STDBOOL
106AC_C_CONST
107AC_C_INLINE
108AC_TYPE_INT32_T
109AC_TYPE_PID_T
110AC_TYPE_SIZE_T
111AC_STRUCT_TM
112AC_TYPE_UINT64_T
113
114# Checks for library functions.
115AC_FUNC_MALLOC
116AC_FUNC_REALLOC
117AC_FUNC_STRFTIME
118AC_CHECK_FUNCS([memset strchr strdup strstr])
119
120
121AC_CONFIG_FILES([
122  Makefile
123  src/Makefile
124  doc/Makefile
125  examples/Makefile
126  examples/soclib_date04/Makefile
127  examples/soclib_date04/timer4_gmn_handmade/Makefile
128])
129AC_OUTPUT
130
Note: See TracBrowser for help on using the repository browser.