aboutsummaryrefslogtreecommitdiff
path: root/tools/darwin/depends/configure.in
blob: d755e00ce575b2213e6fbb184d5ea39b93ffb795 (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
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=missing])

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

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

OUTPUT_FILES="Makefile Makefile.include"
case $use_darwin in
  osx)
     use_arch="${use_arch:-i386}"
     use_sdk="${use_sdk:-10.4}"
     use_prefix=${use_staging}/${use_darwin}-${use_sdk}_${use_arch}
     if test "$use_arch" = "armv7"; then
       AC_MSG_ERROR(error in configure of --with-arch=$use_arch)
     fi
     case $use_sdk in
     10.*);;
     *)
       AC_MSG_ERROR(error in configure of --with-sdk=$use_sdk)
     esac
     CONFIG_SITE=" [config.site:config.site_osx.in]"
     MK_CONFIG_SITE=" [config.site.mk:config.site_osx.mk.in]"
     ;;
  ios)
     found_sdk=`xcodebuild -showsdks | grep iphoneos | sort | tail -n 1 | awk '{ print $2}'`
     use_arch="${use_arch:-armv7}"
     use_sdk="${use_sdk:-$found_sdk}"
     # this is an issue. if we set prefix according to ${use_sdk}_${use_arch}, 
     # then XBMC_DEPENDS prefix location in xcode must match but xcode uses its
     # own defines for build. So just hardcode to 4.2_${use_arch} for now until we
     # can figure out a better way.
     use_prefix=${use_staging}/${use_darwin}-4.2_${use_arch}
     if test "$use_arch" != "armv7"; then
       AC_MSG_ERROR(error in configure of --with-arch=$use_arch)
     fi
     case $use_sdk in
     4.*);;
     *)
       AC_MSG_ERROR(error in configure of --with-sdk=$use_sdk)
     esac
     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, missing or incorrect --with-darwin arg])
     ;;
esac

AC_MSG_RESULT(configuring for darwin $use_darwin-$use_sdk-$use_arch)
AC_MSG_RESULT(creating hostroot at $use_staging)

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/tarballs)
mkdir -p ${use_staging}/tarballs

AC_MSG_RESULT(creating hostroot directories 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

AC_MSG_RESULT(setting up python26 Makefile)
cp python26/Makefile.${use_darwin} python26/Makefile