]> Pileus Git - ~andy/rsl/blob - configure.ac
Merge branch 'master' into aweather
[~andy/rsl] / configure.ac
1 # Process this file with autoconf to produce a configure script.
2 AC_INIT(rsl, 1.44)
3 AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability foreign])
4
5 AM_INIT_AUTOMAKE
6 AM_CONFIG_HEADER(config.h)
7 AC_CONFIG_MACRO_DIR([m4])
8
9 # Checks for programs.
10 AC_PROG_CC
11 AM_PROG_LIBTOOL
12 AM_PROG_LEX
13 AC_PROG_YACC
14 AC_PROG_LN_S
15
16 # Checks for header files.
17 AC_HEADER_STDC
18 AC_HEADER_SYS_WAIT
19 AC_CHECK_HEADERS(fcntl.h malloc.h strings.h unistd.h)
20
21 # Checks for typedefs, structures, and compiler characteristics.
22 AC_C_CONST
23 AC_TYPE_SIZE_T
24 AC_STRUCT_TM
25
26 # Checks for library functions.
27 # AC_FUNC_SETVBUF_REVERSED
28 AC_CHECK_FUNCS(mktime strdup strstr)
29
30 # I would like lassen to be defined.  Override this in config.h.
31 AC_DEFINE(HAVE_LASSEN, 1,
32     [For LASSEN capability.  Change this to '#undef HAVE_LASSEN', if you
33      dont want LASSEN.])
34
35 # Standard libraries
36 LIBS="-lz -lm"
37
38 # The order of the libraries is important.
39 # This works:
40 #   -lrsl -limplode -ltsdistk -lmfhdf -ldf -ljpeg -lz -lm
41 #
42 # If mounting with shared libraries we may have to specify all possible libraries.
43 # First check with simple LIBS list, if it fails, then expand the list.
44 AC_SEARCH_LIBS(_implode,            implode)
45 AC_SEARCH_LIBS(jpeg_CreateCompress, jpeg   )
46 AC_SEARCH_LIBS(DFopen,              df     )
47 AC_SEARCH_LIBS(SDstart,             mfhdf  )
48 AC_SEARCH_LIBS(TKopen,              tsdistk)
49
50 # Check if yywrap is defined in toolkit, and add $LEXLIB to LIBS if not.
51 YYWRAP=""
52 AC_SEARCH_LIBS(yywrap, tsdistk, YYWRAP="yes")
53 if test "$YYWRAP" = ""; then
54         LIBS="$LIBS $LEXLIB"
55 fi
56
57 # Test for Windows vs. Unix
58 case "${host}" in
59         *mingw32*) SYS="WIN"  ;;
60         *cygwin*)  SYS="WIN"  ;;
61         *)         SYS="UNIX" ;;
62 esac
63 AC_SUBST([SYS])
64 AM_CONDITIONAL([SYS_WIN],  test "$SYS" = "WIN")
65 AM_CONDITIONAL([SYS_UNIX], test "$SYS" = "UNIX")
66
67 # Check for relative build
68 AC_ARG_ENABLE(relative, [AS_HELP_STRING([--enable-relative],
69         [enable runtime search paths @<:@default=no@:>@])],
70         [DOTS=".."; ac_default_prefix="/"])
71 AC_SUBST([DOTS])
72
73 AC_MSG_RESULT(LIBS = $LIBS)
74 AC_CONFIG_FILES([Makefile doc/Makefile data/Makefile examples/Makefile src/Makefile])
75 AC_OUTPUT