dtcalc: make it build
[oweals/cde.git] / cde / configure.ac
index a7f5221251ca543b6c3732606d5f82b7d6ef34ce..f8084b591c71c1eaf06a1c3410bf2061ba09980b 100644 (file)
@@ -2,10 +2,13 @@ AC_INIT([cde-desktop], [2.3.1], [jon@radscan.com])
 AC_CONFIG_HEADERS([include/autotools_config.h])
 AC_CONFIG_MACRO_DIRS([m4])
 AM_INIT_AUTOMAKE([foreign subdir-objects])
+LT_INIT
 AC_PREFIX_DEFAULT(/usr/dt)
 
 AC_ENABLE_STATIC([no])
 
+PKG_PROG_PKG_CONFIG
+
 dnl todo: determine what version of autoconf we depend on
 dnl AC_PREREQ()
 
@@ -21,8 +24,8 @@ AC_SUBST(CDE_VERSION_MAJOR)
 AC_SUBST(CDE_VERSION_MINOR)
 AC_SUBST(CDE_VERSION_MICRO)
 
-dnl SOURCE_DEFINES - needed for some OS's
-SOURCE_CPP_DEFINES=""
+dnl SOURCE_DEFINES - start with CDE project default
+SOURCE_CPP_DEFINES="-DANSICPP -DMULTIBYTE -DNLS16"
 
 dnl CPP_COMPILER_FLAGS - CPP/C/C++ compiler flags
 CPP_COMPILER_FLAGS=""
@@ -60,8 +63,8 @@ case "${host_os}" in
                build_linux=yes
                 OSMAJORVERSION=4
                 OSMINORVERSION=15
-                SOURCE_CPP_DEFINES="-D_POSIX_SOURCE -D_DEFAULT_SOURCE \
--D_BSD_SOURCE -D_SVID_SOURCE"
+                SOURCE_CPP_DEFINES="${SOURCE_CPP_DEFINES} -D_POSIX_SOURCE \
+-D_DEFAULT_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE"
                 CPP_COMPILER_FLAGS="-fno-strict-aliasing -Wno-write-strings \
 -Wno-unused-result"
                  ;;
@@ -150,7 +153,7 @@ AM_CONDITIONAL([MIPS], [test "is_mips" = yes])
 AM_CONDITIONAL([PPC], [test "is_ppc" = yes])
 
 dnl our main libraries
-dnl we use single quotes so that $top_builder is evaluated in the makefiles,
+dnl we use single quotes so that $top_buildir is evaluated in the makefiles,
 dnl not here.
 AC_SUBST(LIBTT, '$(top_builddir)/lib/tt/lib/libtt.la')
 AC_SUBST(LIBXIN, '$(top_builddir)/lib/DtXinerama/libDtXinerama.la')
@@ -193,17 +196,26 @@ AM_CONDITIONAL([SPANISH], [test "build_spanish" = "yes"])
 RM="rm -f"
 AC_SUBST(RM)
 
+dnl these should be configurable someday...
+CDE_INSTALLATION_TOP="$ac_default_prefix"
 CDE_LOGFILES_TOP=/var/dt
 CDE_CONFIGURATION_TOP=/etc/dt
 CDE_USER_TOP=.dt
 
+AC_SUBST(CDE_INSTALLATION_TOP)
 AC_SUBST(CDE_CONFIGURATION_TOP)
 AC_SUBST(CDE_LOGFILES_TOP)
 AC_SUBST(CDE_USER_TOP)
 
 AC_PROG_CC
 AC_PROG_CXX
+
 AC_PROG_CPP
+
+dnl we need a real preprocessor, not gcc -E.  We will call it GENCPP.  We will
+dnl go with BSD's tradcpp here...
+AC_SUBST(GENCPP, '$(top_builddir)/util/tradcpp/tradcpp')
+
 AM_PROG_LIBTOOL
 AC_PROG_YACC
 AM_PROG_LEX
@@ -232,8 +244,14 @@ AC_PROG_CC_C99
 AC_PATH_X
 AC_PATH_XTRA
 
+AC_FUNC_FORK
+
+dnl programs with full paths
+
+AC_PATH_PROG(KSH, ksh)
+AC_PATH_PROG(XRDB, xrdb)
+
 dnl programs
-AC_CHECK_PROGS(KSH, ksh)
 AC_CHECK_PROGS(BDFTOPCF, bdftopcf)
 AC_CHECK_PROGS(MKFONTIDR, mkfontdir)
 AC_CHECK_PROGS(GZIP, gzip)
@@ -245,17 +263,21 @@ AC_HEADER_STDC
 AC_CHECK_HEADERS([locale.h])
 
 dnl libraries
+AC_CHECK_LIB(m, cosf)
+AC_CHECK_LIB(crypt, crypt)
 AC_CHECK_LIB(tirpc, main, [TIRPCINC="-DOPT_TIRPC -I/usr/include/tirpc"; TIRPCLIB=-ltirpc])
 AC_SUBST(TIRPCINC)
 AC_SUBST(TIRPCLIB)
 AC_CHECK_LIB(Xinerama, XineramaQueryScreens, ,[AC_MSG_ERROR([libXinerama not found])])
 
-dnl Setup XTOOLLIB
-XTOOLLIB=""
+dnl Setup XTOOLLIB - we do it in this specific order to avoid ordering
+dnl issues
+XTOOLLIB="$X_LIBS"
 AC_CHECK_LIB(X11, XOpenDisplay, [XTOOLLIB="-lX11"])
 AC_CHECK_LIB(Xt, XtInitialize, [XTOOLLIB="-lXt ${XTOOLLIB}"])
 AC_CHECK_LIB(ICE, IceCloseConnection, [XTOOLLIB="-lICE ${XTOOLLIB}"])
 AC_CHECK_LIB(SM, SmcOpenConnection, [XTOOLLIB="-lSM ${XTOOLLIB}"])
+AC_CHECK_LIB(Xm, XmTextSetString, [XTOOLLIB="-lXm ${XTOOLLIB}"])
 AC_SUBST([XTOOLLIB])
 
 dnl Add -DUSE_XINERAMA to SOURCE_CPP_DEFINES for now.  Eventually this
@@ -277,6 +299,9 @@ dnl All of the makefiles we need to generate go here...
 AC_CONFIG_FILES([
 Makefile
 
+util/Makefile
+util/tradcpp/Makefile
+
 lib/Makefile
 
 lib/DtXinerama/Makefile
@@ -358,6 +383,27 @@ programs/dtpad/Makefile
 programs/dtfile/Makefile
 programs/dtfile/dtcopy/Makefile
 
+programs/dtwm/Makefile
+
+programs/dtlogin/Makefile
+programs/dtlogin/config/Makefile
+
+programs/dtsession/Makefile
+
+programs/dthello/Makefile
+
+programs/dtstyle/Makefile
+
+programs/dtexec/Makefile
+
+programs/dtdbcache/Makefile
+
+programs/dticon/Makefile
+
+programs/dtterm/Makefile
+
+programs/dtcalc/Makefile
+
 ])
 
 AC_OUTPUT