File: configure.in

package info (click to toggle)
xpcd 2.08-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 632 kB
  • ctags: 556
  • sloc: ansic: 6,368; makefile: 235; sh: 200; perl: 12
file content (147 lines) | stat: -rw-r--r-- 4,111 bytes parent folder | download
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
dnl ---------------------------------------------------------------------
dnl Process this file with autoconf to produce a configure script.
AC_INIT(libpcd/pcd.h)
AC_CONFIG_HEADER(config.h)

dnl -------- init/set defaults
TEST_PROGS="pcdtoppm"
XPCD_PROGS="xpcd"
LDLIBS="/usr/local/lib"

dnl ---------------------------------------------------------------------
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_CHECK_PROGS(DEPEND,gccmakedep makedepend,true)
AC_CHECK_PROG(XV_REM,      xv,      [  ], [# ])
AC_CHECK_PROG(DISPLAY_REM, display, [  ], [# ])

dnl ---------------------------------------------------------------------
dnl X11 checks
AC_PATH_XTRA

dnl ---------------------------------------------------------------------
dnl MIT shm
AC_ARG_WITH(mitshm,
  [  --with-mitshm           enable/disable MIT shared memory],
  ac_mitshm="$withval",ac_mitshm="")

if test "$ac_mitshm" != "no"; then
  AC_CHECK_LIB(Xext, XShmAttach,
	  [ MIT_SHMEM="-lXext"; AC_DEFINE(HAVE_MITSHM) ],,
	  $X_LIBS $X_PRE_LIBS -lXt -lX11 $X_EXTRA_LIBS)
fi
AC_SUBST(MIT_SHMEM)

dnl ---------------------------------------------------------------------
dnl xaw3d

AC_ARG_WITH(xaw3d,
  [  --with-xaw3d            enable/disable Xaw3d support],
  ac_xaw3d="$withval",ac_xaw3d="")

if test "$ac_xaw3d" != "no"; then
  AC_CHECK_LIB(Xaw3d, Xaw3dComputeTopShadowRGB,
	X_TOOLKIT="-lXaw3d",
	X_TOOLKIT="-lXaw",
	$X_LIBS $X_PRE_LIBS -lXext -lXmu -lXt -lX11 $X_EXTRA_LIBS)
else
  X_TOOLKIT="-lXaw"
fi

dnl ---------------------------------------------------------------------
dnl jpeg lib

AC_ARG_WITH(jpeg,
  [  --with-jpeg             enable/disable JPEG support],
  ac_jpeg="$withval",ac_jpeg="")

if test "$ac_jpeg" != "no"; then
  AC_CHECK_LIB(jpeg, jpeg_start_compress,,,)
  if test "$LIBS" != ""; then LIBJPEG="$LIBS"; LIBS=""; fi
fi

dnl ---------------------------------------------------------------------
dnl tiff lib

AC_ARG_WITH(tiff,
  [  --with-tiff             enable/disable TIFF support],
  ac_tiff="$withval",ac_tiff="")

if test "$ac_tiff" != "no"; then
#if test "$ac_tiff" = "yes"; then
  AC_CHECK_LIB(tiff,TIFFOpen,,,$LIBJPEG -lm)
  if test "$LIBS" != ""; then LIBTIFF="$LIBS"; LIBS=""; fi
fi

dnl ---------------------------------------------------------------------
dnl gimp lib

AC_ARG_WITH(gimp,
  [  --with-gimp             enable/disable building the gimp plugin],
  ac_gimp="$withval",ac_gimp="")

if test "$ac_gimp" != "no"; then
dnl  echo -n "trying gimp 0.54: "
dnl  AC_CHECK_LIB(gimp, gimp_init,,,)
dnl  if test "$LIBS" != ""; then
dnl    LIBGIMP54="$LIBS"; LIBS=""
dnl    TEST_PROGS="$TEST_PROGS plug-0.54"
dnl  fi
dnl  echo -n "trying gimp 0.99: "
  AC_CHECK_LIB(gimp, gimp_image_new,,,-lglib)
  if test "$LIBS" != ""; then
    LIBGIMP99="$LIBS -lglib"; LIBS=""
    XPCD_PROGS="$XPCD_PROGS xpcd-gate";
    GIMP_PLUGIN_DIR=""
    for dir in /usr/lib/gimp/*/plug-ins /usr/local/lib/gimp/*/plug-ins; do
      if test -d $dir; then
	GIMP_PLUGIN_DIR="$dir"
	break
      fi
    done
  fi
fi

dnl ---------------------------------------------------------------------
dnl svga lib

AC_ARG_WITH(svga,
  [  --with-svga             enable/disable svgalib support],
  ac_svga="$withval",ac_svga="")

if test "$ac_svga" != "no"; then
  AC_CHECK_LIB(vga, vga_getmodeinfo,,,)
  if test "$LIBS" != ""; then
    LIBVGA="$LIBS -lvgagl"; LIBS=""
    TEST_PROGS="$TEST_PROGS pcdview"
  fi
fi

dnl ---------------------------------------------------------------------

AC_SUBST(X_CFLAGS)
AC_SUBST(X_PRE_LIBS)
AC_SUBST(X_EXTRA_LIBS)
AC_SUBST(X_LIBS)
AC_SUBST(X_TOOLKIT)
AC_SUBST(x_includes)
AC_SUBST(x_libraries)

AC_SUBST(LIBJPEG)
AC_SUBST(LIBTIFF)
dnl AC_SUBST(LIBGIMP54)
AC_SUBST(LIBGIMP99)
AC_SUBST(LIBVGA)

AC_SUBST(GIMP_PLUGIN_DIR)
AC_SUBST(TEST_PROGS)
AC_SUBST(XPCD_PROGS)

dnl ---------------------------------------------------------------------
AC_HEADER_DIRENT
AC_CHECK_HEADERS(getopt.h)
AC_CHECK_FUNCS(getopt_long strerror strsignal strdup)

dnl ---------------------------------------------------------------------
AC_OUTPUT(Makefile Make.config libpcd/Makefile test/Makefile xpcd/Makefile xpcd/system.xpcdrc)