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 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
|
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 RedHat Package Manager
AC_CHECK_PROGS(RPM,rpm,true)
if test "$RPM" != "true"; then
rpm_topdir=`$RPM --showrc | awk '/^topdir/ {print $3}'`
rpm_build_arch=`$RPM --showrc | awk '/^build arch/ {print $4}'`
else
rpm_topdir=""
rpm_build_arch=""
fi
AC_SUBST(rpm_topdir)
AC_SUBST(rpm_build_arch)
# hack to get optional packaging working automagically
RPM_XPCD_GIMP="no"
RPM_XPCD_SVGA="no"
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
echo -n "MIT shm: "
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
echo -n "trying gimp 0.54: "
AC_CHECK_LIB(gimp, gimp_init,,,)
if test "$LIBS" != ""; then
LIBGIMP54="$LIBS"; LIBS=""
TEST_PROGS="$TEST_PROGS plug-0.54"
fi
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";
RPM_XPCD_GIMP="$rpm_build_arch"
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"
RPM_XPCD_SVGA="$rpm_build_arch"
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)
AC_SUBST(LIBGIMP54)
AC_SUBST(LIBGIMP99)
AC_SUBST(LIBVGA)
AC_SUBST(GIMP_PLUGIN_DIR)
AC_SUBST(TEST_PROGS)
AC_SUBST(XPCD_PROGS)
AC_SUBST(RPM_XPCD_GIMP)
AC_SUBST(RPM_XPCD_SVGA)
dnl ---------------------------------------------------------------------
AC_HEADER_DIRENT
AC_CHECK_HEADERS(getopt.h)
AC_CHECK_FUNCS(getopt_long strerror strsignal strdup)
dnl ---------------------------------------------------------------------
AC_OUTPUT(Makefile Make.config xpcd.spec libpcd/Makefile test/Makefile xpcd/Makefile xpcd/system.xpcdrc)
|