| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213 |
- dnl Process this file with autoconf to produce a configure script.
- AC_PREREQ([2.12])
- AC_INIT(include/dpkg.h.in)
- AM_CONFIG_HEADER(config.h)
- AC_CHECK_TOOL_PREFIX
- AC_PROG_CC
- AC_CANONICAL_SYSTEM
- AC_CHECK_TOOL_PREFIX
- dnl tl_PROG_CXX
- AC_PROG_CXX
- AM_CONDITIONAL(HAVE_CPLUSPLUS, [test "$CXX" != ""])
- AC_CHECK_TOOL(LD, ld, ld)
- AM_INIT_AUTOMAKE(dpkg,[`sed -n '1s/dpkg (\([0-9.]\+\)).*/\1/p' ${srcdir}/debian/changelog`])
- ACLOCAL="$ACLOCAL -I automake"
- AC_MSG_CHECKING(dpkg version)
- AC_MSG_RESULT($VERSION)
- AC_PREFIX_DEFAULT(/usr)
- dpkg_archset=''
- AC_ARG_WITH(arch,
- [ --with-arch=value set/override (Debian) architecture value (deprecated)],
- [
- if test "x$with_arch" = x; then
- AC_MSG_ERROR(--with-arch requires an architecture name)
- fi
- dpkg_archset="${with_arch}"
- dpkg_tmp="`awk '$1 == "'$target_cpu'" { print $2 }' $srcdir/archtable`"
- if test "x$dpkg_tmp" = "x"; then
- AC_MSG_WARN([unable to find specified architecture $dpkg_archset in archtable])
- elif test "x$dpkg_tmp" != "x$dpkg_archset"; then
- AC_MSG_WARN([canonical architecture is $dpkg_tmp (from archtable)])
- fi
- ],[
- AC_MSG_CHECKING(system architecture)
- dpkg_archset="`awk '$1 == "'$target_cpu'" { print $2 }' $srcdir/archtable`"
- # Finish off
- if test "x$dpkg_archset" = "x"; then
- AC_MSG_ERROR(failed: use --with-arch= or --target=)
- fi
- AC_MSG_RESULT($dpkg_archset)
- ])
- if test "x$dpkg_archset" != x
- then
- AC_DEFINE_UNQUOTED(ARCHITECTURE, "${dpkg_archset}")
- fi
- if test "x${dpkg_archset}" = xi386; then
- AC_MSG_CHECKING(target i386 system/binary format)
- case "${target_os}" in
- linuxaout|linux-gnuaout)
- AC_MSG_RESULT(Linux a.out)
- dpkg_cc_binfmt=a.out
- ;;
-
- linuxcoff|linux-gnucoff)
- AC_MSG_RESULT(Linux COFF)
- dpkg_cc_binfmt=coff
- ;;
-
- linux|linuxelf|linux-gnu*)
- AC_MSG_RESULT(Linux ELF)
- dpkg_cc_binfmt=elf
- ;;
-
- *)
- AC_MSG_RESULT([other (${target_os})])
- dpkg_cc_binfmt=""
- ;;
- esac
- if test "x$dpkg_cc_binfmt" != "x"; then
- AC_DEFINE_UNQUOTED(ARCHBINFMT," $dpkg_cc_binfmt")
- fi
- fi
- AC_ARG_WITH(newdeb,
- [ --with-newdeb make dpkg-deb default to new archives],
- [AC_DEFINE(BUILDOLDPKGFORMAT, 0)])
- AC_ARG_WITH(olddeb,
- [ --with-olddeb make dpkg-deb default to old archives],
- [AC_DEFINE(BUILDOLDPKGFORMAT, 1)])
- dnl gettext
- ALL_LINGUAS="en fr es ja_JP.ujis"
- AM_GNU_GETTEXT
- dnl Other stuff
- AC_MSG_CHECKING(for /usr/bin/perl)
- if test -f /usr/bin/perl
- then
- AC_MSG_RESULT(yes)
- perlpath=/usr/bin/perl
- AC_SUBST(perlpath)
- else
- AC_MSG_RESULT(no)
- AC_PATH_PROG(perlpath,perl)
- fi
- AC_STDC_HEADERS
- AC_PROG_INSTALL
- AM_PROG_LIBTOOL
- dnl Default in case EMACS == no
- lispdir="\$(datadir)/emacs/site-lisp"
- AM_PATH_LISPDIR
- AC_MODE_T
- AC_PID_T
- AC_SIZE_T
- AC_VPRINTF
- AC_C_CONST
- AC_C_BIGENDIAN
- AC_CHECK_SIZEOF(unsigned long)
- AC_CHECK_SIZEOF(unsigned int)
- AC_CHECK_FUNCS(unsetenv alphasort scandir strerror strsignal strtoul vsnprintf lchown)
- AC_CHECK_HEADERS(sys/cdefs.h sys/sysinfo.h)
- AC_CHECK_FUNC(sysinfo,
- AC_DEFINE(HAVE_SYSINFO),
- AC_MSG_CHECKING(__NR_sysinfo)
- AC_EGREP_CPP(yes, [
- #include <linux/sys.h>
- #include <linux/kernel.h>
- #include <linux/unistd.h>
- #ifdef __NR_sysinfo
- yes
- #endif
- ],
- AC_MSG_RESULT([yes; tsk tsk - get your libc fixed.])
- AC_DEFINE(HAVE_NRSYSINFO),
- AC_MSG_RESULT(no)
- AC_MSG_WARN([sysinfo missing; compilation of dpkg proper may fail.])))
- AC_SUBST(OPTCFLAGS)
- if test "${GCC-no}" = yes; then
- CFLAGS="-D_REENTRANT -D_GNU_SOURCE -O2"
- CXXFLAGS="-D_REENTRANT -D_GNU_SOURCE -O2"
- OPTCFLAGS="-O3"
- else
- CFLAGS="-D_REENTRANT -D_GNU_SOURCE -O"
- CXXFLAGS="-D_REENTRANT -D_GNU_SOURCE -O"
- fi
- DPKG_CACHED_TRY_COMPILE(your C compiler,dpkg_cv_c_works,
- [#include <string.h>], [strcmp("a","b")],
- AC_MSG_RESULT(works),
- AC_MSG_RESULT(broken)
- AC_MSG_ERROR(C compiler is broken))
- DPKG_CACHED_TRY_COMPILE(alphasort declaration,dpkg_cv_header_alphasort,[
- #include <sys/types.h>
- #include <sys/dir.h>
- ], alphasort,
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_ALPHASORT_DECLARATION),
- AC_MSG_RESULT(no))
- DPKG_CACHED_TRY_COMPILE(inlines,dpkg_cv_c_inline,,
- [} inline int foo (int x) {],
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_INLINE),
- AC_MSG_RESULT(no))
- DPKG_CACHED_TRY_COMPILE(__attribute__((,,)),dpkg_cv_c_attribute_supported,,
- [extern int testfunction(int x) __attribute__((,,))],
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_GNUC25_ATTRIB)
- DPKG_CACHED_TRY_COMPILE(__attribute__((noreturn)),dpkg_cv_c_attribute_noreturn,,
- [extern int testfunction(int x) __attribute__((noreturn))],
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_GNUC25_NORETURN),
- AC_MSG_RESULT(no))
- DPKG_CACHED_TRY_COMPILE(__attribute__((const)),dpkg_cv_c_attribute_const,,
- [extern int testfunction(int x) __attribute__((const))],
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_GNUC25_CONST),
- AC_MSG_RESULT(no))
- DPKG_CACHED_TRY_COMPILE(__attribute__((format...)),dpkg_cv_attribute_format,,
- [extern int testfunction(char *y, ...) __attribute__((format(printf,1,2)))],
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_GNUC25_PRINTFFORMAT),
- AC_MSG_RESULT(no)),
- AC_MSG_RESULT(no))
- AC_SUBST(CWARNS)
- CWARNS=""
- DPKG_C_GCC_TRY_WARNS(-Wall -Wno-implicit, dpkg_cv_c_gcc_warn_all)
- DPKG_C_GCC_TRY_WARNS(-Wwrite-strings, dpkg_cv_c_gcc_warn_writestrings)
- DPKG_C_GCC_TRY_WARNS(-Wpointer-arith, dpkg_cv_c_gcc_warn_pointerarith)
- DPKG_C_GCC_TRY_WARNS(-Wimplicit -Wnested-externs, dpkg_cv_c_gcc_warn_implicit)
- if test "${GCC-no}" = yes; then
- CWARNS="${CWARNS} -Wmissing-prototypes -Wstrict-prototypes"
- fi
- echo "#define DPKG_VERSION \"$VERSION\" /* This line modified by configure */" > version.h.new
- cmp -s version.h.new version.h || mv version.h.new version.h
- AC_CONFIG_SUBDIRS(utils)
- AC_OUTPUT([Makefile intl/Makefile dpkg-deb/Makefile lib/Makefile
- include/Makefile dselect/Makefile split/Makefile methods/Makefile
- md5sum/Makefile main/Makefile doc/Makefile doc/ja/Makefile scripts/Makefile
- utils/Makefile po/Makefile.in])
|