view src/configure.in @ 130:eab2a1950daf

Mac: Add "classic" as an optional architecure for 10.5-10.6 era fat binaries supporting 32bit and 64bit Intel and 32-bit PowerPC. Remove "all" and "64bit" options since there are no Xcode versions that will build these combinations.
author Brian Smith <brian@dbsoft.org>
date Mon, 14 Dec 2020 19:36:50 -0600
parents 8baca19f709d
children
line wrap: on
line source

AC_INIT(handyftp.c)
AC_CONFIG_HEADER(config.h)

INCLUDES="-I."

AC_PROG_CC

AC_CHECK_PROG(MAKE, gmake, gmake)
if test x"$MAKE" = x; then
  AC_CHECK_PROG(MAKE, make, make)
fi
if test -d ../.hg; then 
   AC_CHECK_PROG(MERCURIAL, hg, hg)
fi
if test x"$MERCURIAL" = x; then
   MERCURIAL=0
else
   MERCURIAL="\` $MERCURIAL log -r . --template={rev} \`"
fi

AC_PROG_INSTALL

AC_CHECK_PROG(GRC, glib-compile-resources, glib-compile-resources)

AC_SUBST(MAKE)
AC_SUBST(GRC)

dnl Checks for system
AC_CANONICAL_SYSTEM

dnl ---------------------- check for '--with-arch' switch -----------------
AC_ARG_WITH(arch,
   [  --with-arch             specify MacOS architecture: one of modern, classic, 32bit, intel, arm, powerpc],
   [with_arch=$withval],
   [with_arch=no],
)

AC_HEADER_STDC
AC_HEADER_DIRENT
AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(sys/stat.h)

LIBS=`dwindows-config --libs`
CFLAGS=`dwindows-config --cflags`
GRESOURCE=`dwindows-config --gresource`
PLATFORM=`uname -s`

if test x"$GRESOURCE" = x"enabled"; then
  RESOURCE="gresources.o"
else
  RESOURCE="resources.o"
fi

if test x"$PLATFORM" = x"Darwin"; then
  RESOURCE=""
fi

AC_CHECK_LIB(dwindows, dw_main,LIBS="$LIBS",AC_MSG_ERROR(Dynamic Windows library not found. HandyFTP cannot build without it.))

AC_CHECK_FUNCS(pipe, AC_DEFINE(HAVE_PIPE,1,Determine whether we have the pipe function))

AC_CHECK_FUNCS(connect)
if test x"$ac_cv_func_connect" = x"no"; then
  if test -z "$libsocket"; then
    AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket",)
  fi

  dnl this is for isc.  need the nsl_s library as well.
  if test -z "$libinet"; then
    AC_CHECK_LIB(inet, socket, libnsl=1; LIBS="$LIBS -linet -lnsl_s",)
  fi

  if test -z "$libnsl"; then
    AC_CHECK_LIB(nsl, gethostname, LIBS="$LIBS -lnsl",)
  fi
fi

AC_CHECK_LIB(sun, getpwnam, LIBS="$LIBS -lsun",)
AC_CHECK_LIB(dgc, inet_addr, LIBS="$LIBS -ldgc",)
AC_CHECK_LIB(resolv, gethostbyname, LIBS="$LIBS -lresolv",)
AC_CHECK_LIB(dwcompat, locale_string, LIBS="$LIBS -ldwcompat",)

case "$target" in
   *apple-darwin*)
      case "$with_arch" in
         no)
            ARCH=""
            ;;
         classic)
            ARCH="-arch ppc -arch x86_64 -arch i386"
            ;;
         32bit)
            ARCH="-arch ppc -arch i386"
            ;;
         intel)
            ARCH="-arch i386 -arch x86_64"
            ;;
         powerpc)
            ARCH="-arch ppc -arch ppc64"
            ;;
         arm)
            ARCH="-arch arm64"
            ;;
         modern)
            ARCH="-arch x86_64 -arch arm64"
            ;;
         *)
            ARCH="-arch $with_arch"
            ;;
      esac
   ;;
   *)
   ;;
esac

RM="rm -f"
LN="ln -s"
CP="cp"
MV="mv"
MKDIR="mkdir"


AC_SUBST(INCLUDES)
AC_SUBST(RM)
AC_SUBST(LN)
AC_SUBST(CP)
AC_SUBST(MV)
AC_SUBST(MKDIR)

AC_SUBST(ARCH)

AC_SUBST(RESOURCE)

AC_CONFIG_FILES([
Makefile
gtk/org.dbsoft.handyftp.desktop ])
AC_OUTPUT