1 # Process this file with autoconf to produce a configure script.
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.
8 # checks for header files
10 # checks for structures
11 # checks for compiler characteristics
12 # checks for library functions
13 # checks for system services
14 # AC_OUTPUT([file...])
16 AC_INIT([atlc], [4.6.1], [drkirkby@gmail.com])
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])
27 # Checks for programs.
30 # AC_OUTPUT_COMMANDS([exit])
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])
39 # Checks for header files.
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 ])
54 # checks for structures (none need to be tested)
56 # checks for compiler characteristics
58 AC_CHECK_SIZEOF([size_t])
60 # checks for library functions
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 ])
66 # checks for system services
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.
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
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.
83 # AC_CHECK_PROG(WXWINDOWS,wx-config, 1, 0)
84 # if test "$WXWINDOWS" != 1; then
86 # wxWindows must be installed to use the GUI version of atlc
89 # AC_SUBST(EXTRA_WXWINDOWS_LIBS,`wx-config --libs`)
90 # AC_SUBST(EXTRA_WXWINDOWS_CFLAGS,`wx-config --cflags`)
91 # AC_SUBST(GUI_DIRECTORY,gui)
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]))
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)]))
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"
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)
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,,)
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]))
125 # if test "x$with_mpi" != "x" \
126 # || test "x$with_mpe" != "x"; then
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])
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])])
133 # if test "x$with_mpe" = "xyes" ; then
134 # LIBS="$MPILIBS -lmpe $LIBS"
136 # LIBS="$MPILIBS $LIBS"
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!!])
142 # AC_MSG_WARN([The program 'mpirun' needed to run atlc, can't be found])
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"
152 AC_SUBST(compiled_with_compiler,"$CC")
153 AC_SUBST(compiled_with_cflags,"$CFLAGS")
164 docs/html-docs/Makefile \
165 docs/html-docs/jpgs/Makefile \
166 docs/qex-december-1996/Makefile \
167 docs/theory/Makefile \