missed one!
[debian/atlc] / configure.ac
1 # Process this file with autoconf to produce a configure script.
2
3 # Order of itmes is suggested in the autoconf documentation to be that
4 # below, to be as below. Let's try to stick to it.
5
6 # checks for programs
7 # checks for libraries
8 # checks for header files
9 # checks for typedefs
10 # checks for structures
11 # checks for compiler characteristics
12 # checks for library functions
13 # checks for system services
14 # AC_OUTPUT([file...])
15
16 AC_INIT([atlc], [4.6.1], [drkirkby@gmail.com])
17 AM_INIT_AUTOMAKE
18 AC_PREREQ([2.57])
19 AC_CONFIG_SRCDIR([tools/src/myfilelength.c])
20 # defining a config.h might be useful as it can prevent a command line becoming
21 # too long, but I find it more of a pain than it is useful. To 
22 # make use of it, it would be necessary to hack every source file to 
23 # include it. I can't be bothered yet. 
24 AC_CONFIG_HEADER([config.h])
25
26
27 # Checks for programs.
28 AC_ISC_POSIX
29
30 # AC_OUTPUT_COMMANDS([exit])
31
32 # Checks for libraries.
33 # check for optimised math library on SPARC
34 # AC_CHECK_LIB([mopt],[main])
35 # check for the optimised
36 # AC_CHECK_LIB([copt],[main])
37 AC_CHECK_LIB(m,log)
38
39 # Checks for header files.
40 AC_HEADER_STDC
41 AC_CHECK_HEADERS([stdio.h math.h malloc.h stdlib.h string.h time.h limits.h ])
42 AC_CHECK_HEADERS([strings.h sys/types.h machine/hal_sysinfo.h sys/sysinfo.h ])
43 AC_CHECK_HEADERS([sys/processor.h sched.h sys/param.h sys/pstat.h sys/unistd.h ])
44 AC_CHECK_HEADERS([ sys/utsname.h sys/systeminfo.h unistd.h aixfont.h ])
45 AC_CHECK_HEADERS([ linux/ip.h errno.h sys/vid.h invent.h sys/sysctl.h ])
46 # sys/syslimits.h and sys/param.h sometimes needed on OpenBSD 3.2 SPARC
47 AC_CHECK_HEADERS([ sys/syslimits.h ])
48
49 # Checks for typedefs
50 AC_HEADER_STDBOOL
51 AC_C_CONST
52 AC_TYPE_SIZE_T
53
54 # checks for structures (none need to be tested)
55
56 # checks for compiler characteristics
57 AC_C_BIGENDIAN
58 AC_CHECK_SIZEOF([size_t])
59
60 # checks for library functions
61 AC_FUNC_STRTOD
62 AC_CHECK_FUNCS([memset strchr strtol processor_info getsysinfo pthread_num_processors_np ])
63 AC_CHECK_FUNCS([ cpu_get_max pstat pstat_getdynamic pstat_getprocessor uname sysconf sysinfo ])
64 AC_CHECK_FUNCS([ cpusetcreate cpucountset cpu_get_num sysctl ])
65
66 # checks for system services
67
68 # Check if the user wants a GUI. If so makes sure GTK and wxWindows are around.
69 # The macro is in the file gtk.m4 in the 'm4' subdirectory.
70
71 #AC_ARG_WITH(gui, AC_HELP_STRING([--with-gui=[no]],[Add a GUI (needs GTK >= 1.2.7 installed) but the GUI does not work!! ]))
72 #AC_PROG_CXX # Test for C++ compiler characteristics
73 #if test "x$with_gui" = "xyes"; then
74 #        AC_PATH_GTK(1.2.7, GTK127=1)
75 #        if test "$GTK127" != 1; then
76 #            AC_MSG_ERROR([
77 #                Please check that gtk-config is in path, the directory
78 #                where GTK+ libraries are installed (returned by
79 #                'gtk-config --libs' command) is in LD_LIBRARY_PATH or
80 #                equivalent variable and GTK+ is version 1.2.7 or above.
81 #            ])
82 #        fi
83 #       AC_CHECK_PROG(WXWINDOWS,wx-config, 1, 0)   
84 #       if test "$WXWINDOWS" != 1; then
85 #            AC_MSG_ERROR([
86 #              wxWindows must be installed to use the GUI version of atlc
87 #        ])
88 #        fi
89 #        AC_SUBST(EXTRA_WXWINDOWS_LIBS,`wx-config --libs`)
90 #        AC_SUBST(EXTRA_WXWINDOWS_CFLAGS,`wx-config --cflags`)
91 #        AC_SUBST(GUI_DIRECTORY,gui)
92 #fi
93
94
95 #AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],[ with debugging code]), AC_DEFINE([DEBUG],[1]))
96 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],[ with debugging code]), AC_DEFINE([DEBUG],[1],[with debugging code]))
97 AC_ARG_ENABLE(hardware-info, AC_HELP_STRING([--disable-hardware-info],[ Find out information about hardware (Disable if compilation fails during 'make check')]), [1],AC_DEFINE([TRY_TO_GET_HARDWARE_INFO],[1],[try to get hardware information]))
98
99 # Put a usage message so the user can use threads if wanted. 
100 #AC_ARG_WITH(threads,
101 #AC_HELP_STRING([--with-threads],
102 #                  [support thread-based parallel computation, using a POSIX thread library (default is NO)]))
103
104 # Multi-Processor Support checked with the macro m4/acx_pthread.m4
105 if test "x$with_threads" = "xyes"; then
106   ACX_PTHREAD([AC_DEFINE([ENABLE_POSIX_THREADS],[1],[Enabling POSIX thread support]) ])
107   LIBS="$PTHREAD_LIBS $LIBS"
108   CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
109   CC="$PTHREAD_CC"
110   # if possible for a number of threads to run at once. 
111   AC_CHECK_FUNC([pthread_setconcurrency],AC_DEFINE([HAVE_PTHREAD_SETCONCURRENCY],[1],[has the pthread_setconcunacy call, needeed on Solaris]))
112   AC_SUBST(built_with_posix_threads,yes)
113 fi
114 AC_CHECK_DECL(_SC_PHYS_PAGES,,)
115 AC_CHECK_DECL(_SC_PAGESIZE,,)
116 AC_CHECK_DECL(_SC_CRAY_NCPU,,)
117 AC_CHECK_DECL(_SC_CRAY_NCPU,,)
118 AC_CHECK_DECL(_SC_NPROC_CONF,,)
119 AC_CHECK_DECL(_SC_NPROC_ONLN,,)
120
121 # MPI and MPE Support
122 #AC_ARG_WITH(mpi, AC_HELP_STRING([--with-mpi=[mpi_install_prefix]],[support MPI-based parallel computation (needs MPICH installed)]))
123 #AC_ARG_WITH(mpe, AC_HELP_STRING([--with-mpe=[mpi_install_prefix]],[implies --with-mpi and additionally links in MPE logging support]))
124
125 # if test "x$with_mpi" != "x" \
126 # || test "x$with_mpe" != "x"; then
127 #
128 #  if test "x$with_threads" = "xyes"; then
129 #     AC_MSG_ERROR([it does not make sense to use --with-threads with --with-mpi or --with-mpe])
130 #  fi  
131 #  ACX_MPI(    [AC_DEFINE([ENABLE_MPI],[1],[Enable the use of MPICH library]) ] ,[],[AC_MSG_ERROR([Could not determine how to link MPI program])])
132 #  CC="$MPICC"
133 #  if test "x$with_mpe" = "xyes" ; then
134 #    LIBS="$MPILIBS -lmpe $LIBS"
135 #  else
136 #    LIBS="$MPILIBS $LIBS"
137 #  fi
138   #AC_CHECK_PROG(mpirun,mpirun,yes,no,$PATH)
139   #if test "x$mpirun" = "xyes"; then
140   #  AC_MSG_NOTICE([Don't forget, 'mpirun' MUST be used to call atlc. Don't run atlc directly!!])
141   #else
142   #  AC_MSG_WARN([The program 'mpirun' needed to run atlc, can't be found])
143   #fi
144 #fi
145
146 dnl Only use -Wall if we have gcc
147 if test "x$GCC" = "xyes"; then
148   if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
149       CFLAGS="$CFLAGS -Wall"
150   fi
151 fi
152 AC_SUBST(compiled_with_compiler,"$CC")
153 AC_SUBST(compiled_with_cflags,"$CFLAGS")
154 AC_OUTPUT([\
155 Makefile                                        \
156 src/Makefile                                    \
157 m4/Makefile                                     \
158 man/Makefile                                    \
159 man/man1/Makefile                               \
160 examples/Makefile                               \
161 tools/Makefile                                  \
162 tools/src/Makefile                              \
163 tests/Makefile                                  \
164 docs/html-docs/Makefile                         \
165 docs/html-docs/jpgs/Makefile                    \
166 docs/qex-december-1996/Makefile                 \
167 docs/theory/Makefile                            \
168 docs/Makefile                                   ])