view configure.in @ 416:a4197ddfc50d

Changes to calculate groupbox border widths and take this into account when calculating window positions.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 15 May 2003 03:38:44 +0000
parents a8015e02b590
children 636a8a19f6c8
line wrap: on
line source

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

DW_MAJOR_VERSION=1
DW_MINOR_VERSION=0
DW_SUB_VERSION=0

DW_SRC=gtk
DW_DEFINE=__UNIX__
AC_SUBST(DW_MAJOR_VERSION)
AC_SUBST(DW_MINOR_VERSION)
AC_SUBST(DW_SUB_VERSION)

INCLUDES="-I."

AC_PROG_CC

AC_CHECK_PROG(MAKE, gmake, gmake)
if test x"$MAKE" = x; then
  AC_CHECK_PROG(MAKE, make, make)
fi

AC_PROG_INSTALL

AC_SUBST(MAKE)

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

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",)

OPSYSTEM=`uname -s`

if test $OPSYSTEM = "Darwin"; then
	DW_SRC=mac
        DW_DEFINE=__MAC__
else
	AC_CHECK_PROG(PKG_CFG, pkg-config, pkg-config)
	if test x"$PKG_CFG" != x; then
	  GTK_LIBS=`$PKG_CFG --silence-errors --libs gtk+-2.0 gthread-2.0`
	fi

	if test x"$GTK_LIBS" = x; then
	  AM_PATH_GLIB(1.2.0,,AC_MSG_ERROR(AC_MSG_ERROR(Cannot find GLIB: Is glib-config in path?)))
	  AM_PATH_GTK(1.2.0,,AC_MSG_ERROR(AC_MSG_ERROR(Cannot find GTK: Is gtk-config in path?)), gthread)
	  AM_PATH_GDK_IMLIB(1.9.4, AC_DEFINE(USE_IMLIB), AC_MSG_ERROR(IMLIB not found or too old. Dynamic Windows cannot build without it.))
	else
	  GTK_CFLAGS=`$PKG_CFG --cflags gtk+-2.0 gthread-2.0`
	  GTK_LIBS=`$PKG_CFG --libs gtk+-2.0 gthread-2.0`
	fi
fi

AC_CHECK_HEADER(pthread.h,,AC_MSG_ERROR([pthread header not found. Dynamic Windows cannot build without it.]))
AC_CHECK_LIB(pthread, pthread_attr_init, PTHREAD_LIBS="-lpthread",
AC_CHECK_LIB(pthreads, pthread_attr_init, PTHREAD_LIBS="-lpthreads",
  AC_CHECK_LIB(c_r, pthread_attr_init, PTHREAD_LIBS="-lc_r",
      AC_MSG_ERROR(pthread library not found. HandyFTP cannot build without it.
      )
    )
  )
)

CFLAGS="$CFLAGS $GTK_CFLAGS $GDK_IMLIB_FLAGS"
LIBS="$LIBS $GTK_LIBS $PTHREAD_LIBS $GDK_IMLIB_LIBS"

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(DW_SRC)
AC_SUBST(DW_DEFINE)

AC_CONFIG_FILES([
Makefile
dw-config ])
AC_OUTPUT