]> Pileus Git - ~andy/rsl/blob - configure.ac
f0e8297bc34a7891cba75eaed37fa9a9731d1e60
[~andy/rsl] / configure.ac
1 # Process this file with autoconf to produce a configure script.
2 AC_INIT(rsl, v1.40.3)
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 # Checks for libraries.
36 if test $prefix = NONE; then
37   prefix=$ac_default_prefix
38 fi
39 LIBDIR="-L$prefix/lib"
40 LIBS="-lz -lm"
41
42 # The order of the libraries is important.
43 # This works:
44 #   -lrsl -limplode -letor -ltsdistk -lmfhdf -ldf -ljpeg -lz -lm
45 #
46 # If mounting with shared libraries we may have to specify all possible libraries.
47 # First check with simple LIBS list, if it fails, then expand the list.
48
49 AC_CHECK_LIB(implode,  _implode,           ,,$LIBDIR)
50 AC_CHECK_LIB(jpeg,     jpeg_CreateCompress,,,$LIBDIR)
51 AC_CHECK_LIB(df,       DFopen,             ,,$LIBDIR)
52 AC_CHECK_LIB(mfhdf,    SDstart,            ,,$LIBDIR)
53 AC_CHECK_LIB(tsdistk,  TKopen,             ,,$LIBDIR)
54
55 # Because -letor may depend on RSL being installed, just check for
56 # the library libetor.a in a couple of places.
57
58 # For autoheader, generate template for HAVE_LIBETOR.
59 AH_TEMPLATE(HAVE_LIBETOR,[For EDGE capability.  Change this
60     to '#define HAVE_LIBETOR 1', if you have libetor -- the EDGE decoding
61     library.])
62
63 L=""
64
65 if test "$L" = ""; then # Check for the file directly.
66         AC_CHECK_FILE($prefix/lib/libetor.a, L="-letor -lrsl -letor"; AC_DEFINE(HAVE_LIBETOR))
67 fi
68 if test "$L" = ""; then # Check for the file directly.
69         AC_CHECK_FILE(/usr/local/lib/libetor.a, L="-letor -lrsl -letor"; AC_DEFINE(HAVE_LIBETOR))
70 fi
71
72 if test "$L" != ""; then # libetor exists.
73 LIBS="$LIBDIR $L $LIBS"
74 else
75 LIBS="$LIBDIR $LIBS"
76 fi
77
78 # Check if yywrap is defined in toolkit, and add $LEXLIB to LIBS if not.
79 YYWRAP=""
80 AC_CHECK_LIB(tsdistk,  yywrap, YYWRAP="yes",,$LIBDIR)
81 if test "$YYWRAP" = ""; then
82         LIBS="$LIBS $LEXLIB"
83 fi
84
85 AC_MSG_RESULT(LIBS = $LIBS)
86 AC_CONFIG_FILES([Makefile doc/Makefile data/Makefile examples/Makefile src/Makefile])
87 AC_OUTPUT