aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
blob: 167c178bb302e2f07a8e323dabbcfae7761e936c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

# $Id$

AC_PREREQ(2.59)
AC_INIT(rpm-mandriva-setup, 1.57, nanardon@mandriva.org)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(1.9)
AC_CONFIG_SRCDIR

# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_CONFIG_FILES([
                 Makefile
                 ])

AC_CHECK_LIB([rpmio], [rpmLoadMacroFile])
AC_HEADER_STDC
AC_CHECK_HEADERS([string.h rpm/rpmmacros.h rpm/rpmlib.h])

CANONTARGETCPU=${target_cpu}

case "${target_cpu}" in
    *86|athlon|k6|pentium*) 
    RPMALLARCH="i386 i486 i586 i686 k6 athlon pentium3 pentium4"
    CANONTARGETCPU=i586
    ;;
    x86_64|amd64)
    RPMALLARCH="i386 i486 i586 i686 k6 athlon pentium3 pentium4 amd64 x86_64"
    CANONTARGETCPU=x86_64
    CANONTARGETCPU32=i586
    ;;
    ppc|powerpc)
    RPMALLARCH="ppc"
    CANONTARGETCPU=ppc
    ;;
    ppc64|powerpc64)
    RPMALLARCH="ppc ppc32 ppc64"
    CANONTARGETCPU=ppc64
    ;;
    sparc|sparcv9)
    RPMALLARCH="sparc"
    CANONTARGETCPU=sparc
    ;;
    sparc64)
    RPMALLARCH="sparc sparc64"
    CANONTARGETCPU=sparc64
    ;;
esac
RPMALLARCH="${RPMALLARCH} noarch"
AC_SUBST(RPMALLARCH)
AC_SUBST(CANONTARGETCPU)
AC_SUBST(CANONTARGETCPU32)

#
# get rid of the 4-th tuple, if config.guess returned "linux-gnu" for build_os
#
if echo "$build_os" | grep '.*-gnulibc1' > /dev/null ; then
    build_os=`echo "${build_os}" | sed 's/-gnulibc1$//'`
fi
if echo "$build_os" | grep '.*-gnu' > /dev/null ; then
    build_os=`echo "${build_os}" | sed 's/-gnu$//'`
fi

changequote(<, >)
build_os_exact="${build_os}"
build_os_major=`echo "${build_os}" | sed 's/\..*$//'`
build_os_noversion=`echo "${build_os}" | sed 's/[0-9]*\..*$//'`
changequote([, ])

dnl Find our os
RPMOS="$build_os_noversion"
AC_SUBST(RPMOS)

# Checks for library functions.
RPMVENDOR="Mandriva"
AC_ARG_WITH(vendor, [  --with-vendor            the vendor of this config  ])
if test $with_vendor; then
    RPMVENDOR=$with_vendor
fi
AC_SUBST(RPMVENDOR)

RPMCANONVENDOR=`echo "${RPMVENDOR}" | tr [A-Z] [a-z]`
AC_SUBST(RPMCANONVENDOR)

if test X"$prefix" = XNONE ; then
    usrprefix="$ac_default_prefix"
else
    usrprefix=$prefix
fi

RPMLIBDIR="${usrprefix}/lib/rpm"
AC_ARG_WITH(rpmlibdir, [  --with-rpmlibdir=dir    location of rpm config file ])
if test $with_rpmlibdir; then
    RPMLIBDIR=$with_rpmlibdir
fi
AC_SUBST(RPMLIBDIR)

RPMCONFDIR=${RPMLIBDIR}
AC_ARG_WITH(rpmconfdir, [  --with-rpmconfdir=dir    location of our config ])
if test $with_rpmconfdir; then
    RPMCONFDIR=$with_rpmconfdir
fi
AC_SUBST(RPMCONFDIR)

RPMVENDORDIR="${RPMCONFDIR}/${RPMCANONVENDOR}"
AC_SUBST(RPMVENDORDIR)

RPMSYSCONFDIR="/etc/rpm"
AC_ARG_WITH(rpmsysconfdir, [  --with-rpmsysconfdir=dir location of etc ])
if test $with_rpmsysconfdir; then
    RPMSYSCONFDIR=$with_rpmsysconfdir
fi
AC_SUBST(RPMSYSCONFDIR)

AC_OUTPUT