source: sources/configure.ac @ 39

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

Default:

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