~ubuntu-branches/ubuntu/precise/jp2a/precise

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Joao Eriberto Mota Filho
  • Date: 2007-03-16 11:40:04 UTC
  • Revision ID: james.westby@ubuntu.com-20070316114004-d99vg0hcqzptltht
Tags: upstream-1.0.6
ImportĀ upstreamĀ versionĀ 1.0.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#                                               -*- Autoconf -*-
 
2
# Process this file with autoconf to produce a configure script.
 
3
 
 
4
AC_PREREQ(2.60)
 
5
AC_INIT([jp2a], [1.0.6], [csl@sublevel3.org])
 
6
AM_INIT_AUTOMAKE(dist-bzip2)
 
7
AC_CONFIG_SRCDIR(src/jp2a.c)
 
8
AC_CONFIG_HEADER([config.h])
 
9
AC_REVISION([$Id: configure.ac 460 2006-09-25 11:08:24Z csl $])
 
10
AC_CONFIG_FILES([Makefile src/Makefile])
 
11
 
 
12
# Checks for programs.
 
13
AC_PROG_CC
 
14
 
 
15
# Checks for libraries.
 
16
AC_ARG_WITH([jpeg-include],
 
17
        AC_HELP_STRING([--with-jpeg-include=PATH], [specify path to directory containing jpeglib.h -- http://www.ijg.org/]),
 
18
        [CPPFLAGS="$CPPFLAGS -I$withval"])
 
19
 
 
20
AC_ARG_WITH([jpeg-lib],
 
21
        AC_HELP_STRING([--with-jpeg-lib=PATH], [specify path to directory containing jpeglib lib file -- http://www.ijg.org/]),
 
22
        [LDFLAGS="$LDFLAGS -L$withval"])
 
23
 
 
24
AC_ARG_WITH([jpeg-prefix],
 
25
        AC_HELP_STRING([--with-jpeg-prefix=PATH], [this is the same as --with-jpeg-include=PATH/include and --with-jpeg-lib=PATH/lib]),
 
26
        [CPPFLAGS="$CPPFLAGS -I$withval/include" LDFLAGS="$LDFLAGS -L$withval/lib"])
 
27
 
 
28
AC_ARG_WITH([curl-config],
 
29
        AC_HELP_STRING([--with-curl-config=PATH], [specify path to curl-config]),
 
30
        [curl_config_path="$withval" enable_curl="yes"],
 
31
        [curl_config_path="$PATH"])
 
32
 
 
33
AC_CHECK_LIB([jpeg], [jpeg_start_decompress], [LIBS="$LIBS -ljpeg"])
 
34
 
 
35
if test "x$ac_cv_lib_jpeg_jpeg_start_decompress" != "xyes" ; then
 
36
        AC_MSG_ERROR([I need a working jpeglib; please specify --with-jpeg-lib=PATH or see --help for more explicit options.
 
37
 
 
38
On many systems, this is installed in /usr/local/lib/ so you can try --with-jpeg-prefix=/usr/local/
 
39
])
 
40
fi
 
41
 
 
42
AC_ARG_ENABLE([curl],
 
43
        AC_HELP_STRING([--enable-curl], [enable to be to use libcurl (http://curl.haxx.se) to download images from the net (default: yes)]),
 
44
        [enable_curl=$enableval],
 
45
        [enable_curl="yes"])
 
46
 
 
47
AC_ARG_ENABLE([termlib],
 
48
        AC_HELP_STRING([--enable-termlib], [enable to use term/curses for detecting terminal dimensions (default: yes)]),
 
49
        [enable_termlib=$enableval],
 
50
        [enable_termlib="yes"])
 
51
 
 
52
AC_MSG_CHECKING([enable-curl])
 
53
AC_MSG_RESULT([$enable_curl])
 
54
 
 
55
if test "x$enable_curl" = "xyes" ; then
 
56
        AC_PATH_PROGS([curl_config], [curl-config], [no], [$curl_config_path])
 
57
 
 
58
        if test "x$curl_config" != "xno" ; then
 
59
                curl_cflags="`$curl_config --cflags`"
 
60
                curl_libs="`$curl_config --libs`"
 
61
                CPPFLAGS="$CPPFLAGS $curl_cflags"
 
62
 
 
63
                AC_MSG_CHECKING([curl-config --cflags])
 
64
                AC_MSG_RESULT([$curl_cflags])
 
65
 
 
66
                AC_MSG_CHECKING([curl-config --libs])
 
67
                AC_MSG_RESULT([$curl_libs])
 
68
        fi
 
69
 
 
70
        if test "x$curl_libs" = "x" ; then
 
71
                curl_libs="-lcurl"
 
72
        fi
 
73
 
 
74
        AC_CHECK_LIB([curl], [curl_easy_init], [LIBS="$LIBS $curl_libs" AC_DEFINE([FEAT_CURL], [1], [Found working libcurl environment])], [
 
75
                  AC_MSG_WARN([I need a working libcurl (use --with-curl-config=PATH); download-support will be disabled])
 
76
                  enable_curl="no"
 
77
                ])
 
78
fi
 
79
 
 
80
# Checks for header files.
 
81
AC_HEADER_STDC
 
82
 
 
83
AC_CHECK_HEADER([jpeglib.h],
 
84
        [ AC_DEFINE([HAVE_JPEGLIB_H], [1], [Define to 1 if you have <jpeglib.h> header file.]) ],
 
85
        [ AC_MSG_ERROR([required header file jpeglib.h not found, use --with-jpeg-include=PATH or see --help]) ])
 
86
 
 
87
if test "x$enable_curl" = "xyes" ; then
 
88
        AC_CHECK_HEADER([curl/curl.h],
 
89
                [ AC_DEFINE([HAVE_CURL_CURL_H], [1], [Define to 1 if you have the <curl/curl.h> header file]) ],
 
90
                [ AC_MSG_WARN([required header file curl/curl.h not found, libcurl will be disabled (see --help)]) ])
 
91
fi
 
92
 
 
93
AC_CHECK_HEADERS([fcntl.h curses.h term.h ncurses/term.h])
 
94
 
 
95
if test "$enable_termlib" = "yes" ; then
 
96
 
 
97
        # Some GNU/Linux systems (e.g., SuSE 4.3, 1996) don't have curses, but
 
98
        # rather ncurses.  So we check for it.
 
99
        TERMLIBS=
 
100
        # Check for termlib before termcap because Solaris termcap needs libucb.
 
101
        TERMLIB_VARIANTS="ncurses curses termlib termcap terminfo"
 
102
        for termlib in ${TERMLIB_VARIANTS}; do
 
103
          AC_CHECK_LIB(${termlib}, tgetent,
 
104
             [TERMLIBS="${TERMLIBS} -l${termlib}"; break])
 
105
        done
 
106
        # don't bother warning on djgpp, it doesn't have a term library, it
 
107
        # ports each termcap-needing program separately according to its needs.
 
108
        if test -z "$TERMLIBS" && echo "$build" | grep -v djgpp >/dev/null; then
 
109
          AC_MSG_WARN([probably need a terminal library, one of: ${TERMLIB_VARIANTS}])
 
110
        else
 
111
          LIBS="$LIBS $TERMLIBS"
 
112
          AC_DEFINE([FEAT_TERMLIB], [1], [Found working term/curses environment])
 
113
        fi
 
114
 
 
115
fi
 
116
 
 
117
 
 
118
# Checks for typedefs, structures, and compiler characteristics.
 
119
AC_C_CONST
 
120
AC_TYPE_SIZE_T
 
121
 
 
122
# Checks for library functions.
 
123
AC_CHECK_FUNCS([memset])
 
124
AC_CHECK_FUNCS([atexit])
 
125
AC_FUNC_FORK
 
126
AC_TYPE_PID_T
 
127
 
 
128
AC_C_INLINE
 
129
AC_FUNC_MALLOC
 
130
AC_OUTPUT