-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
101 lines (90 loc) · 3.22 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
dnl
dnl configure.in
dnl autoconf input file for imgvtopgm.
dnl
dnl Copyright (C) 1998 Eric A. Howe
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
dnl
dnl Authors: Eric A. Howe ([email protected])
dnl
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
AC_INIT(imgvtopnm.c)
AM_INIT_AUTOMAKE(imgvtopgm, 2.0)
dnl
dnl This is a trick to get my CVS ident string into configure.
dnl AC_REVISION could be used but that strips out the dollar signs and
dnl thus prevents `ident' from figuring out the revision information.
dnl
AC_OUTPUT_COMMANDS([# @(#)$Mu: imgvtopgm/configure.in 1.6 1999/05/12 15:54:10 $])
MU_PROG_CC
AC_C_BIGENDIAN
if test $ac_cv_c_bigendian = "yes"; then
CFLAGS="-DMU_BIGENDIAN $CFLAGS"
else
CFLAGS="-DMU_LITTLEENDIAN $CFLAGS"
fi
AC_PATH_XTRA
dnl ==========================================================================
dnl Makefile things.
dnl ==========================================================================
AC_ARG_ENABLE(maintainer,
[ --enable-maintainer enable maintainer rules [default=no]])
AM_CONDITIONAL(MU_MAINTAINER, test x$enable_maintainer = xyes)
dnl
dnl Checks for libraries.
dnl
MU_FIND_PNM
LIBS="$LIBS $X_EXTRA_LIBS"
CFLAGS="$CFLAGS $X_CFLAGS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
LDFLAGS="$LDFLAGS $X_LIBS"
PBM_LIBS=""
AC_CHECK_LIB(pbm, pbm_init, PBM_LIBS="$PNM_LIBS -lpbm")
if test "$PBM_LIBS" = ""; then
AC_MSG_ERROR([The PBM library '-lpbm' could not be found.
Please use the configure options '--with-pnm-includes=DIR'
and '--with-pnm-libraries=DIR' to specify the netpbm location.
See the 'config.log' file for further diagnostics.])
fi
AC_SUBST(PBM_LIBS)
PGM_LIBS=""
AC_CHECK_LIB(pgm, pgm_init, PGM_LIBS="$PNM_LIBS -lpgm", , $PNM_LIBS ${PBM_LIBS})
if test "$PGM_LIBS" = ""; then
AC_MSG_ERROR([The PGM library '-lpgm' could not be found.
Please use the configure options '--with-pnm-includes=DIR'
and '--with-pnm-libraries=DIR' to specify the netpbm location.
See the 'config.log' file for further diagnostics.])
fi
AC_SUBST(PGM_LIBS)
dnl
dnl The pbmplus.h header (stupidly) provides K&R prototypes for some
dnl functions from libc (sigh) so we define SYSV to hopefully work around
dnl the brain damage; this works for me on Linux, YMMV. Another option is
dnl to use -ansi with gcc but I don't know how to get auto* to do The Right
dnl Thing.
dnl
AC_MSG_CHECKING([whether we need -DSYSV])
AC_TRY_COMPILE([
#define SYSV
#include <pbmplus.h>],
[exit(0);],
AC_MSG_RESULT(yes)
AC_DEFINE(SYSV),
AC_MSG_RESULT(no)
)
AC_OUTPUT([Makefile imgvinfo.1 imgvtopnm.1 imgvview.1 pbmtoimgv.1 pgmtoimgv.1 ppmimgvquant.1 imgvview ppmimgvquant])