1 # Process this file with autoconf to produce a configure script.
2 AC_INIT([libatomic_ops],[7.2])
4 AC_CANONICAL_TARGET([])
5 AC_CONFIG_SRCDIR(src/atomic_ops.c)
9 AM_CONFIG_HEADER(src/config.h)
11 # Checks for programs.
15 # Checks for functions.
18 # Checks for header files.
20 # AC_CHECK_HEADERS([ ])
25 AC_MSG_CHECKING(for PIC compiler flag)
26 if test "$GCC" = yes; then
28 *-*-cygwin* | *-*-mingw*)
29 # Cygwin and Mingw[-w32/64] do not need -fPIC.
30 AC_MSG_RESULT("<none>")
35 AC_MSG_CHECKING(whether gcc -fPIC causes __PIC__ definition)
36 # Workaround: at least GCC 3.4.6 (Solaris) does not define this macro.
38 CFLAGS="$PICFLAG $CFLAGS"
43 ], [ac_cv_pic_macro=yes], [ac_cv_pic_macro=no])
45 AC_MSG_RESULT($ac_cv_pic_macro)
46 AS_IF([test "$ac_cv_pic_macro" = yes], [],
47 [PICFLAG="-D__PIC__=1 $PICFLAG"])
55 CFLAGS="$CFLAGS +O2 -mt"
66 # Any Linux compiler had better be gcc compatible.
69 AC_MSG_RESULT("<none>")
73 CFLAGS="$CFLAGS -DNDEBUG"
77 AH_TEMPLATE([_PTHREADS], [Indicates the use of pthreads (NetBSD).])
81 ## Libraries needed to support threads.
82 AC_CHECK_LIB(pthread, pthread_self, THREADDLLIBS="-lpthread",,)
83 AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads.])
88 *-*-openbsd* | *-*-kfreebsd*-gnu | *-*-dgux*)
91 *-*-cygwin* | *-*-darwin*)
99 AC_SUBST(THREADDLLIBS)
101 AM_CONDITIONAL(HAVE_PTHREAD_H, test x$have_pthreads = xtrue)
102 AM_CONDITIONAL(NEED_ASM, test x$need_asm = xtrue)
104 AC_CONFIG_FILES([Makefile pkgconfig/atomic_ops.pc \
105 pkgconfig/atomic_ops-uninstalled.pc doc/Makefile src/Makefile \
106 src/atomic_ops/Makefile src/atomic_ops/sysdeps/Makefile tests/Makefile])
107 AC_CONFIG_COMMANDS([default],[[]],[[