]> git.saurik.com Git - apt.git/blobdiff - configure.in
Update for 0.3.14
[apt.git] / configure.in
index b3f6c57f405b5b7789936cf2965e582e89585d87..9f12f472c87732cfb3f9fa6b0c8a665e2d88bc2e 100644 (file)
@@ -1,3 +1,4 @@
+ad
 dnl Process this file with autoconf to produce a configure script.
 dnl The ONLY thing this is used for is to configure for different
 dnl linux architectures and configurations, it is not used to make the
@@ -8,9 +9,17 @@ dnl some of the more populare bsd/sysv ones (like select). You'll also
 dnl need a C++ compiler that is semi-standard conformant, exceptions are 
 dnl not used but STL is.
 
+dnl 'make -f Makefile startup' will generate the configure file from 
+dnl configure.in correctly and can be run at any time
+
 AC_INIT(configure.in)
+AC_CONFIG_AUX_DIR(buildlib)
 AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in)
 
+dnl -- SET THIS TO THE RELEASE VERSION --
+AC_DEFINE_UNQUOTED(VERSION,"0.3.14")
+AC_DEFINE_UNQUOTED(PACKAGE,"apt")
+
 dnl Tom's host stuff
 tl_CHECK_TOOL_PREFIX   dnl Initial guess
 
@@ -25,19 +34,24 @@ tl_CHECK_TOOL_PREFIX        dnl recheck, in case the initial guess was wrong
 dnl Check for other programs
 tl_PROG_CXX
 AC_LANG_CPLUSPLUS
-
 dnl Checks for X11
 AC_PATH_X
 AC_PATH_XTRA
 AC_SUBST(X11LIB)
 X11LIB=
 if test "$no_x" != "yes"; then
-  X11LIB="-lx11"
+  X11LIB="-lX11"
   AC_DEFINE(HAVE_X11)
+  dnl Checks for ZPM
+  AC_CHECK_LIB(Xpm, XpmLibraryVersion,[AC_DEFINE(HAVE_LIBXPM) XPMLIB="-lXpm"],,$X_LIBS $X_PRE_LIBS $X11LIB $X_EXTRA_LIBS)
+  AC_SUBST(XPMLIB)
+  if test "$XPMLIB" != "-lXpm"; then
+     AC_MSG_ERROR(failed: I need xpm if you are building for X)
+  fi
 fi
 
 dnl Checks for Slang
-AC_CHECK_LIB(slang, init_SLang,[AC_DEFINE(HAVE_LIBSLANG) SLANGLIB="-lslang"])
+AC_CHECK_LIB(slang, SLang_Version,[AC_DEFINE(HAVE_LIBSLANG) SLANGLIB="-lslang"])
 AC_SUBST(SLANGLIB)
 
 dnl Checks for GPM
@@ -47,6 +61,13 @@ if test "$with_gpm" != "no"; then
   AC_SUBST(GPMLIB)
 fi
 
+dnl Checks for pthread
+#AC_CHECK_LIB(pthread, pthread_create,[AC_DEFINE(HAVE_PTHREAD) PTHREADLIB="-lpthread"])
+AC_SUBST(PTHREADLIB)
+#if test "$PTHREADLIB" != "-lpthread"; then
+#  AC_MSG_ERROR(failed: I need posix threads, pthread)
+#fi
+
 dnl Converts the ARCH to be the same as dpkg
 AC_MSG_CHECKING(system architecture)
 archset="`awk '$1 == "'$host_cpu'" { print $2 }' $srcdir/buildlib/archtable`"
@@ -54,37 +75,52 @@ if test "x$archset" = "x"; then
   AC_MSG_ERROR(failed: use --host=)
 fi
 AC_MSG_RESULT($archset)
-AC_DEFINE_UNQUOTED(PKG_DEB_ARCH,"$archset")
+AC_DEFINE_UNQUOTED(ARCHITECTURE,"$archset")
+
+dnl We use C9x types if at all possible
+AC_CACHE_CHECK([for C9x integer types],c9x_ints,[
+    AC_TRY_COMPILE([#include <inttypes.h>],
+                   [uint8_t Foo1;uint16_t Foo2;uint32_t Foo3;uint64_t Foo],
+                  c9x_ints=yes,c9x_ints=no)])
 
 dnl Check the sizes etc. of the architecture
 changequote(,)
 if archline="`sed -ne 's/^'$archset':[         ]\+\(.*\)/\1/gp' $srcdir/buildlib/sizetable`"; then
-changequote([,])
-  set $archline
-  if test "$1" = "little"; then
-    ac_cv_c_bigendian=no
-  else
-    ac_cv_c_bigendian=yes
-  fi
-  size_char=$2
-  size_int=$3
-  size_short=$4
-  size_long=$5
+   changequote([,])
+   set $archline
+   if test "$1" = "little"; then
+      ac_cv_c_bigendian=no
+   else
+      ac_cv_c_bigendian=yes
+   fi
+   size_char=$2
+   size_int=$3
+   size_short=$4
+   size_long=$5
 fi
+
 if test "$cross_compiling" = "yes" -a "$archline" = ""; then
   AC_MSG_ERROR(When cross compiling, architecture must be present in sizetable)
 fi
 AC_C_BIGENDIAN
-AC_CHECK_SIZEOF(char,$size_char)
-AC_CHECK_SIZEOF(int,$size_int)
-AC_CHECK_SIZEOF(short,$size_short)
-AC_CHECK_SIZEOF(long,$size_long)
+   
+dnl We do not need this if we have inttypes..
+HAVE_C9X=yes
+if test x"$c9x_ints" = x"no"; then
+   AC_CHECK_SIZEOF(char,$size_char)
+   AC_CHECK_SIZEOF(int,$size_int)
+   AC_CHECK_SIZEOF(short,$size_short)
+   AC_CHECK_SIZEOF(long,$size_long)
+  
+   HAVE_C9X=
+   AC_SUBST(HAVE_C9X)
+fi
 
 dnl Check for debiandoc
 AC_CHECK_PROG(DEBIANDOC_HTML,debiandoc2html,"yes","")
 AC_CHECK_PROG(DEBIANDOC_TEXT,debiandoc2text,"yes","")
 
-AC_OUTPUT(environment.mak:buildlib/environment.mak.in)
+dnl Check for YODL
+AC_CHECK_PROG(YODL_MAN,yodl2man,"yes","")
 
-dnl Setup the directories
-mkdir doc bin obj include/apt-pkg include/deity
+AC_OUTPUT(environment.mak:buildlib/environment.mak.in makefile:buildlib/makefile.in,make dirs)