File: configure.in

package info (click to toggle)
ippl 1.4.14-12.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 452 kB
  • ctags: 244
  • sloc: ansic: 1,649; sh: 794; yacc: 434; lex: 160; makefile: 93
file content (108 lines) | stat: -rw-r--r-- 2,916 bytes parent folder | download | duplicates (8)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
dnl autoconf for ippl. Copyright (C) 1999 Hugo Haas

dnl Initialisation
AC_INIT(Makefile.in)

dnl Version
VERSION=`cat $srcdir/VERSION`
AC_SUBST(VERSION)

echo "Configuring ippl $VERSION..."
echo

dnl Check compilers
AC_PROG_CC
AC_PROG_LEX
AC_PROG_YACC
AC_PROG_INSTALL

dnl Specifying the user used to run threads
DEFAULT_USER="nobody"
AC_ARG_WITH(user,
[ --with-user=USER      Specify which user will run the threads
                       by default (default: nobody)],
[ if test $withval != "yes" -a $withval != "no"; then
    DEFAULT_USER=$withval
  fi
])

dnl Options
AC_ARG_ENABLE(multithread,
[ --enable-multithread  Run a thread for each new packet logged],
[ if test $enableval = "yes"; then
    MULTITHREAD=" -D_MULTITHREAD_"
  fi
  AC_SUBST(MULTITHREAD)
])
AC_ARG_ENABLE(cache-debug,
[ --enable-cache-debug  Display DNS cache statistics],
[ if test $enableval = "yes"; then
    CACHE_DEBUG=" -DCACHE_DEBUG"
  fi
  AC_SUBST(CACHE_DEBUG)
])
AC_ARG_ENABLE(filter-debug,
[ --enable-filter-debug  Display filtering process],
[ if test $enableval = "yes"; then
    FILTER_DEBUG=" -DFILTER_DEBUG"
  fi
  AC_SUBST(FILTER_DEBUG)
])
AC_ARG_ENABLE(parsing-debug,
[ --enable-parsing-debug Shows configuration parsing process],
[ if test $enableval = "yes"; then
    PARSING_DEBUG=" -DPARSING_DEBUG"
    YACC_DEBUG_OPTIONS=" -dtv"
  fi
  AC_SUBST(PARSING_DEBUG)
  AC_SUBST(YACC_DEBUG_OPTIONS)
])
AC_ARG_ENABLE(all-warnings,
[ --enable-all-warnings Run the compiler in pedantic mode],
[ if test $enableval = "yes"; then
    PEDANTIC=" -pedantic"
  fi
  AC_SUBST(PEDANTIC)
])
AC_ARG_WITH(dmalloc,
[ --with-dmalloc        Link the program with the dmalloc library],
[ if test $withval = "yes"; then
    AC_CHECK_LIB(dmalloc, main, DMALLOC=" -ldmalloc")
  fi
   AC_SUBST(DMALLOC)
])


fail_pthread() {
  echo "Please update your pthread library:"
  echo "         http://pauillac.inria.fr/~xleroy/linuxthreads/"
  exit
}

dnl Check for functions
AC_CHECK_LIB(pthread, pthread_attr_init,, fail_pthread)
AC_CHECK_LIB(pthread, pthread_attr_setdetachstate,, fail_pthread)
AC_CHECK_LIB(pthread, pthread_attr_destroy,, fail_pthread)
AC_CHECK_LIB(pthread, pthread_create,, fail_pthread)
AC_CHECK_LIB(pthread, pthread_setcancelstate,, fail_pthread)
AC_CHECK_LIB(pthread, pthread_attr_setdetachstate,, fail_pthread)
AC_CHECK_LIB(pthread, pthread_cancel,, fail_pthread)
AC_CHECK_LIB(pthread, pthread_mutex_lock,, fail_pthread)
AC_CHECK_LIB(pthread, pthread_mutex_unlock,, fail_pthread)

# If $sysconfdir == /usr/etc, change it to /etc
if [[ $prefix = '/usr' -a $sysconfdir = '${prefix}/etc' ]]; then
    echo sysconfig is set to /usr/etc. Changing it to /etc.
    sysconfdir='/etc'
fi

dnl Default user
AC_SUBST(DEFAULT_USER)
echo "Using $DEFAULT_USER as the default user to run threads."

AC_OUTPUT(Makefile Makefile.common Source/Makefile Docs/Makefile)

echo
make configdump
echo
echo Now you can type \`\` make \'\'. Good luck!