1dnl# -*- sh -*- 2dnl# Process this file with autoconf to produce a configure script. 3dnl# 4dnl#Copyright (c) 1998 Juergen Sawinski <Juergen.Sawinski@urz.uni-heidelberg.de> 5dnl#Copyright (c) 1997 1998 Guylhem AZNAR <guylhem@oeil.qc.ca> 6 7AC_INIT(Makefile.in) 8AC_CONFIG_AUX_DIR(autoconf) 9AC_CONFIG_HEADER(config.h:autoconf/config.h.in) 10 11version="asmixer-0.5" 12 13dnl# Setup command-line options 14 15dnl# we need the standard prefixes defined early 16test "x$prefix" = xNONE && prefix=$ac_default_prefix 17test "x$exec_prefix" = xNONE && exec_prefix="$prefix" 18eval "bindir=$bindir" 19eval "datadir=$datadir" 20eval "mandir=$mandir" 21 22dnl# directories 23AC_ARG_WITH(gnustep_dir, [ --with-gnustep-dir=DIR GNUstep directory [~/GNUstep] ],with_gnustep_dir=$withval, with_gnustep_dir="~/GNUstep") 24AC_ARG_WITH(gnustep_lib, [ --with-gnustep-lib=DIR GNUstep/Library directory [~/GNUstep/Library] ],with_gnustep_lib=$withval, with_gnustep_lib="~/GNUstep/Library") 25AC_ARG_WITH(afterdir, [ --with-afterdir=DIR user AfterStep dir [~/GNUstep/Library/AfterStep] ],with_afterdir=$withval, with_afterdir="~/GNUstep/Library/AfterStep") 26AC_ARG_ENABLE(shaping, [ --enable-shaping support shaped 27windows [yes] ],enable_shaping=$enableval,enable_shaping="yes") 28AC_ARG_ENABLE(jpeg, [ --enable-jpeg support JPEG 29image format [yes] ],enable_jpeg=$enableval,enable_jpeg="yes") 30 31dnl# Check for compiler tools 32 33AC_PROG_CC 34AC_PROG_INSTALL 35AC_PROG_RANLIB 36AC_PATH_PROG(RM, rm, rm) 37AC_PATH_PROG(MV, mv, mv) 38AC_PATH_PROG(CP, cp, cp) 39AC_PATH_PROG(MKDIR, mkdir, mkdir) 40AC_PATH_PROG(STRIP, strip, strip) 41 42dnl# Remove -g 43 44if test -n '`echo "$CFLAGS " | grep "\-g " 2> /dev/null`' ; then 45 CFLAGS=`echo "$CFLAGS " | sed "s/-g //"` 46fi 47 48dnl# Add -Wall 49 50if test "x$GCC" = "xyes"; then 51 if test -z '`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`' ; then 52 CFLAGS="$CFLAGS -Wall" 53 fi 54fi 55 56dnl# Check for headers 57 58AC_PATH_XTRA 59AC_CHECK_HEADERS(sys/wait.h sys/time.h) 60AC_CHECK_HEADERS(sys/statvfs.h sys/vfs.h sys/mount.h ustat.h) 61AC_CHECK_HEADERS(machine/soundcard.h linux/soundcard.h linux/radio.h) 62AC_CONFIG_HEADER(config.h) 63 64dnl# Check for X 65 66saved_cflags="$CFLAGS" 67saved_ldflags="$LDFLAGS" 68 69CFLAGS="$CFLAGS $X_CFLAGS" 70LDFLAGS="$LDFLAGS $X_LDFLAGS $X_LIBS" 71 72x_libs="$X_EXTRA_LIBS $X_PRE_LIBS" 73AC_CHECK_LIB(X11, XOpenDisplay, [x_libs="-lX11 $x_libs"],,$x_libs) 74 75dnl# Check for XPM library 76 77VT_FIND_LIBXPM 78HAVEXPM="NOXPM" 79if test "x$have_xpm" = "xyes"; then 80 HAVEXPM="XPM" 81 x_libs="$x_libs $XPM_LIBS" 82fi 83for x in $X_CFLAGS; do 84 XPM_CFLAGS=`echo " $XPM_CFLAGS " | sed "s@ $x @ @"` 85done 86 87dnl# Check for X shaped window extension 88 89HAVESHAPE="NOSHAPE" 90if test "x$enable_shaping" = "xyes"; then 91 AC_CHECK_LIB(Xext, XShapeCombineMask, [x_libs="$x_libs -lXext" HAVESHAPE="SHAPE"],,$x_libs) 92fi 93 94CFLAGS="$saved_cflags" 95LDFLAGS="$saved_ldflags" 96 97dnl# Check for libjpeg 98 99HAVEJPEG="NOJPEG" 100if test "x$enable_jpeg" = "xyes"; then 101 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [JPEG_LIB="-ljpeg" HAVEJPEG="JPEG"],,) 102fi 103 104dnl# Variable strings declaration 105 106AC_SUBST(version) 107AC_SUBST(with_locale) 108AC_SUBST(HAVEXPM) 109AC_SUBST(HAVESHAPE) 110AC_SUBST(HAVEJPEG) 111AC_SUBST(XPM_LIBS) 112AC_SUBST(x_libs) 113AC_SUBST(x_includes) 114AC_SUBST(XEXT_LIB) 115AC_SUBST(JPEG_LIB) 116AC_SUBST(with_gnustep_dir) 117AC_SUBST(with_gnustep_lib) 118AC_SUBST(with_afterdir) 119 120dnl# Write results 121 122AC_CONFIG_HEADER(config.h) 123 124dnl# Common parts of the Makefile 125MAKEFILEDEFINES=./autoconf/Makefile.defines 126MAKEFILECOMMON=./autoconf/Makefile.common 127MAKEFILECOMMONLIB=./autoconf/Makefile.common.lib 128 129AC_SUBST_FILE(MAKEFILEDEFINES) 130AC_SUBST_FILE(MAKEFILECOMMON) 131AC_SUBST_FILE(MAKEFILECOMMONLIB) 132 133AC_OUTPUT(\ 134autoconf/Makefile.defines \ 135autoconf/Makefile.common \ 136autoconf/Makefile.common.lib \ 137Makefile 138) 139 140echo " 141 142 143AfterStep applet $version is now hopefully configured, just run : 144make ; make install ; make install.man 145" 146