dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT([liborange], [0.3], twogood@users.sourceforge.net) AC_CANONICAL_HOST AC_CANONICAL_TARGET AM_INIT_AUTOMAKE AM_CONFIG_HEADER(config.h) AC_SUBST(APPLE_CFLAGS) case $target in powerpc-apple-*) dnl Prevent "Undefined Macro argument list" error. APPLE_CFLAGS="-no-cpp-precomp" ;; esac dnl Checks for programs. AC_PROG_AWK AC_PROG_CC AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_LIBTOOL AC_PROG_MAKE_SET dnl AM_PATH_CHECK() dnl Checks for libraries. AC_LIB_RPATH dnl Check for library dependencies AM_PATH_LIBSYNCE dnl AM_PATH_LIBRAPI2 AM_PATH_LIBDYNAMITE AM_PATH_LIBUNSHIELD dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST dnl Conditional compile of Inno Setup support (because it's not very good) my_enable_inno=0 AC_ARG_ENABLE(inno, AC_HELP_STRING( [--enable-inno], [Enables expermential Inno Setup support]), [my_enable_inno=1], [my_enable_inno=0] ) AC_DEFINE_UNQUOTED(ENABLE_INNO, $my_enable_inno, [Set to 1 when Inno Setup support is enabled]) if test $my_enable_inno -eq 1; then INNO_LIBADD='inno.lo' fi AC_SUBST([INNO_LIBADD]) dnl Conditional compile of VISE support (because it's not very good) my_enable_vise=0 AC_ARG_ENABLE(vise, AC_HELP_STRING( [--enable-vise], [Enables expermential VISE support]), [my_enable_vise=1], [my_enable_vise=0] ) AC_DEFINE_UNQUOTED(ENABLE_VISE, $my_enable_vise, [Set to 1 when VISE support is enabled]) if test $my_enable_vise -eq 1; then VISE_LIBADD='vise.lo' fi AC_SUBST([VISE_LIBADD]) dnl Conditional compile of libole2 (because it's GPL licensed) my_with_libole2=0 AC_ARG_WITH(libole2, AC_HELP_STRING( [--with-libole2], [Use GPL-contaminated libole2 for MSI decoding]), [my_with_libole2=1], [my_with_libole2=0] ) if test $my_with_libole2 -eq 1; then AM_PATH_LIBOLE2([0.2.4], [AC_DEFINE_UNQUOTED(WITH_LIBOLE2, $my_with_libole2, [Set to 1 when libole2 support is included])], [AC_MSG_ERROR([Can't find libole2])] ) fi dnl Conditional compile of MSI support (because it requires libole2) my_enable_msi=0 AC_ARG_ENABLE(msi, AC_HELP_STRING( [--enable-msi], [Enables expermential MSI support]), [my_enable_msi=1], [my_enable_msi=0] ) AC_DEFINE_UNQUOTED(ENABLE_MSI, $my_enable_msi, [Set to 1 when msi support is enabled]) if test $my_enable_msi -eq 1; then if test $my_with_libole2 -eq 1; then MSI_LIBADD='msi.lo' else AC_MSG_ERROR([Not configured with libole2 but that's needed for MSI support.]) fi fi AC_SUBST([MSI_LIBADD]) dnl Look for libmagic AC_CHECK_LIB(magic,magic_open) AC_CHECK_HEADERS(magic.h) # http://www.gnu.org/manual/autoconf-2.53/html_node/AC_LIBOBJ-vs.-LIBOBJS.html # This is necessary so that .o files in LIBOBJS are also built via # the ANSI2KNR-filtering rules. LIB@&t@OBJS=`echo "$LIB@&t@OBJS" | sed 's,\.[[^.]]* ,$U&,g;s,\.[[^.]]*$,$U&,'` LTLIBOBJS=`echo "$LIB@&t@OBJS" | sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'` AC_SUBST(LTLIBOBJS) AC_CHECK_LIB(z,inflate,,[ AC_MSG_ERROR(["Could not find zlib, please install it!"]) ]) AC_OUTPUT([Makefile lib/Makefile src/Makefile])