dtlogin: build on openbsd
[oweals/cde.git] / cde / configure.ac
index 4e9a22194f33c24e39a67b3072766e31b83a3b66..94d3f6c12dbe5ea3bd26a70773f6b2c53d9756be 100644 (file)
@@ -13,6 +13,7 @@ dnl todo: determine what version of autoconf we depend on
 dnl AC_PREREQ()
 
 AC_CANONICAL_HOST
+AC_CANONICAL_BUILD
 
 dnl global CDE versioning
 
@@ -58,6 +59,11 @@ dnl temporary.
 OSMAJORVERSION=4
 OSMINORVERSION=15
 
+dnl locations of libs/includes if not in 'standard' places like on
+dnl linux
+MOTIF_LIB=""
+MOTIF_INC=""
+
 case "${host_os}" in
        linux*)
                build_linux=yes
@@ -112,9 +118,11 @@ dnl Add osmajor/minor version to cppflags.
 OSVERSION="-DOSMAJORVERSION=$OSMAJORVERSION -DOSMINORVERSION=$OSMINORVERSION"
 
 dnl set CSRG_BASED define for the BSD's
-if test "$build_bsd" = "yes"
+if test "$bsd" = "yes"
 then
         SOURCE_CPP_DEFINES="${SOURCE_CPP_DEFINES} -DCSRG_BASED"
+        MOTIF_LIB="-L/usr/local/lib -R/usr/local/lib"
+        MOTIF_INC="-I/usr/local/include -I/usr/X11R6/include/freetype2"
 fi
 
 is_x86_64=no
@@ -124,23 +132,23 @@ is_mips=no
 is_arm=no
 is_ppc=no
 
-case "$target_or_host" in
-       i*86-*-*)
+case "${host_cpu}" in
+       i[3456]86*)
                is_i386=yes
                ;;
-       x86_64-*)
+       x86_64* | amd64*)
                is_x86_64=yes
                ;;
-       *arm*)
+       arm*)
                is_arm=yes
                ;;
-       *mips*)
+       mips*)
                is_mips=yes
                ;;
-       *sparc*)
+       sparc*)
                is_sparc=yes
                ;;
-       ppc-*-linux* | powerpc-*)
+       ppc* | powerpc*)
                is_ppc=yes
                ;;
 esac
@@ -153,7 +161,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,20 +201,35 @@ AM_CONDITIONAL([FRENCH], [test "build_french" = "yes"])
 AC_ARG_ENABLE(spanish, --build-spanish    Build Spanish    (default=no)])
 AM_CONDITIONAL([SPANISH], [test "build_spanish" = "yes"])
 
+dnl hmmm...
 RM="rm -f"
 AC_SUBST(RM)
+CP="cp -f"
+AC_SUBST(CP)
 
+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.
+dnl We will go with BSD's tradcpp here...  This is used for
+dnl pre-processing during building of CDE - in the way imake used to
+dnl do.  This is not a replacement for cpp, used at runtime by
+dnl software such as tt_type_comp.
+AC_SUBST(GENCPP, '$(top_builddir)/util/tradcpp/tradcpp')
+
 AM_PROG_LIBTOOL
 AC_PROG_YACC
 AM_PROG_LEX
@@ -237,13 +260,25 @@ AC_PATH_XTRA
 
 AC_FUNC_FORK
 
+dnl programs with full paths
+
+AC_PATH_PROG(KSH, ksh)
+AC_PATH_PROG(XRDB, xrdb)
+dnl we need to use cpp for some things, like tooltalk and other
+dnl runtime uses.  So look for the system's cpp.  NOTE: this is NOT
+dnl the CPP (gcc -E) set by AC_PROG_CPP.  At this point I don't know
+dnl if we should even bother looking for that as we can't really use
+dnl it.
+AC_PATH_PROG(CPP_PROGRAM, cpp, ,
+       [/lib:/usr/bin:/usr/ccs/lib/:/usr/lib:/usr/libexec:/opt/langtools/lbin:$PATH])
+
 dnl programs
-AC_CHECK_PROGS(KSH, ksh)
 AC_CHECK_PROGS(BDFTOPCF, bdftopcf)
-AC_CHECK_PROGS(MKFONTIDR, mkfontdir)
+AC_CHECK_PROGS(MKFONTDIR, mkfontdir)
 AC_CHECK_PROGS(GZIP, gzip)
 AC_CHECK_PROGS(M4, m4)
 AC_CHECK_PROGS(RPCGEN, rpcgen)
+AC_CHECK_PROGS(GENCAT, gencat)
 
 dnl headers
 AC_HEADER_STDC
@@ -252,23 +287,30 @@ 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)
+dnl this should be configurable, for now it is required
+AC_CHECK_LIB(Xinerama, XineramaQueryScreens,
+                [SOURCE_CPP_DEFINES="${SOURCE_CPP_DEFINES} -DUSE_XINERAMA"],
+                [AC_MSG_ERROR([libXinerama not found])], $X_LIBS)
+
+dnl Special check for tirpc...
+AC_CHECK_LIB(tirpc, svc_register,
+      [CFLAGS="${CFLAGS} -DOPT_TIRPC -I/usr/include/tirpc";
+       CXXFLAGS="${CXXFLAGS} -DOPT_TIRPC -I/usr/include/tirpc";
+       TIRPCLIB=-ltirpc])
 AC_SUBST(TIRPCLIB)
-AC_CHECK_LIB(Xinerama, XineramaQueryScreens, ,[AC_MSG_ERROR([libXinerama not found])])
 
-dnl Setup XTOOLLIB
+dnl Setup XTOOLLIB - we do it in this specific order to avoid ordering
+dnl issues
 XTOOLLIB=""
-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(X11, XOpenDisplay, [XTOOLLIB="-lX11"], , $X_LIBS)
+AC_CHECK_LIB(Xau, XauReadAuth, [XTOOLLIB="-lXau ${XTOOLLIB}"], , $X_LIBS)
+AC_CHECK_LIB(Xt, XtInitialize, [XTOOLLIB="-lXt ${XTOOLLIB}"], , $X_LIBS)
+AC_CHECK_LIB(ICE, IceCloseConnection, [XTOOLLIB="-lICE ${XTOOLLIB}"], , $X_LIBS)
+AC_CHECK_LIB(SM, SmcOpenConnection, [XTOOLLIB="-lSM ${XTOOLLIB}"], , $X_LIBS)
+AC_CHECK_LIB(Xm, XmTextSetString, [XTOOLLIB="-lXm ${XTOOLLIB}"], , [$MOTIF_LIB $X_LIBS])
+XTOOLLIB="$X_LIBS $MOTIF_LIB ${XTOOLLIB}"
 AC_SUBST([XTOOLLIB])
 
-dnl Add -DUSE_XINERAMA to SOURCE_CPP_DEFINES for now.  Eventually this
-dnl should be configurable.
-SOURCE_CPP_DEFINES="${SOURCE_CPP_DEFINES} -DUSE_XINERAMA"
-
 dnl set CPPFLAGS, CFLAGS, and CXXFLAGS.
 dnl The Autoconf manual says that these are user variables and
 dnl shouldn't be modified.  It suggests that you create a special
@@ -276,14 +318,17 @@ dnl variable and presumably add those to your Makefile.am files.  We
 dnl have 192 of these currently, so... The user will just have to
 dnl deal, or modify them here directly.
 CPPFLAGS="${CPPFLAGS} ${SOURCE_CPP_DEFINES} ${CPP_COMPILER_FLAGS} ${OSVERSION}"
-CFLAGS="${CFLAGS} ${C_COMPILER_FLAGS} ${PTHREAD_CFLAGS}"
-CXXFLAGS="${CXXFLAGS} ${CXX_COMPILER_FLAGS} ${PTHREAD_CFLAGS}"
+CFLAGS="${CFLAGS} ${C_COMPILER_FLAGS} ${X_CFLAGS} ${MOTIF_INC} ${PTHREAD_CFLAGS}"
+CXXFLAGS="${CXXFLAGS} ${CXX_COMPILER_FLAGS} ${X_CFLAGS} ${MOTIF_INC} ${PTHREAD_CFLAGS}"
 LIBS="${LIBS} ${PTHREAD_LIBS}"
 
 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
@@ -336,6 +381,8 @@ programs/Makefile
 
 programs/backdrops/Makefile
 
+programs/palettes/Makefile
+
 programs/icons/Makefile
 
 programs/dthelp/Makefile
@@ -368,6 +415,121 @@ 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
+
+programs/dtaction/Makefile
+
+programs/dtspcd/Makefile
+
+programs/dtscreen/Makefile
+
+programs/dtcm/Makefile
+programs/dtcm/libDtCmP/Makefile
+programs/dtcm/server/Makefile
+programs/dtcm/dtcm/Makefile
+
+programs/dtsearchpath/Makefile
+programs/dtsearchpath/libCliSrv/Makefile
+programs/dtsearchpath/dtsp/Makefile
+programs/dtsearchpath/dtappg/Makefile
+
+programs/dtappintegrate/Makefile
+
+programs/dtprintegrate/Makefile
+
+programs/dtconfig/Makefile
+programs/dtconfig/sun/Makefile
+
+programs/dtcreate/Makefile
+
+programs/dtprintinfo/Makefile
+
+programs/fontaliases/Makefile
+programs/fontaliases/bdf/Makefile
+programs/fontaliases/linux/Makefile
+programs/fontaliases/linux/C/Makefile
+programs/fontaliases/linux/en_US.UTF-8/Makefile
+programs/fontaliases/sun/Makefile
+programs/fontaliases/sun/C/Makefile
+programs/fontaliases/netbsd/Makefile
+programs/fontaliases/netbsd/C/Makefile
+programs/fontaliases/openbsd/Makefile
+programs/fontaliases/openbsd/C/Makefile
+programs/fontaliases/freebsd/Makefile
+programs/fontaliases/freebsd/C/Makefile
+
+programs/dtdspmsg/Makefile
+
+programs/dtimsstart/Makefile
+
+programs/dtpdm/Makefile
+
+programs/dtsr/Makefile
+
+programs/dtpdmd/Makefile
+
+programs/types/Makefile
+
+programs/tttypes/Makefile
+
+programs/util/Makefile
+programs/util/dttypes/Makefile
+
+programs/dtopen/Makefile
+
+programs/localized/Makefile
+programs/localized/util/Makefile
+programs/localized/C/Makefile
+programs/localized/C/app-defaults/Makefile
+programs/localized/C/config/Makefile
+programs/localized/C/backdrops/Makefile
+programs/localized/C/types/Makefile
+programs/localized/C/palettes/Makefile
+programs/localized/C/msg/Makefile
+programs/localized/de_DE.UTF-8/Makefile
+programs/localized/de_DE.UTF-8/app-defaults/Makefile
+programs/localized/de_DE.UTF-8/config/Makefile
+programs/localized/de_DE.UTF-8/backdrops/Makefile
+programs/localized/de_DE.UTF-8/types/Makefile
+programs/localized/de_DE.UTF-8/palettes/Makefile
+programs/localized/de_DE.UTF-8/msg/Makefile
+programs/localized/fr_FR.UTF-8/Makefile
+programs/localized/fr_FR.UTF-8/app-defaults/Makefile
+programs/localized/fr_FR.UTF-8/config/Makefile
+programs/localized/fr_FR.UTF-8/backdrops/Makefile
+programs/localized/fr_FR.UTF-8/types/Makefile
+programs/localized/fr_FR.UTF-8/palettes/Makefile
+programs/localized/fr_FR.UTF-8/msg/Makefile
+programs/localized/it_IT.UTF-8/Makefile
+programs/localized/it_IT.UTF-8/app-defaults/Makefile
+programs/localized/it_IT.UTF-8/config/Makefile
+programs/localized/it_IT.UTF-8/backdrops/Makefile
+programs/localized/it_IT.UTF-8/types/Makefile
+programs/localized/it_IT.UTF-8/palettes/Makefile
+programs/localized/it_IT.UTF-8/msg/Makefile
+programs/localized/es_ES.UTF-8/Makefile
+programs/localized/es_ES.UTF-8/app-defaults/Makefile
+programs/localized/es_ES.UTF-8/config/Makefile
+programs/localized/es_ES.UTF-8/backdrops/Makefile
+programs/localized/es_ES.UTF-8/types/Makefile
+programs/localized/es_ES.UTF-8/palettes/Makefile
+programs/localized/es_ES.UTF-8/msg/Makefile
 
 ])