aboutsummaryrefslogtreecommitdiff
path: root/tools/darwin/depends/configure.in
blob: 2b3d69eaa0ca2bc4bfbd271605c1fda3db8b2df8 (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
AC_PREREQ(2.59)
AC_INIT([darwin-depends], [1.00], [http://trac.xbmc.org])

AC_ARG_WITH([staging],
  [AS_HELP_STRING([--with-staging],
  [depends build location (/Users/Shared/xbmc-depends).])],
  [use_staging=$withval],
  [use_staging="/Users/Shared/xbmc-depends"])

AC_ARG_WITH([darwin],
  [AS_HELP_STRING([--with-darwin],
  [build depend libs for darwin osx (default) or ios.])],
  [use_darwin=$withval],
  [use_darwin="osx"])

AC_ARG_WITH([arch],
  [AS_HELP_STRING([--with-arch],
  [build depend libs for arch i386 (default), x86_64, ppc or arm7.])],
  [use_arch=$withval],
  [use_arch="i386"])

AC_ARG_WITH([sdk],
  [AS_HELP_STRING([--with-sdk],
  [build depend libs using sdk 10.4 (default) or 4.2.])],
  [use_sdk=$withval],
  [use_sdk="10.4"])

OUTPUT_FILES="Makefile Makefile.include"
AC_MSG_RESULT(configuring for darwin $use_darwin-$use_sdk-$use_arch)
case $use_darwin in
  osx)
     if test "$use_arch" = "arm7"; then
       AC_MSG_ERROR(error in configure of --with-arch=$use_arch)
     fi
     if test "$use_sdk" != "10.4"; then
       AC_MSG_ERROR(error in configure of --with-sdk=$use_sdk)
     fi
     CONFIG_SITE=" [config.site:config.site_osx.in]"
     MK_CONFIG_SITE=" [config.site.mk:config.site_osx.mk.in]"
     ;;
  ios)
     if test "$use_arch" != "arm7"; then
       AC_MSG_ERROR(error in configure of --with-arch=$use_arch)
     fi
     if test "$use_sdk" != "4.2"; then
       AC_MSG_ERROR(error in configure of --with-sdk=$use_sdk)
     fi
     CONFIG_SITE=" [config.site:config.site_ios.in]"
     MK_CONFIG_SITE=" [config.site.mk:config.site_ios.mk.in]"
     ;;
  *)
     AC_MSG_ERROR(error in configure of ($host))
esac

OUTPUT_FILES+=${CONFIG_SITE}
OUTPUT_FILES+=${MK_CONFIG_SITE}

use_toolchain=${use_staging}/toolchain
AC_MSG_RESULT(creating build toolchain at $use_toolchain)
mkdir -p ${use_toolchain}

AC_MSG_RESULT(creating tarball storage at $use_staging)
mkdir -p ${use_staging}/tarballs

use_prefix=${use_staging}/${use_darwin}-${use_sdk}_${use_arch}
AC_MSG_RESULT(creating hostroot at $use_staging)

AC_MSG_RESULT(creating hostroot dirs at $use_prefix)
mkdir -p ${use_prefix}/bin
mkdir -p ${use_prefix}/lib
mkdir -p ${use_prefix}/slib
mkdir -p ${use_prefix}/share
mkdir -p ${use_prefix}/share/aclocal
mkdir -p ${use_prefix}/include


AC_SUBST(use_toolchain)
AC_SUBST(use_staging)
AC_SUBST(use_prefix)
AC_SUBST(use_darwin)
AC_SUBST(use_arch)
AC_SUBST(use_sdk)

AC_CONFIG_FILES([${OUTPUT_FILES}])

AC_OUTPUT

AC_MSG_RESULT(setting up config.site files)
cp config.site ${use_prefix}/share/config.site