#ProfiPacket - packet radio terminal program
#Copyright (C) 1999  Alexander Feigl
#
#This program is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#Author:
#
#Alexander Feigl
#Burachstraße 51
#
#D-88250 Weingarten
#
#EMail : Alexander.Feigl@gmx.de

AC_INIT(ProfiPacket/PPVersion.h)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(ProfiPacket,0.26)
AM_DISABLE_SHARED


AC_CANONICAL_HOST()
AC_CANONICAL_BUILD()
AC_CHECK_TOOL(CC,gcc)
AC_CHECK_TOOL(CXX,g++)
AC_CHECK_TOOL(RANLIB,ranlib)
AC_CHECK_TOOL(NM,nm)
AC_CHECK_TOOL(AR,ar)
AC_CHECK_TOOL(LD,ld)
AC_LANG_C()
AC_PROG_CC()

AC_CHECK_COMPILERS

AM_DISABLE_LIBRARIES
KDE_PROG_LIBTOOL


AC_CHECK_GETHOSTNAME
AC_CHECK_GETDOMAINNAME
AC_CHECK_SETENV



AC_MSG_CHECKING(for ProfiPacket BBS compilation )
AC_ARG_ENABLE(bbs,--enable-bbs enable ProfiPacket mailbox, 
if test "$enableval" != "no"; then
AC_MSG_RESULT(Yes)
else
AC_MSG_RESULT(No)
AC_DEFINE(DISABLE_BBS)
fi
,AC_MSG_RESULT(Yes))


# set the platform specific settings

case $host_os in
   amigaos)
    AC_DEFINE(AmigaOS)
    oscflags="-fbaserel -noixemul -fomit-frame-pointer"
    oslibs="-lsysdep -lGUI -lQSO"
    osinclude="-Isysdeps/amiga/."
    buildlibs="libQSO.a libGUI.a libsysdep.a"
    sysdepdir="sysdeps/amiga"
    guidir="GUI/MUI"
    ASM=SNMA
    ACONV=amiga_fixbaserel
    ;;
   linux*)
    AC_DEFINE(LINUX)
    AC_DEFINE(WITH_KDE)
    oscflags=""
    oslibs="-lsysdep -lQSO -lsysdep"
    osinclude="-Isysdeps/linux/."
    buildlibs="libQSO.a libsysdep.a"
    sysdepdir="sysdeps/linux"
    configkde=yes
    ;;
esac

CFLAGS="$CFLAGS $oscflags -Wall"

if test "$configkde" = "yes" ; then
AM_KDE_WITH_NLS
AC_PATH_KDE    
fi 



AC_SUBST(oslibs)
AC_SUBST(osinclude)
AC_SUBST(buildlibs)
AC_SUBST(sysdepdir)
AC_SUBST(guidir)
AC_SUBST(CC)
AC_SUBST(AR)
AC_SUBST(LD)
AC_SUBST(CFLAGS)
AC_SUBST(ASM)
AC_SUBST(ACONV)

AC_OUTPUT(Makefile ProfiPacket/Makefile ProfiPacket/GUI/Makefile
          ProfiPacket/GUI/MUI/Makefile
          ProfiPacket/QSO/Makefile ProfiPacket/sysdeps/Makefile
          ProfiPacket/sysdeps/amiga/Makefile
          ProfiPacket/sysdeps/linux/Makefile
          ProfiPacket/Servers/Makefile
          ProfiPacket/Catalogs/Makefile
          ProfiPacket/Catalogs/deutsch/Makefile ProfiPacket/Catalogs/czech/Makefile
          ProfiPacket/Catalogs/français/Makefile  ProfiPacket/Catalogs/español/Makefile
          ProfiPacket/Catalogs/norsk/Makefile ProfiPacket/Catalogs/polski/Makefile
          ProfiPacket/Catalogs/nederlands/Makefile
          ProfiPacket/Tools/Makefile
          dist/Makefile
          dist/misc/Makefile dist/help/Makefile dist/tncinit/Makefile
          dist/docs/Makefile dist/global/Makefile
          libTNC/Makefile)         


 

