6f6eebc5b88e14673ad105375e6b8a9e74cbb7f7
[cacao.git] / src / mm / boehm-gc / libatomic_ops-1.2 / configure.ac
1 # Process this file with autoconf to produce a configure script.
2 AC_INIT([libatomic_ops],[1.2])
3 AC_CANONICAL_TARGET([])
4 AC_CONFIG_SRCDIR(src/atomic_ops.c)
5 AM_INIT_AUTOMAKE
6 AC_PROG_RANLIB
7
8 AM_CONFIG_HEADER(src/config.h)
9
10 # Checks for programs.
11 AC_PROG_CC
12 AM_PROG_CC_C_O
13 AM_PROG_AS
14
15 # Checks for functions.
16 AC_FUNC_MMAP
17
18 # Checks for header files.
19 AC_HEADER_STDC
20 # AC_CHECK_HEADERS([ ])
21
22 # Determine PIC flag, adjust default CFLAGS
23 need_asm=false
24 PICFLAG=
25 AC_MSG_CHECKING(Determining PIC compiler flag)
26 if test "$GCC" = yes; then
27   AC_MSG_RESULT(-fPIC)
28   PICFLAG=-fPIC
29 else
30   case "$host" in
31     *-*-hpux*)
32       AC_MSG_RESULT("+Z")
33       PICFLAG="+Z"
34       if test "$GCC" != yes; then
35         CFLAGS="$CFLAGS +O2 -mt"
36       fi
37       ;;
38     *-*-solaris*)
39       AC_MSG_RESULT(-Kpic)
40       PICFLAG=-Kpic
41       if test "$GCC" != yes; then
42         CFLAGS="$CFLAGS -O"
43         need_asm=true
44       fi
45       ;;
46     *-*-linux*)
47       AC_MSG_RESULT(-fPIC)
48       PICFLAG=-fPIC
49       # Any Linux compiler had better be gcc compatible.
50       ;;
51     *)
52       AC_MSG_RESULT("<none>")
53       ;;
54   esac
55 fi
56 CFLAGS="$CFLAGS -DNDEBUG"
57
58 AC_SUBST(PICFLAG)
59 AC_SUBST(DEFS)
60
61 AM_CONDITIONAL(NEED_ASM, test x$need_asm = xtrue)
62
63 AC_CONFIG_FILES([Makefile src/Makefile src/atomic_ops/Makefile src/atomic_ops/sysdeps/Makefile doc/Makefile tests/Makefile])
64 AC_CONFIG_COMMANDS([default],[[]],[[PICFLAG=${PICFLAG}
65 CC=${CC}
66 DEFS=${DEFS}]])
67 AC_OUTPUT