Changeset 117621


Ignore:
Timestamp:
Mar 5, 2014, 10:19:14 PM (6 years ago)
Author:
cal@…
Message:

macports: use a local copy of Tcl 8.5, mostly fix out-of-source build (#28001)

This change switches MacPorts to a private copy of Tcl 8.5 that will be extracted, configured, built
and installed along with MacPorts. This will allow us to drop Tcl 8.4-compatibility for older OS
releases that didn't ship Tcl 8.5 and is an important step towards Tcl 8.6 compatibility.

Most of the changes to make this happen were in aclocal.m4 (where I re-implemented a custom version
of AC_CONFIG_SUBDIRS similar to what was proposed upstream in
http://lists.gnu.org/archive/html/autoconf/2011-04/msg00000.html but never actually merged),
configure.ac and the vendor directory.

Since we want to build MacPorts against the headers of our custom Tcl, this change also required
adjusting Mk/macports.autoconf.mk.in to pass the correct path to the headers. However, we cannot use
the build directory containing the public headers, because this directory is also clobbered with
other headers such as regex.h, breaking the build later on when this file is included in pextlib1.0.
Fortunately, the Tcl autoconf macros take care of all the other details required to build against
a private Tcl.

Not having the blessed copy of Tcl around during configure lead to some other difficulties such as
the MP_TCL_PLATFORM macro, which uses $TCLSH to read the $tcl_platform variable. I have
re-implemented this as MP_PLATFORM using uname in the same way as the $tcl_platform variable is set
up in the Tcl source code.

Besides a standard Tcl distribution, this change also installs the Tcl Thread package (required for
trace mode) and Tcllib, a package containing various helpful modules for Tcl (such as an
8.6-compatible try implementation). It also drops support for the Tcl sqlite3 extension that is
present on OS X and was previously picked up by configure, but isn't used in the source.

While I was refactoring the build system I also mostly fixed out-of-source builds (see #28001,
caused all Makefile -> Makefile.in moves). The remaining issue is that the pkgIndex.tcl files
generated by pkg_mkIndex only list the files present in the build directory (i.e. all files that
have been re-inplaced or built from source), but not those from the source directory. That currently
causes the Tcl scripts in the install target to fail.

I also unified indentation in aclocal.m4.

Location:
trunk/base
Files:
5 added
2 deleted
16 edited
10 moved

Legend:

Unmodified
Added
Removed
  • trunk/base/Makefile.in

    r117407 r117621  
    11# $Id$
    22
     3srcdir      = @srcdir@
     4VPATH       = @srcdir@
     5
    36PATH            = @PATH_CLEANED@
    4 SUBDIR          = doc src tests
     7SUBDIR          = vendor doc src tests
    58DISTDIR         = dist
    69DISTVER         =
     
    3033        fi
    3134
    32 include Mk/macports.subdir.mk
     35include $(srcdir)/Mk/macports.subdir.mk
    3336
    3437install::
     
    3639        $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} "$(DESTDIR)${datadir}/macports/"
    3740        $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 setupenv.bash  "$(DESTDIR)${datadir}/macports/"
    38         $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 macports-pubkey.pem  "$(DESTDIR)${datadir}/macports/"
     41        $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 $(srcdir)/macports-pubkey.pem  "$(DESTDIR)${datadir}/macports/"
    3942# Only run these scripts when not building in a destroot
    4043ifeq ($(DESTDIR),)
     
    9295    fi
    9396# Add [default] tag to the central MacPorts repository, if it isn't already
    94         $(TCLSH) src/upgrade_sources_conf_default.tcl "${prefix}"
     97        $(TCLSH) $(srcdir)/src/upgrade_sources_conf_default.tcl "${prefix}"
    9598# Convert image directories (and direct mode installs) to image archives
    96         $(TCLSH) src/images_to_archives.tcl "${macports_tcl_dir}"
    97         $(TCLSH) src/dedup_portfiles.tcl "${macports_tcl_dir}"
     99        $(TCLSH) $(srcdir)/src/images_to_archives.tcl "${macports_tcl_dir}"
     100        $(TCLSH) $(srcdir)/src/dedup_portfiles.tcl "${macports_tcl_dir}"
    98101endif
    99102ifndef SELFUPDATING
  • trunk/base/Mk/macports.autoconf.mk.in

    r111491 r117621  
    11# $Id$
     2# vim:ts=8:noet:sts=8:sw=8
    23
    34SHELL                   = @SHELL@
    4 
    5 
    6 srcdir                  = @srcdir@
    7 VPATH                   = @srcdir@
    85
    96CC                      = @CC@
    107CFLAGS                  = @CFLAGS@ -std=c99 $(CFLAGS_QUICHEEATERS) $(CFLAGS_PEDANTIC) $(CFLAGS_WERROR)
    118OBJCFLAGS               = @OBJCFLAGS@ $(CFLAGS_QUICHEEATERS) $(CFLAGS_PEDANTIC) $(CFLAGS_WERROR)
    12 CPPFLAGS                = @CPPFLAGS@ @DEFS@ @INCLUDES@ @TCL_INCLUDES@
    13 TCL_DEFS                = @TCL_DEFS@
    14 SHLIB_CFLAGS            = @SHLIB_CFLAGS@
     9CPPFLAGS                = @CPPFLAGS@ @DEFS@ -I@abs_top_builddir@/src -I@abs_top_srcdir@/src -I. -I@abs_top_builddir@/@VENDOR_DESTROOT@/@TCL_PREFIX@/include
    1510CFLAGS_QUICHEEATERS     = @CFLAGS_QUICHEEATERS@
    1611CFLAGS_PEDANTIC         = @CFLAGS_PEDANTIC@
     
    3328OBJC_FOUNDATION_LIBS            = @OBJC_FOUNDATION_LIBS@
    3429
    35 TCL_CC                  = @TCL_CC@
     30LDFLAGS                 = @LDFLAGS@
    3631SHLIB_LD                = @SHLIB_LD@
    3732STLIB_LD                = @STLIB_LD@
    38 LDFLAGS                 = @LDFLAGS@
    39 SHLIB_LDFLAGS           = @SHLIB_LDFLAGS@ ${LDFLAGS}
     33SHLIB_CFLAGS            = @SHLIB_CFLAGS@
     34SHLIB_LDFLAGS           = @LDFLAGS@
    4035SHLIB_SUFFIX            = @SHLIB_SUFFIX@
    4136TCL_STUB_LIB_SPEC       = @TCL_STUB_LIB_SPEC@
     
    5247BZIP2                   = @BZIP2@
    5348
     49INTREE_TCLSH            = @INTREE_TCLSH@
    5450TCLSH                   = @TCLSH@
    55 TCL_PACKAGE_DIR         = @TCL_PACKAGE_DIR@
     51TCL_PACKAGE_PATH        = @TCL_PACKAGE_PATH@
    5652macports_tcl_dir        = @macports_tcl_dir@
    5753
  • trunk/base/aclocal.m4

    r117520 r117621  
    33builtin(include,m4/pthread.m4)
    44builtin(include,m4/foundation.m4)
     5
     6dnl Search for a variable in a list. Run ACTION-IF-FOUND if it is in the list,
     7dnl ACTION-IF-NOT-FOUND otherwise.
     8dnl
     9dnl Parameters:
     10dnl  - The name of the list.
     11dnl  - The name of the variable that should be searched in the list.
     12dnl  - An optional action to be run if found
     13dnl  - An optional action to be run if not found
     14dnl
     15dnl _MP_LIST_CONTAINS_QUOTED([listname], [varname], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
     16AC_DEFUN([_MP_LIST_CONTAINS], [dnl
     17        mp_list_contains_present=
     18        eval "mp_list_contains_list=\"$$1\""
     19        for mp_list_contains_entry in $mp_list_contains_list; do
     20                test -z "$mp_list_contains_entry" && continue
     21                if test "x$$2" = "x$mp_list_contains_entry"; then
     22                        mp_list_contains_present=1
     23                        break
     24                fi
     25        done
     26        if test "x$mp_list_contains_present" = "x"; then
     27                m4_ifvaln([$3], [$3], [:])dnl
     28                m4_ifvaln([$4], [else $4])dnl
     29        fi
     30])
     31
     32dnl Quote a variable and prepend it to a list.
     33dnl
     34dnl Parameters:
     35dnl  - The name of the list.
     36dnl  - The name of the variable that should be quoted and prepended to the
     37dnl    list.
     38AC_DEFUN([_MP_LIST_PREPEND_QUOTED], [dnl
     39        _MP_QUOTE([$2])
     40        _MP_VAR_PREPEND([$1], ["$$2 "])
     41])
     42
     43
     44dnl Quote a variable and append it to a list.
     45dnl
     46dnl Parameters:
     47dnl  - The name of the list.
     48dnl  - The name of the variable that should be quoted and appended to the list.
     49AC_DEFUN([_MP_LIST_APPEND_QUOTED], [dnl
     50        _MP_QUOTE([$2])
     51        AS_VAR_APPEND([$1], [" $$2"])
     52])
     53
     54dnl Prepend the shell expansion of a value to a variable.
     55dnl
     56dnl Parameters:
     57dnl  - The name of the variable to which the second argument should be
     58dnl    prepended.
     59dnl  - The value that should be expanded using the shell expansion rules and
     60dnl    prepended to the variable given in the first argument.
     61AC_DEFUN([_MP_VAR_PREPEND], [dnl
     62        AC_REQUIRE([_MP_VAR_PREPEND_PREPARE])dnl
     63        mp_fn_var_prepend $1 $2
     64])
     65
     66dnl Define the function required for _MP_VAR_PREPEND
     67AC_DEFUN([_MP_VAR_PREPEND_PREPARE], [dnl
     68        mp_fn_var_prepend() {
     69                eval "$[]1=\"$[]2\$$[]1\""
     70        }
     71])
     72
     73dnl Quote a variable in single quotes (escaping any existing single quotes) and
     74dnl store it in itself.
     75dnl
     76dnl Parameters:
     77dnl  - The name of the variable that should be quoted using single quotes.
     78AC_DEFUN([_MP_QUOTE], [dnl
     79        case $$1 in
     80                *\'*)
     81                        $1=$(AS_ECHO(["$$1"]) | sed "s/'/'\\\\\\\\''/g")
     82                ;;
     83        esac
     84        $1="'$$1'"dnl
     85])
     86
     87
     88dnl Extract the key part of a key-value pair given as string in the form
     89dnl  --key=value or
     90dnl   -key=value
     91dnl
     92dnl Parameters:
     93dnl  - The variable name to assign to
     94dnl  - The (quoted, if necessary) key-value pair
     95AC_DEFUN([_MP_EXTRACT_KEY], [dnl
     96        $1=$(AS_ECHO([$2]) | sed -E 's/^--?([^=]+)=.*$/\1/')dnl
     97])
     98
     99dnl Configure a project contained in a .tar.gz (or .tgz) tarball, extracting it
     100dnl previously, if necessary. Different from AC_CONFIG_SUBDIRS (on which this
     101dnl macro is based), you can pass parameters to the sub-configure script.
     102dnl
     103dnl Parameters:
     104dnl  - The relative path to the tarball
     105dnl  - The relative path to the directory that will be extracted from the
     106dnl    tarball and contains the configure script to be run (can be a sub directory of the extracted directory)
     107dnl  - Parameters to pass to the configure script
     108dnl
     109dnl MP_CONFIG_TARBALL([path-to-tarball], [dir-extracted-from-tarball-with-configure], [configure-parameters])
     110AC_DEFUN([MP_CONFIG_TARBALL], [
     111        mp_tarball="$1"
     112        ac_dir=$2
     113
     114        if test "$no_recursion" != yes; then
     115                mp_popdir=$(pwd)
     116                if ! test -d "$ac_dir"; then
     117                        mp_tarball_vendordir="$(dirname "$mp_tarball")"
     118                        AS_MKDIR_P(["$mp_tarball_vendordir"])
     119                        AC_MSG_NOTICE([=== extracting $mp_tarball])
     120                        (cd "$mp_tarball_vendordir"; gzip -d < "$ac_abs_confdir/$mp_tarball" | tar xf - || AC_MSG_ERROR([failed to extract $mp_tarball]))
     121                fi
     122                if ! test -d "$ac_dir"; then
     123                        AC_MSG_ERROR([tarball $mp_tarball did not extract to $ac_dir])
     124                fi
     125       
     126                AC_MSG_NOTICE([=== configuring in $ac_dir ($mp_popdir/$ac_dir)])
     127                AS_MKDIR_P(["$ac_dir"])
     128                _AC_SRCDIRS(["$ac_dir"])
     129                cd "$ac_dir"
     130                if test -f "$ac_srcdir/configure"; then
     131                        mp_sub_configure_args=
     132                        mp_sub_configure_keys=
     133                        # Compile a list of keys that have been given to the MP_CONFIG_TARBALL
     134                        # macro; we want to skip copying those parameters from the original
     135                        # configure invocation.
     136                        for mp_arg in $3; do
     137                                case $mp_arg in
     138                                        --*=* | -*=*)
     139                                                _MP_EXTRACT_KEY([mp_arg_key], ["$mp_arg"])
     140                                                _MP_LIST_APPEND_QUOTED([mp_sub_configure_keys], [mp_arg_key])
     141                                        ;;
     142                                esac
     143                                _MP_LIST_APPEND_QUOTED([mp_sub_configure_args], [mp_arg])
     144                        done
     145                        # Walk the list of arguments given to the original configure script;
     146                        # filter out a few common ones we likely would not want to pass along,
     147                        # add --disable-option-checking and filter those already given as
     148                        # argument to MP_CONFIG_TARBALL.
     149                        # Most of this code is adapted from _AC_OUTPUT_SUBDIRS in
     150                        # $prefix/share/autoconf/autoconf/status.m4.
     151                        mp_prev=
     152                        eval "set x $ac_configure_args"
     153                        shift
     154                        for mp_arg; do
     155                                if test -n "$mp_prev"; then
     156                                        mp_prev=
     157                                        continue
     158                                fi
     159                                case $mp_arg in
     160                                          -cache-file \
     161                                        | --cache-file \
     162                                        | --cache-fil \
     163                                        | --cache-fi \
     164                                        | --cache-f \
     165                                        | --cache- \
     166                                        | --cache \
     167                                        | --cach \
     168                                        | --cac \
     169                                        | --ca \
     170                                        | --c)
     171                                                mp_prev=cache_file
     172                                        ;;
     173                                          -cache-file=* \
     174                                        | --cache-file=* \
     175                                        | --cache-fil=* \
     176                                        | --cache-fi=* \
     177                                        | --cache-f=* \
     178                                        | --cache-=* \
     179                                        | --cache=* \
     180                                        | --cach=* \
     181                                        | --cac=* \
     182                                        | --ca=* \
     183                                        | --c=*)
     184                                                # ignore --cache-file
     185                                        ;;
     186                                          --config-cache \
     187                                        | -C)
     188                                                # ignore -C
     189                                        ;;
     190                                          -srcdir \
     191                                        | --srcdir \
     192                                        | -srcdi \
     193                                        | -srcd \
     194                                        | -src \
     195                                        | -sr)
     196                                                mp_prev=srcdir
     197                                        ;;
     198                                          -srcdir=* \
     199                                        | --srcdir=* \
     200                                        | --srcdi=* \
     201                                        | --srcd=* \
     202                                        | --src=* \
     203                                        | --sr=*)
     204                                                # ignore --srcdir
     205                                        ;;
     206                                          -prefix \
     207                                        | --prefix \
     208                                        | --prefi \
     209                                        | --pref \
     210                                        | --pre \
     211                                        | --pr \
     212                                        | --p)
     213                                                mp_prev=prefix
     214                                        ;;
     215                                          -prefix=* \
     216                                        | --prefix=* \
     217                                        | --prefi=* \
     218                                        | --pref=* \
     219                                        | --pre=* \
     220                                        | --pr=* \
     221                                        | --p=*)
     222                                                # ignore --prefix
     223                                        ;;
     224                                        --disable-option-checking)
     225                                                # ignore --disable-option-checking
     226                                        ;;
     227                                        --*=* | -*=*)
     228                                                _MP_EXTRACT_KEY([mp_arg_key], ["$mp_arg"])
     229                                                _MP_LIST_CONTAINS([mp_sub_configure_keys], [mp_arg_key], [], [
     230                                                        _MP_LIST_APPEND_QUOTED([mp_sub_configure_args], [mp_arg])
     231                                                ])
     232                                        ;;
     233                                        *)
     234                                                # always pass positional arguments
     235                                                _MP_LIST_APPEND_QUOTED([mp_sub_configure_args], [mp_arg])
     236                                        ;;
     237                                esac
     238                        done
     239
     240                        # Now prepend some arguments that should always be present unless
     241                        # overriden, such as --prefix, --silent, --disable-option-checking,
     242                        # --cache-file, --srcdir
     243                        # Pass --prefix unless already given
     244                        mp_arg_key=prefix
     245                        _MP_LIST_CONTAINS([mp_sub_configure_args], [mp_arg_key], [], [
     246                                mp_arg="--prefix=$prefix"
     247                                _MP_LIST_PREPEND_QUOTED([mp_sub_configure_args], [mp_arg])
     248                        ])
     249
     250                        # Pass --silent
     251                        if test "$silent" = yes; then
     252                                mp_arg="--silent"
     253                                _MP_LIST_PREPEND_QUOTED([mp_sub_configure_args], [mp_arg])
     254                        fi
     255
     256                        # Always prepend --disable-option-checking to silence warnings, since
     257                        # different subdirs can have different --enable and --with options.
     258                        mp_arg="--disable-option-checking"
     259                        _MP_LIST_PREPEND_QUOTED([mp_sub_configure_args], [mp_arg])
     260
     261                        # Make the cache file name correct relative to the subdirectory.
     262                        case $cache_file in
     263                                [[\\/]]* | ?:[[\\/]]* )
     264                                        mp_sub_cache_file=$cache_file
     265                                ;;
     266                                *) # Relative name.
     267                                        mp_sub_cache_file=$ac_top_build_prefix$cache_file
     268                                ;;
     269                        esac
     270                        mp_arg="--cache-file=$mp_sub_cache_file"
     271                        _MP_LIST_PREPEND_QUOTED([mp_sub_configure_args], [mp_arg])
     272
     273                        mp_arg="--srcdir=$ac_srcdir"
     274                        _MP_LIST_APPEND_QUOTED([mp_sub_configure_args], [mp_arg])
     275
     276                        AC_MSG_NOTICE([running $SHELL $ac_srcdir/configure $mp_sub_configure_args in $ac_dir])
     277                        eval "\$SHELL \$ac_srcdir/configure $mp_sub_configure_args" || AC_MSG_ERROR([configure failed for $ac_dir])
     278                else
     279                        AC_MSG_ERROR([no configure script found in $ac_dir])
     280                fi
     281                AC_MSG_NOTICE([=== finished configuring in $ac_dir ($mp_popdir/$ac_dir)])
     282
     283                cd "$mp_popdir"
     284        fi
     285])
     286
    5287
    6288#------------------------------------------------------------------------
     
    310592        dnl use current user and group.
    311593        dnl use ~/Library/Tcl as Tcl package directory
    312                 AC_REQUIRE([MP_PATH_MPCONFIGDIR])
     594        AC_REQUIRE([MP_PATH_MPCONFIGDIR])
    313595
    314596        AC_ARG_WITH(no-root-privileges, [AS_HELP_STRING([--with-no-root-privileges],[Specify that MacPorts should be installed in your home directory])], [ROOTPRIVS=$withval] )
    315597
    316598        if test "${ROOTPRIVS+set}" = set; then
    317 
    318599                # Set install-user to current user
    319600                AC_MSG_CHECKING([for install user])
     
    321602                AC_MSG_RESULT([$DSTUSR])
    322603                AC_SUBST(DSTUSR)
    323                
     604
    324605                # Set install-group to current user
    325606                AC_MSG_CHECKING([for install group])
     
    333614                AC_MSG_RESULT([$RUNUSR])
    334615                AC_SUBST(RUNUSR)
    335 
    336                 # Set Tcl package directory to ~/Library/Tcl
    337             AC_MSG_CHECKING(for Tcl package directory)
    338                 ac_cv_c_tclpkgd=`eval echo ~$DSTUSR/Library/Tcl`
    339             # Convert to a native path and substitute into the output files.
    340             PACKAGE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclpkgd}`
    341             TCL_PACKAGE_DIR=${PACKAGE_DIR_NATIVE}
    342             AC_SUBST(TCL_PACKAGE_DIR)
    343                 if test x"${ac_cv_c_tclpkgd}" = x ; then
    344                         AC_MSG_ERROR(Tcl package directory not found.  Please specify its location with --with-tclpackage)
    345             else
    346                         AC_MSG_RESULT(${ac_cv_c_tclpkgd})
    347             fi
    348616        fi
    349617
     
    355623        dnl if with user specifies --with-macports-user,
    356624        dnl use it. otherwise default to platform defaults
    357        AC_REQUIRE([MP_PATH_MPCONFIGDIR])
     625        AC_REQUIRE([MP_PATH_MPCONFIGDIR])
    358626
    359627        AC_ARG_WITH(macports-user, [AS_HELP_STRING([--with-macports-user=USER],[Specify user to drop privileges to, if possible, during compiles etc.])], [ RUNUSR=$withval ] )
     
    361629        AC_MSG_CHECKING([for macports user])
    362630        if test "x$RUNUSR" = "x" ; then
    363            RUNUSR=macports
     631                RUNUSR=macports
    364632        fi
    365633
     
    374642        dnl if with user specifies --with-shared-directory,
    375643        dnl use 0775 permissions for ${prefix} directories
    376         AC_REQUIRE([MP_PATH_MPCONFIGDIR])
     644        AC_REQUIRE([MP_PATH_MPCONFIGDIR])
    377645
    378646        AC_ARG_WITH(shared-directory, [AS_HELP_STRING([--with-shared-directory],[Use 0775 permissions for installed directories])], [ SHAREDIR=$withval ] )
     
    380648        if test "${SHAREDIR+set}" = set; then   
    381649                AC_MSG_CHECKING([whether to share the install directory with all members of the install group])
    382             DSTMODE=0775
     650                DSTMODE=0775
    383651
    384652                AC_MSG_RESULT([$DSTMODE])
     
    392660        dnl if with user specifies --with-install-user,
    393661        dnl use it. otherwise default to platform defaults
    394         AC_REQUIRE([MP_PATH_MPCONFIGDIR])
     662        AC_REQUIRE([MP_PATH_MPCONFIGDIR])
    395663
    396664        AC_ARG_WITH(install-user, [AS_HELP_STRING([--with-install-user=USER],[Specify user ownership of installed files])], [ DSTUSR=$withval ] )
     
    398666        AC_MSG_CHECKING([for install user])
    399667        if test "x$DSTUSR" = "x" ; then
    400            DSTUSR=root
     668                DSTUSR=root
    401669        fi
    402670
     
    410678        dnl if with user specifies --with-install-group,
    411679        dnl use it. otherwise default to platform defaults
    412         AC_REQUIRE([MP_CHECK_INSTALLUSER])
     680        AC_REQUIRE([MP_CHECK_INSTALLUSER])
    413681
    414682        AC_ARG_WITH(install-group, [AS_HELP_STRING([--with-install-group=GROUP],[Specify group ownership of installed files])], [ DSTGRP=$withval ] )
     
    416684        AC_MSG_CHECKING([for install group])
    417685        if test "x$DSTGRP" = "x" ; then
    418            
    419            case $host_os in
    420            darwin*)
    421                 DSTGRP="admin"
    422                 ;;
    423            freebsd*)
    424                 DSTGRP="wheel"
    425                 ;;
    426            linux*)
    427                 DSTGRP="root"
    428                 ;;
    429            *)
    430                 DSTGRP="wheel"
    431                 ;;
    432            esac
     686                case $host_os in
     687                        darwin*)
     688                                DSTGRP="admin"
     689                        ;;
     690                        freebsd*)
     691                                DSTGRP="wheel"
     692                        ;;
     693                        linux*)
     694                                DSTGRP="root"
     695                        ;;
     696                        *)
     697                                DSTGRP="wheel"
     698                        ;;
     699                esac
    433700        fi
    434701
     
    443710        dnl use the specified permissions for ${prefix} directories
    444711        dnl otherwise use 0755
    445         AC_REQUIRE([MP_PATH_MPCONFIGDIR])
     712        AC_REQUIRE([MP_PATH_MPCONFIGDIR])
    446713
    447714        AC_ARG_WITH(directory-mode, [AS_HELP_STRING([--with-directory-mode=MODE],[Specify directory mode of installed directories])], [ DSTMODE=$withval ] )
     
    449716        AC_MSG_CHECKING([what permissions to use for installation directories])
    450717        if test "x$DSTMODE" = "x" ; then
    451            DSTMODE=0755
     718                DSTMODE=0755
    452719        fi
    453720
     
    459726#---------------------------------------
    460727AC_DEFUN([MP_PATH_APPLICATIONS],[
    461         AC_REQUIRE([MP_CHECK_INSTALLUSER])
    462 
    463     AC_ARG_WITH(applications-dir,[AS_HELP_STRING([--with-applications-dir],[Applications installation directory.])], MPAPPLICATIONSDIR=${withval})
    464 
    465     oldprefix=$prefix
    466     if test "x$prefix" = "xNONE" ; then
    467         prefix=$ac_default_prefix
    468     fi
    469     AC_MSG_CHECKING([for Applications installation directory])
     728        AC_REQUIRE([MP_CHECK_INSTALLUSER])
     729
     730        AC_ARG_WITH(applications-dir,[AS_HELP_STRING([--with-applications-dir],[Applications installation directory.])], MPAPPLICATIONSDIR=${withval})
     731
     732        oldprefix=$prefix
     733        if test "x$prefix" = "xNONE" ; then
     734                prefix=$ac_default_prefix
     735        fi
     736        AC_MSG_CHECKING([for Applications installation directory])
    470737
    471738        if test "x$MPAPPLICATIONSDIR" = "x" ; then
    472             if test "$DSTUSR" = "root" ; then
    473                 MPAPPLICATIONSDIR="/Applications/MacPorts"
    474             else
    475                 MPAPPLICATIONSDIR="$(eval echo ~$DSTUSR)/Applications/MacPorts"
    476             fi
     739                if test "$DSTUSR" = "root" ; then
     740                        MPAPPLICATIONSDIR="/Applications/MacPorts"
     741                else
     742                        MPAPPLICATIONSDIR="$(eval echo ~$DSTUSR)/Applications/MacPorts"
     743                fi
    477744        fi
    478745
    479746        AC_MSG_RESULT([$MPAPPLICATIONSDIR])
    480     AC_SUBST(MPAPPLICATIONSDIR)
    481     prefix=$oldprefix
     747        AC_SUBST(MPAPPLICATIONSDIR)
     748        prefix=$oldprefix
    482749])
    483750
     
    485752#---------------------------------------
    486753AC_DEFUN([MP_PATH_FRAMEWORKS],[
    487         AC_REQUIRE([MP_CHECK_INSTALLUSER])
    488 
    489     AC_ARG_WITH(frameworks-dir,[AS_HELP_STRING([--with-frameworks-dir],[Frameworks installation directory.])], MPFRAMEWORKSDIR=${withval})
    490 
    491     oldprefix=$prefix
    492     if test "x$prefix" = "xNONE" ; then
    493         prefix=$ac_default_prefix
    494     fi
    495     AC_MSG_CHECKING([for Frameworks installation directory])
     754        AC_REQUIRE([MP_CHECK_INSTALLUSER])
     755
     756        AC_ARG_WITH(frameworks-dir,[AS_HELP_STRING([--with-frameworks-dir],[Frameworks installation directory.])], MPFRAMEWORKSDIR=${withval})
     757
     758        oldprefix=$prefix
     759        if test "x$prefix" = "xNONE" ; then
     760                prefix=$ac_default_prefix
     761        fi
     762        AC_MSG_CHECKING([for Frameworks installation directory])
    496763
    497764        if test "x$MPFRAMEWORKSDIR" = "x" ; then
     
    500767
    501768        AC_MSG_RESULT([$MPFRAMEWORKSDIR])
    502     AC_SUBST(MPFRAMEWORKSDIR)
    503     prefix=$oldprefix
    504 ])
    505 
     769        AC_SUBST(MPFRAMEWORKSDIR)
     770        prefix=$oldprefix
     771])
    506772
    507773# MP_UNIVERSAL_OPTIONS
    508774#---------------------------------------
    509775AC_DEFUN([MP_UNIVERSAL_OPTIONS],[
    510   AC_ARG_WITH(universal-archs,[AS_HELP_STRING([--with-universal-archs="CPU"],[Universal CPU architectures (space separated)])], UNIVERSAL_ARCHS=${withval})
    511 
    512   if test "x$UNIVERSAL_ARCHS" = "x"; then
    513     case "$MACOSX_VERSION" in
    514       10.1[[0-9]]*)
    515         UNIVERSAL_ARCHS="x86_64 i386"
    516         ;;
    517       10.[[0-5]]*)
    518         UNIVERSAL_ARCHS="i386 ppc"
    519         ;;
    520       *)
    521         UNIVERSAL_ARCHS="x86_64 i386"
    522         ;;
    523     esac
    524   fi
    525 
    526   UNIVERSAL_ARCHFLAGS=
    527   for arch in $UNIVERSAL_ARCHS; do
    528     UNIVERSAL_ARCHFLAGS="$UNIVERSAL_ARCHFLAGS -arch $arch"
    529   done
    530 
    531   AC_MSG_CHECKING([for Universal CPU architectures])
    532   AC_MSG_RESULT([$UNIVERSAL_ARCHS])
    533   AC_SUBST(UNIVERSAL_ARCHS)
    534   AC_SUBST(UNIVERSAL_ARCHFLAGS)
     776        AC_ARG_WITH(universal-archs,[AS_HELP_STRING([--with-universal-archs="CPU"],[Universal CPU architectures (space separated)])], UNIVERSAL_ARCHS=${withval})
     777
     778        if test "x$UNIVERSAL_ARCHS" = "x"; then
     779                case "$MACOSX_VERSION" in
     780                        10.1[[0-9]]*)
     781                                UNIVERSAL_ARCHS="x86_64 i386"
     782                        ;;
     783                        10.[[0-5]]*)
     784                                UNIVERSAL_ARCHS="i386 ppc"
     785                        ;;
     786                        *)
     787                                UNIVERSAL_ARCHS="x86_64 i386"
     788                        ;;
     789                esac
     790        fi
     791
     792        UNIVERSAL_ARCHFLAGS=
     793        for arch in $UNIVERSAL_ARCHS; do
     794                UNIVERSAL_ARCHFLAGS="$UNIVERSAL_ARCHFLAGS -arch $arch"
     795        done
     796
     797        AC_MSG_CHECKING([for Universal CPU architectures])
     798        AC_MSG_RESULT([$UNIVERSAL_ARCHS])
     799        AC_SUBST(UNIVERSAL_ARCHS)
     800        AC_SUBST(UNIVERSAL_ARCHFLAGS)
    535801])
    536802
     
    539805# Check for an md5 implementation
    540806AC_DEFUN([MP_LIB_MD5],[
    541 
    542807        # Check for libmd from FreeBSD, which is preferred
    543808        AC_CHECK_LIB([md], [MD5File],[
     
    582847        AC_REQUIRE([MP_CHECK_FUNCTION_CFNOTIFICATIONCENTERGETDARWINNOTIFYCENTER])
    583848       
    584     AC_MSG_CHECKING(for whether we will build daemondo)
    585     result=no
     849        AC_MSG_CHECKING(for whether we will build daemondo)
     850        result=no
    586851        case $host_os in
    587         darwin*)
    588                 if test "x$mp_cv_have_framework_corefoundation" == "xyes" &&
    589                    test "x$mp_cv_have_framework_systemconfiguration" == "xyes" &&
    590                    test "x$mp_cv_have_framework_iokit" == "xyes" &&
    591                    test "x$mp_cv_have_function_cfnotificationcentergetdarwinnotifycenter" == "xyes"; then
    592                         result=yes
    593                         EXTRA_PROGS="$EXTRA_PROGS daemondo"
    594                         AC_CONFIG_FILES([src/programs/daemondo/Makefile])
    595                 fi
     852                darwin*)
     853                        if test "x$mp_cv_have_framework_corefoundation" == "xyes" &&
     854                           test "x$mp_cv_have_framework_systemconfiguration" == "xyes" &&
     855                           test "x$mp_cv_have_framework_iokit" == "xyes" &&
     856                           test "x$mp_cv_have_function_cfnotificationcentergetdarwinnotifycenter" == "xyes"; then
     857                                result=yes
     858                                EXTRA_PROGS="$EXTRA_PROGS daemondo"
     859                                AC_CONFIG_FILES([src/programs/daemondo/Makefile])
     860                        fi
    596861                ;;
    597         *)
     862                *)
    598863        esac
    599864        AC_MSG_RESULT(${result})
    600 ])
    601 
    602 #------------------------------------------------------------------------
    603 # MP_TCL_PACKAGE_DIR --
    604 #
    605 #       Locate the correct directory for Tcl package installation
    606 #
    607 # Arguments:
    608 #       None.
    609 #
    610 # Requires:
    611 #       TCLVERSION must be set
    612 #       CYGPATH must be set
    613 #       TCLSH must be set
    614 #
    615 # Results:
    616 #
    617 #       Adds a --with-tclpackage switch to configure.
    618 #       Result is cached.
    619 #
    620 #       Substs the following vars:
    621 #               TCL_PACKAGE_DIR
    622 #------------------------------------------------------------------------
    623 
    624 AC_DEFUN(MP_TCL_PACKAGE_DIR, [
    625         AC_REQUIRE([MP_CHECK_INSTALLUSER])
    626 
    627     AC_MSG_CHECKING(for Tcl package directory)
    628 
    629     AC_ARG_WITH(tclpackage, [  --with-tclpackage       Tcl package installation directory.], with_tclpackagedir=${withval})
    630 
    631     if test x"${with_tclpackagedir}" != x ; then
    632         ac_cv_c_tclpkgd=${with_tclpackagedir}
    633     else
    634         AC_CACHE_VAL(ac_cv_c_tclpkgd, [
    635             # Use the value from --with-tclpackage, if it was given
    636 
    637             if test x"${with_tclpackagedir}" != x ; then
    638                 echo "tclpackagedir"
    639                 ac_cv_c_tclpkgd=${with_tclpackagedir}
    640             else
    641                 # On darwin we can do some intelligent guessing
    642                 case $host_os in
    643                     darwin*)
    644                         tcl_autopath=`echo 'puts -nonewline \$auto_path' | $TCLSH`
    645                         for path in $tcl_autopath; do
    646                         if test "$DSTUSR" = "root" ; then
    647                             if test "$path" = "/Library/Tcl"; then
    648                                 ac_cv_c_tclpkgd="$path"
    649                                 break
    650                             fi
    651                             if test "$path" = "/System/Library/Tcl"; then
    652                                 if test -d "$path"; then
    653                                     ac_cv_c_tclpkgd="$path"
    654                                     break
    655                                 fi
    656                             fi
    657                         elif test "$path" = "~/Library/Tcl"; then
    658                             ac_cv_c_tclpkgd=`eval echo ~$DSTUSR/Library/Tcl`
    659                             break
    660                         fi
    661                         done
    662                     ;;
    663                 esac
    664                 if test x"${ac_cv_c_tclpkgd}" = x ; then
    665                     # Fudge a path from the first entry in the auto_path
    666                     tcl_pkgpath=`echo 'puts -nonewline [[lindex \$auto_path 0]]' | $TCLSH`
    667                     if test -d "$tcl_pkgpath"; then
    668                         ac_cv_c_tclpkgd="$tcl_pkgpath"
    669                     fi
    670                     # If the first entry does not exist, do nothing
    671                 fi
    672             fi
    673         ])
    674     fi
    675 
    676     if test x"${ac_cv_c_tclpkgd}" = x ; then
    677         AC_MSG_ERROR(Tcl package directory not found.  Please specify its location with --with-tclpackage)
    678     else
    679         AC_MSG_RESULT(${ac_cv_c_tclpkgd})
    680     fi
    681 
    682     # Convert to a native path and substitute into the output files.
    683 
    684     PACKAGE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclpkgd}`
    685 
    686     TCL_PACKAGE_DIR=${PACKAGE_DIR_NATIVE}
    687 
    688     AC_SUBST(TCL_PACKAGE_DIR)
    689 ])
    690 
    691 # MP_PROG_TCLSH
    692 #---------------------------------------
    693 AC_DEFUN([MP_PROG_TCLSH],[
    694 
    695 
    696         case $host_os in
    697                 freebsd*)
    698                         # FreeBSD installs a dummy tclsh (annoying)
    699                         # Look for a real versioned tclsh with threads first
    700                         # Look for a real versioned tclsh without threads second
    701                         AC_PATH_PROG([TCLSH], [tclsh${TCL_VERSION}-threads tclsh${TCL_VERSION} tclsh])
    702                         ;;
    703                 *)
    704                         # Otherwise, look for a non-versioned tclsh
    705                         AC_PATH_PROG([TCLSH], [tclsh tclsh${TCL_VERSION}])
    706                         ;;
    707         esac
    708         if test "x$TCLSH" = "x" ; then
    709                 AC_MSG_ERROR([Could not find tclsh])
    710         fi
    711 
    712         AC_SUBST(TCLSH)
    713 ])
    714 
    715 # MP_TCL_PACKAGE
    716 #       Determine if a Tcl package is present.
    717 #
    718 # Arguments:
    719 #       Package name (may include the version)
    720 #
    721 # Syntax:
    722 #   MP_TCL_PACKAGE (package, [action-if-found], [action-if-not-found])
    723 #
    724 # Requires:
    725 #       TCLSH must be set
    726 #
    727 # Results:
    728 #       Execute action-if-found or action-if-not-found
    729 #---------------------------------------
    730 AC_DEFUN([MP_TCL_PACKAGE],[
    731         AC_MSG_CHECKING([for Tcl $1 package])
    732         package_present=`echo 'if {[[catch {package require $1}]]} {puts -nonewline 0} else {puts -nonewline 1}' | $TCLSH`
    733         AS_IF([test "$package_present" = "1"], [$2], [$3])[]
    734 ])
    735 
    736 # MP_TCL_THREAD_SUPPORT
    737 #       Determine if thread support is available in tclsh.
    738 #
    739 # Arguments:
    740 #       None.
    741 #
    742 # Requires:
    743 #       TCLSH must be set
    744 #
    745 # Results:
    746 #   Fails if thread support isn't available.
    747 #---------------------------------------
    748 AC_DEFUN([MP_TCL_THREAD_SUPPORT],[
    749         AC_MSG_CHECKING([whether tclsh was compiled with threads])
    750         tcl_threadenabled=`echo 'puts -nonewline [[info exists tcl_platform(threaded)]]' | $TCLSH`
    751         if test "$tcl_threadenabled" = "1" ; then
    752                 AC_MSG_RESULT([yes])
    753         else
    754                 AC_MSG_RESULT([no])
    755                 AC_MSG_ERROR([tcl wasn't compiled with threads enabled])
    756         fi
    757865])
    758866
     
    842950        fi
    843951
    844     # check if we have sqlite3ext.h, using the appropriate cppflags
    845     CPPFLAGS_OLD="${CPPFLAGS}"
    846     CPPFLAGS="${CPPFLAGS} ${CFLAGS_SQLITE3}"
    847     AC_CHECK_HEADERS(sqlite3ext.h)
    848     CPPFLAGS="${CPPFLAGS_OLD}"
     952        # check if we have sqlite3ext.h, using the appropriate cppflags
     953        CPPFLAGS_OLD="${CPPFLAGS}"
     954        CPPFLAGS="${CPPFLAGS} ${CFLAGS_SQLITE3}"
     955        AC_CHECK_HEADERS(sqlite3ext.h)
     956        CPPFLAGS="${CPPFLAGS_OLD}"
    849957
    850958        AC_SUBST(CFLAGS_SQLITE3)
    851959        AC_SUBST(LDFLAGS_SQLITE3)
    852 
    853         # now the sqlite Tcl bindings
    854         AC_ARG_WITH(tcl-sqlite3,
    855                 AS_HELP_STRING([--with-tcl-sqlite3=DIR],
    856                         [directory for Tcl sqlite3 (default /usr/lib/sqlite3)]),
    857                 [mp_sqlite3_dir=$withval])
    858 
    859     if test "x$mp_sqlite3_dir" = "x"; then
    860         case $host_os in
    861             darwin*)
    862                 mp_sqlite3_dir="/usr/lib/sqlite3"
    863                 ;;
    864             freebsd*)
    865                 mp_sqlite3_dir="/usr/local/lib/sqlite"
    866                 ;;
    867             *)
    868                 mp_sqlite3_dir="/usr/share/tcl${TCL_VERSION}/sqlite3"
    869                 ;;
    870         esac
    871     fi
    872 
    873         AC_CACHE_CHECK([for Tcl sqlite3 location], [mp_cv_sqlite3_dir],
    874                 [mp_cv_sqlite3_dir=
    875                 test -r "${mp_sqlite3_dir}/pkgIndex.tcl" && mp_cv_sqlite3_dir=$mp_sqlite3_dir
    876                 ])
    877 
    878         SQLITE3_TCL_DIR=$mp_cv_sqlite3_dir
    879         AC_SUBST(SQLITE3_TCL_DIR)
    880960])
    881961
     
    11521232
    11531233#------------------------------------------------------------------------
    1154 # MP_TCL_PLATFORM --
     1234# MP_PLATFORM --
    11551235#
    11561236#       Export target platform and major version
     
    11601240#
    11611241# Requires:
    1162 #       TCLSH must be set.
     1242#       none.
    11631243#
    11641244# Depends:
     
    11691249#
    11701250#------------------------------------------------------------------------
    1171 AC_DEFUN([MP_TCL_PLATFORM],[
    1172         AC_MSG_CHECKING([for Tcl target platform])
    1173         OS_PLATFORM=`echo 'puts -nonewline [[string tolower \$tcl_platform(os)]]' | $TCLSH`
    1174         OS_MAJOR=`echo 'puts -nonewline [[lindex [split \$tcl_platform(osVersion) .] 0]]' | $TCLSH`
     1251AC_DEFUN([MP_PLATFORM],[
     1252        AC_MSG_CHECKING([for target platform])
     1253        OS_PLATFORM=`uname -s | tr '[[:upper:]]' '[[:lower:]]'`
     1254                OS_MAJOR=`uname -r | cut -d '.' -f 1`
    11751255        AC_MSG_RESULT($OS_PLATFORM $OS_MAJOR)
    11761256        AC_SUBST(OS_PLATFORM)
     
    11871267#
    11881268# Requires:
    1189 #       OS_PLATOFRM and OS_MAJOR from MP_TCL_PLATFORM.
     1269#       OS_PLATOFRM and OS_MAJOR from MP_PLATFORM.
    11901270#
    11911271# Depends:
     
    11981278#------------------------------------------------------------------------
    11991279AC_DEFUN([MP_TRACEMODE_SUPPORT],[
    1200                 AC_REQUIRE([MP_TCL_PLATFORM])
     1280                AC_REQUIRE([MP_PLATFORM])
    12011281
    12021282                AC_CHECK_FUNCS([kqueue kevent])
  • trunk/base/configure.ac

    r117520 r117621  
    242242        sys/paths.h sys/socket.h sys/sysctl.h utime.h])
    243243
    244 INCLUDES="-I.. -I. $INCLUDES"
    245 
    246244# Checks for library functions.
    247245AC_CHECK_FUNCS([OSAtomicCompareAndSwap32 OSAtomicCompareAndSwap64 OSAtomicCompareAndSwapPtr bzero \
     
    276274AC_DEFINE([MIN_USABLE_GID], [500], [Lowest non-system-reserved GID.])
    277275
    278 # Load tclConfig.sh
    279 SC_PATH_TCLCONFIG
    280 SC_LOAD_TCLCONFIG
    281 
    282 # Check for Tcl public headers
    283 dnl XXX  hardwire CYGPATH (CYGPATH must be set for SC_PUBLIC_TCL_HEADERS)
    284 CYGPATH=echo
    285 SC_PUBLIC_TCL_HEADERS
    286 
    287 # Check for tclsh binary
    288 MP_PROG_TCLSH
    289 
    290 # Substitute Tcl platform for base compatibility check
    291 MP_TCL_PLATFORM
    292 
    293 # Check for Tcl package path
    294 MP_TCL_PACKAGE_DIR
    295 
    296 # Check if thread is enabled.
    297 MP_TCL_THREAD_SUPPORT
     276# Substitute platform for base compatibility check
     277MP_PLATFORM
    298278
    299279## libcurl
     
    311291MP_TRACEMODE_SUPPORT
    312292
    313 # Determine if we need to install some bundled packages
    314 OUR_INCLUDED_PACKAGES=
    315 
    316 ## Thread package.
    317 AC_ARG_WITH(
    318                 included-tclthread,
    319                 AS_HELP_STRING([--with-included-tclthread],
    320                         [install included Thread package.]),
    321                 [with_included_tclthread=$withval],
    322                 [with_included_tclthread="unspecified"])
    323 
    324 # Check if thread package is already installed.
    325 if test "x$with_included_tclthread" = "xunspecified" ; then
    326         MP_TCL_PACKAGE(
    327                 [Thread],
    328                 [AC_MSG_RESULT([yes]); with_included_tclthread=no],
    329                 [AC_MSG_RESULT([no]); with_included_tclthread=yes])
    330 fi
    331 
    332 # If thread package isn't installed, configure and install thread package.
    333 if test "$with_included_tclthread" = "yes"; then
    334         OUR_INCLUDED_PACKAGES="$OUR_INCLUDED_PACKAGES thread2.6"
    335         AC_CONFIG_SUBDIRS([src/thread2.6])
    336         # Extract thread package
    337         (cd src/; gzip -d < thread2.6.tar.gz | tar xf -)
    338         # Patch thread package (so thread2.6 is the vanilla distribution directory)
    339         patch -p0 < src/thread2.6.diff
    340 fi
    341 
    342 # Allows building of shared libraries
    343 SC_ENABLE_SHARED
    344 
    345 # Pull compiler / linker values from tclConfig.sh
    346 LDFLAGS_DEBUG=${TCL_LDFLAGS_DEBUG}
    347 LDFLAGS_OPTIMIZE=${TCL_LDFLAGS_OPTIMIZE}
    348 SHLIB_LD=${TCL_SHLIB_LD}
    349 STLIB_LD=${TCL_STLIB_LD}
    350 SHLIB_CFLAGS=${TCL_SHLIB_CFLAGS}
    351 SHLIB_SUFFIX=${TCL_SHLIB_SUFFIX}
    352 
    353 AC_SUBST(INCLUDES)
    354 AC_SUBST(STLIB_LD)
    355 AC_SUBST(SHLIB_LD)
    356 AC_SUBST(SHLIB_CFLAGS)
    357 AC_SUBST(SHLIB_LDFLAGS)
    358 AC_SUBST(SHLIB_SUFFIX)
    359 AC_SUBST(TCL_DEFS)
    360 AC_SUBST(TCL_STUB_LIB_SPEC)
    361 AC_SUBST(TCL_CC)
    362 AC_SUBST(OUR_INCLUDED_PACKAGES)
    363 
    364293# misc variables that need to be expanded for substitution into tcl
    365 
    366294oldprefix=$prefix
     295oldexec_prefix=$exec_prefix
    367296if test "x$prefix" = "xNONE" ; then
    368297   prefix=$ac_default_prefix
    369298fi
    370 
    371 # Check if there's an existing DP/MP install too old to upgrade
    372 MP_CHECK_OLDLAYOUT
    373 
     299if test "x$exec_prefix" = "xNONE" ; then
     300        exec_prefix=$prefix
     301fi
    374302eval "prefix_expanded=$prefix"
     303eval "exec_prefix_expanded=$exec_prefix"
    375304AC_SUBST(prefix_expanded)
    376305# do this twice, since there is a nested variable of
     
    384313eval "macports_tcl_dir=$macports_tcl_dir"
    385314AC_SUBST(macports_tcl_dir)
    386 
     315# Compute the libexec dir for the vendor packages
     316eval "macports_libexec_dir=${libexecdir}/macports"
     317eval "macports_libexec_dir=$macports_libexec_dir"
    387318prefix=$oldprefix
    388 
    389 dnl man page settings (compressed, links, etc)
    390 dnl
    391 dnl SC_CONFIG_MANPAGES
     319exec_prefix=$oldexec_prefix
     320
     321# Determine if we need to install some bundled packages
     322VENDOR_PACKAGES=
     323
     324## Tcl package
     325tcl_version=8.5.15
     326tcl_thread_version=2.7.0
     327tcllib_version=1.15
     328MP_CONFIG_TARBALL([vendor/tcl${tcl_version}-src.tar.gz], [vendor/tcl${tcl_version}/unix], [--prefix=${macports_libexec_dir} --enable-threads])
     329VENDOR_TCL_SUBDIR=tcl${tcl_version}/unix
     330VENDOR_TCL_INSTALL="install-binaries install-libraries"
     331AC_SUBST(VENDOR_TCL_SUBDIR)
     332AC_SUBST(VENDOR_TCL_INSTALL)
     333
     334# Set up some variables needed by MacPorts' Tcl setup
     335VENDOR_DESTROOT=vendor/vendor-destroot
     336AC_SUBST(VENDOR_DESTROOT)
     337
     338## Tcl Thread package
     339# Tcl supports Threads internally, but to use threads from Tcl code we need
     340# this package
     341MP_CONFIG_TARBALL([vendor/thread${tcl_thread_version}.tar.gz], [vendor/thread${tcl_thread_version}], [--prefix=${macports_libexec_dir}])
     342VENDOR_TCLTHREAD_SUBDIR=thread${tcl_thread_version}
     343VENDOR_TCLTHREAD_INSTALL="install-binaries install-libraries"
     344AC_SUBST(VENDOR_TCLTHREAD_SUBDIR)
     345AC_SUBST(VENDOR_TCLTHREAD_INSTALL)
     346
     347## Tcllib package
     348# Note that Tcllib needs a Tcl interpreter during installation; it will *not*
     349# be the one we configure above, because that one isn't built yet. That's not
     350# a problem, though -- it's only used during installation.
     351MP_CONFIG_TARBALL([vendor/tcllib-${tcllib_version}.tar.gz], [vendor/tcllib-${tcllib_version}], [--prefix=${macports_libexec_dir}])
     352VENDOR_PACKAGES="$VENDOR_PACKAGES tcllib-${tcllib_version}"
     353VENDOR_TCLLIB_SUBDIR=tcllib-${tcllib_version}
     354VENDOR_TCLLIB_INSTALL="install-libraries"
     355AC_SUBST(VENDOR_TCLLIB_SUBDIR)
     356AC_SUBST(VENDOR_TCLLIB_INSTALL)
     357
     358# Load tclConfig.sh from our private install of Tcl
     359AC_MSG_CHECKING([for Tcl configuration])
     360TCL_BIN_DIR=`(cd vendor/tcl${tcl_version}/unix; pwd)`
     361AC_MSG_RESULT([found $TCL_BIN_DIR/tclConfig.sh])
     362SC_LOAD_TCLCONFIG
     363SC_ENABLE_SHARED
     364
     365# Pull compiler/linker values from tclConfig.sh
     366SHLIB_LD=${TCL_SHLIB_LD}
     367STLIB_LD=${TCL_STLIB_LD}
     368SHLIB_CFLAGS=${TCL_SHLIB_CFLAGS}
     369SHLIB_SUFFIX=${TCL_SHLIB_SUFFIX}
     370TCLSH=${TCL_EXEC_PREFIX}/bin/tclsh${TCL_VERSION}
     371INTREE_TCLSH=${TCL_BIN_DIR}/tclsh
     372# strip possible whitespace at the end of TCL_PACKAGE_PATH
     373eval "TCL_PACKAGE_PATH=${TCL_PACKAGE_PATH}"
     374
     375AC_SUBST(SHLIB_LD)
     376AC_SUBST(STLIB_LD)
     377AC_SUBST(SHLIB_CFLAGS)
     378AC_SUBST(SHLIB_SUFFIX)
     379AC_SUBST(TCL_PREFIX)
     380AC_SUBST(TCL_VERSION)
     381AC_SUBST(TCL_PACKAGE_PATH)
     382AC_SUBST(TCL_STUB_LIB_SPEC)
     383AC_SUBST(TCL_SRC_DIR)
     384AC_SUBST(TCLSH)
     385AC_SUBST(INTREE_TCLSH)
     386
     387INCLUDES="-I.. -I. $INCLUDES"
     388AC_SUBST(INCLUDES)
     389
     390# Check if there's an existing DP/MP install too old to upgrade
     391MP_CHECK_OLDLAYOUT
    392392
    393393# Output
     
    396396        Makefile
    397397        Mk/macports.autoconf.mk
     398        doc/Makefile
    398399        doc/base.mtree
    399400        doc/macosx.mtree
     
    404405        setupenv.bash
    405406        src/Makefile
     407        src/cflib1.0/Makefile
     408        src/cregistry/Makefile
     409        src/darwintracelib1.0/Makefile
    406410        src/machista1.0/Makefile
     411        src/macports1.0/Makefile
    407412        src/macports1.0/macports_autoconf.tcl
     413        src/macports1.0/macports_fastload.tcl
    408414        src/macports1.0/macports_test_autoconf.tcl
    409         src/macports1.0/macports_fastload.tcl
     415        src/package1.0/Makefile
    410416        src/package1.0/package_test_autoconf.tcl
    411417        src/pextlib1.0/Makefile
     418        src/port/Makefile
     419        src/port1.0/Makefile
    412420        src/port1.0/port_autoconf.tcl
    413421        src/port1.0/port_test_autoconf.tcl
    414422        src/programs/Makefile
     423        src/registry2.0/Makefile
    415424        src/registry2.0/registry_autoconf.tcl
     425        tests/Makefile
     426        vendor/Makefile
    416427])
    417428
  • trunk/base/doc

    • Property svn:ignore
      •  

        old new  
         1Makefile
        12macports.conf
        23pubkeys.conf
  • trunk/base/doc/Makefile.in

    r117613 r117621  
     1srcdir = @srcdir@
     2VPATH  = @srcdir@
     3
    14MAN1=           port.1
    25MAN5=           macports.conf.5
  • trunk/base/src/Makefile.in

    r113873 r117621  
    1 TCLPKG=         @OUR_INCLUDED_PACKAGES@ \
    2                         cregistry \
     1srcdir = @srcdir@
     2VPATH  = @srcdir@
     3
     4TCLPKG=         cregistry \
    35                        registry2.0 \
    46                        macports1.0 \
     
    2224test::
    2325
    24 include ../Mk/macports.subdir.mk
     26include $(srcdir)/../Mk/macports.subdir.mk
  • trunk/base/src/cflib1.0

    • Property svn:ignore set to
      Makefile
  • trunk/base/src/cflib1.0/Makefile.in

    r117487 r117621  
     1srcdir = @srcdir@
     2VPATH  = @srcdir@
     3
    14OBJS=           CFLib.o
    25SHLIB_NAME=     CFLib${SHLIB_SUFFIX}
     
    58
    69include ../../Mk/macports.autoconf.mk
    7 include ../../Mk/macports.tea.mk
     10include $(srcdir)/../../Mk/macports.tea.mk
  • trunk/base/src/cregistry

    • Property svn:ignore
      •  

        old new  
         1Makefile
        12cregistry.a
        23macports.sqlext
  • trunk/base/src/cregistry/Makefile.in

    r117487 r117621  
    11# $Id$
     2
     3srcdir = @srcdir@
     4VPATH  = @srcdir@
    25
    36OBJS = registry.o entry.o sql.o vercomp.o util.o file.o portgroup.o
  • trunk/base/src/darwintracelib1.0

    • Property svn:ignore
      •  

        old new  
         1Makefile
        12darwintrace.dylib
  • trunk/base/src/darwintracelib1.0/Makefile.in

    r117487 r117621  
     1srcdir = @srcdir@
     2VPATH  = @srcdir@
     3
    14# This Makefile will only be run on Darwin systems; we can safely use
    25# Apple-specifics here
  • trunk/base/src/macports1.0/Makefile.in

    r117487 r117621  
     1srcdir = @srcdir@
     2VPATH  = @srcdir@
     3
    14SRCS=           macports.tcl macports_dlist.tcl macports_util.tcl \
    25                macports_autoconf.tcl macports_fastload.tcl
     
    58
    69INSTALLDIR=     ${DESTDIR}${datadir}/macports/Tcl/macports1.0
    7 INSTALLPKGLINK= ${TCL_PACKAGE_DIR}/macports1.0
     10INSTALLPKGLINK= ${TCL_PACKAGE_PATH}/macports1.0
    811
    912include ../../Mk/macports.autoconf.mk
    10 include ../../Mk/macports.tea.mk
     13include $(srcdir)/../../Mk/macports.tea.mk
    1114
    1215ifeq ($(OBJC_RUNTIME), APPLE_RUNTIME)
     
    1720
    1821test::
    19         $(TCLSH) ./tests/test.tcl -nocolor
     22        $(TCLSH) $(srcdir)/tests/test.tcl -nocolor
    2023
    2124distclean:: clean
     
    3134        $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 pkgIndex.tcl ${INSTALLDIR}
    3235
    33         echo "${TCL_PACKAGE_DIR}" > ${DESTDIR}${prefix}/var/macports/.tclpackage
     36        echo "${TCL_PACKAGE_PATH}" > ${DESTDIR}${prefix}/var/macports/.tclpackage
    3437        if test -z "${DESTDIR}" -a "${INSTALLPKGLINK}" != "${INSTALLDIR}"; then \
    3538                if test ! -L "${INSTALLPKGLINK}"; then \
    36             if test ! -e "${TCL_PACKAGE_DIR}"; then \
    37                 $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} "${TCL_PACKAGE_DIR}" || true; \
     39            if test ! -e "${TCL_PACKAGE_PATH}"; then \
     40                $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} "${TCL_PACKAGE_PATH}" || true; \
    3841            fi; \
    3942            if test -d "${INSTALLPKGLINK}"; then \
  • trunk/base/src/macports1.0/macports_fastload.tcl.in

    r79593 r117621  
    8282    }
    8383}
    84 
    85 if { "@SQLITE3_TCL_DIR@" != "" } {
    86     set dir "@SQLITE3_TCL_DIR@"
    87     set pkgindex [file join $dir pkgIndex.tcl]
    88     if [file exists $pkgindex] {
    89         source $pkgindex
    90     }
    91 }
  • trunk/base/src/package1.0

    • Property svn:ignore
      •  

        old new  
         1Makefile
         2package_test_autoconf.tcl
        13pkgIndex.tcl
        2 package_test_autoconf.tcl
  • trunk/base/src/package1.0/Makefile.in

    r117487 r117621  
     1srcdir = @srcdir@
     2VPATH  = @srcdir@
     3
    14INSTALLDIR=     ${DESTDIR}${datadir}/macports/Tcl/package1.0
    25
     
    2023test::
    2124        -$(prefix)/bin/port sync
    22         $(TCLSH) ./tests/test.tcl -nocolor
     25        $(TCLSH) $(srcdir)/tests/test.tcl -nocolor
    2326
    2427install:: all
    2528        $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
    2629        $(SILENT)set -x; for file in ${SRCS}; do \
    27                 $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 $$file ${INSTALLDIR}; \
     30                $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 $(srcdir)/$$file ${INSTALLDIR}; \
    2831        done
    2932        $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 pkgIndex.tcl ${INSTALLDIR}
  • trunk/base/src/pkg_mkindex.sh.in

    r79593 r117621  
    2929# POSSIBILITY OF SUCH DAMAGE.
    3030
    31 TCLSH=@TCLSH@
     31TCLSH=@INTREE_TCLSH@
    3232GREP=@GREP@
    3333
  • trunk/base/src/port

    • Property svn:ignore
      •  

        old new  
         1Makefile
        12port
        23portall
  • trunk/base/src/port/Makefile.in

    r117487 r117621  
     1srcdir = @srcdir@
     2VPATH  = @srcdir@
     3
    14INSTALLDIR=     ${DESTDIR}${prefix}
    25TOPSRCDIR=      ../..
     
    1417
    1518portmirror: portmirror.tcl ../../Mk/macports.autoconf.mk
    16         ${edit} portmirror.tcl > $@
     19        ${edit} $(srcdir)/portmirror.tcl > $@
    1720
    1821portindex: portindex.tcl ../../Mk/macports.autoconf.mk
    19         ${edit} portindex.tcl > $@
     22        ${edit} $(srcdir)/portindex.tcl > $@
    2023
    2124port: port.tcl ../../Mk/macports.autoconf.mk
    22         ${edit} port.tcl > $@
     25        ${edit} $(srcdir)/port.tcl > $@
    2326
    2427mkdirs:
     
    3740        $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}/var/macports
    3841        $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 555 port portindex portmirror ${INSTALLDIR}/bin/
    39         $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 port-help.tcl  ${INSTALLDIR}/var/macports/
     42        $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 $(srcdir)/port-help.tcl  ${INSTALLDIR}/var/macports/
    4043        cd ${INSTALLDIR}/bin && $(LN_S) -f port portf
  • trunk/base/src/port1.0

    • Property svn:ignore
      •  

        old new  
         1Makefile
         2pkgIndex.tcl
        13port_autoconf.tcl
        24port_test_autoconf.tcl
        3 pkgIndex.tcl
  • trunk/base/src/port1.0/Makefile.in

    r117487 r117621  
     1srcdir = @srcdir@
     2VPATH  = @srcdir@
     3
    14INSTALLDIR=     ${DESTDIR}${datadir}/macports/Tcl/port1.0
    25
     6SRCS_AUTOCONF= port_autoconf.tcl
    37SRCS=   port.tcl portchecksum.tcl portconfigure.tcl portextract.tcl         \
    48        portfetch.tcl portmain.tcl portbuild.tcl portpatch.tcl portutil.tcl \
    59        portinstall.tcl portuninstall.tcl portdepends.tcl portdestroot.tcl \
    610        portlint.tcl portclean.tcl porttest.tcl portactivate.tcl \
    7         portdeactivate.tcl port_autoconf.tcl portstartupitem.tcl \
    8         porttrace.tcl portlivecheck.tcl portdistcheck.tcl portmirror.tcl \
    9         portload.tcl portunload.tcl portdistfiles.tcl fetch_common.tcl \
    10         portsandbox.tcl
     11        portdeactivate.tcl portstartupitem.tcl porttrace.tcl portlivecheck.tcl \
     12        portdistcheck.tcl portmirror.tcl portload.tcl portunload.tcl \
     13        portdistfiles.tcl fetch_common.tcl portsandbox.tcl
    1114
    12 include ../../Mk/macports.subdir.mk
     15include $(srcdir)/../../Mk/macports.subdir.mk
    1316include ../../Mk/macports.autoconf.mk
    1417
     
    1720all:: pkgIndex.tcl
    1821
    19 pkgIndex.tcl: $(SRCS)
     22pkgIndex.tcl: $(SRCS) $(SRCS_AUTOCONF)
    2023        $(SILENT) ../pkg_mkindex.sh . || ( rm -rf $@ && exit 1 )
    2124
     
    2932        $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
    3033        $(SILENT)set -x; for file in ${SRCS}; do \
     34                $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 $(srcdir)/$$file ${INSTALLDIR}; \
     35        done
     36        $(SILENT)set -x; for file in ${SRCS_AUTOCONF}; do \
    3137                $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 $$file ${INSTALLDIR}; \
    3238        done
     
    3440
    3541test::
    36         $(TCLSH) ./tests/test.tcl -nocolor
     42        $(TCLSH) $(srcdir)/tests/test.tcl -nocolor
  • trunk/base/src/registry2.0

    • Property svn:ignore
      •  

        old new  
         1Makefile
        12pkgIndex.tcl
        23registry.dylib
  • trunk/base/src/registry2.0/Makefile.in

    r117487 r117621  
    11# $Id$
    22
    3 SRCS = registry.tcl registry_autoconf.tcl registry_util.tcl receipt_flat.tcl receipt_sqlite.tcl portimage.tcl portuninstall.tcl
     3srcdir = @srcdir@
     4VPATH  = @srcdir@
     5
     6SRCS_AUTOCONF = registry_autoconf.tcl
     7SRCS = registry.tcl registry_util.tcl receipt_flat.tcl receipt_sqlite.tcl portimage.tcl portuninstall.tcl
    48OBJS = registry.o util.o \
    59        entry.o entryobj.o \
     
    1216
    1317include ../../Mk/macports.autoconf.mk
    14 include ../../Mk/macports.tea.mk
     18include $(srcdir)/../../Mk/macports.tea.mk
    1519
    16 pkgIndex.tcl: $(SRCS)
     20pkgIndex.tcl: $(SRCS) $(SRCS_AUTOCONF)
    1721
    1822CFLAGS+=        ${SQLITE3_CFLAGS}
     
    2731
    2832test:: ${SHLIB_NAME}
    29         ${TCLSH} tests/entry.tcl ./${SHLIB_NAME}
    30         ${TCLSH} tests/depends.tcl ./${SHLIB_NAME}
     33        ${TCLSH} $(srcdir)/tests/entry.tcl ./${SHLIB_NAME}
     34        ${TCLSH} $(srcdir)/tests/depends.tcl ./${SHLIB_NAME}
    3135
    3236distclean:: clean
    3337        rm -f registry_autoconf.tcl
    3438
    35 install:: all
     39install:: all $(SHLIB_NAME)
    3640        [ ! -d $(DESTDIR)${datadir}/macports/Tcl/registry1.0 ] || rm -vrf $(DESTDIR)${datadir}/macports/Tcl/registry1.0
    3741        $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}
    3842        $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 ${SHLIB_NAME} ${INSTALLDIR}
    3943        $(SILENT) set -x; for file in ${SRCS}; do \
     44                $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 $(srcdir)/$$file ${INSTALLDIR}/$$file; \
     45        done
     46        $(SILENT) set -x; for file in ${SRCS_AUTOCONF}; do \
    4047                $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 444 $$file ${INSTALLDIR}/$$file; \
    4148        done
  • trunk/base/tests

    • Property svn:ignore set to
      Makefile
  • trunk/base/tests/Makefile.in

    r117487 r117621  
     1srcdir = @srcdir@
     2VPATH  = @srcdir@
     3
    14include ../Mk/macports.autoconf.mk
    25
     
    811# tclsh test.tcl -h for more options.
    912test::
    10         $(TCLSH) test.tcl -nocolor
     13        $(TCLSH) $(srcdir)/test.tcl -nocolor
    1114
    1215clean::
Note: See TracChangeset for help on using the changeset viewer.