Check-in [a72b70810b]
Overview
SHA1:a72b70810b5c23771b324ebb5ce82f18d28a545d
Date: 2016-12-09 04:36:35
User: rkeene
Comment:Updated configure system to latest version of macros
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2016-12-09
05:22
[7cda94da9b] Updated with a better check for -Wno-unused-result for TCC (user: rkeene, tags: trunk)
04:36
[a72b70810b] Updated configure system to latest version of macros (user: rkeene, tags: trunk)
2016-03-30
03:20
[5dde744f4b] Better sanitization of "AR" and "CC" when trying to figure out the cross-prefix (user: rkeene, tags: trunk)
Changes

Modified aclocal/shobj.m4 from [9a0374cc5c] to [1858889d4f].

    77     77     SHLIBOBJS=""
    78     78     for obj in $LIB@&t@OBJS; do
    79     79       SHLIBOBJS="$SHLIBOBJS `echo $obj | sed 's/\.o$/_shr.o/g'`"
    80     80     done
    81     81   ])
    82     82   
    83     83   AC_DEFUN([DC_SYNC_RPATH], [
    84         -  OLD_LDFLAGS="$LDFLAGS"
    85         -
    86         -  for tryrpath in "-Wl,-rpath" "-Wl,--rpath" "-Wl,-R"; do
    87         -    LDFLAGS="$OLD_LDFLAGS $tryrpath -Wl,/tmp"
    88         -    AC_LINK_IFELSE(AC_LANG_PROGRAM([], [ return(0); ]), [
    89         -      rpathldflags="$tryrpath"
    90         -      break
    91         -    ])
    92         -  done
    93         -  unset tryrpath
    94         -
    95         -  LDFLAGS="$OLD_LDFLAGS"
    96         -  unset OLD_LDFLAGS
    97         -
    98         -  ADDLDFLAGS=""
    99         -  for opt in $LDFLAGS; do
   100         -    if echo "$opt" | grep '^-L' >/dev/null; then
   101         -      rpathdir=`echo "$opt" | sed 's@^-L *@@'`
   102         -      ADDLDFLAGS="$ADDLDFLAGS $rpathldflags -Wl,$rpathdir"
   103         -    fi
   104         -  done
   105         -  unset opt rpathldflags
   106         -
   107         -  LDFLAGS="$LDFLAGS $ADDLDFLAGS"
   108         -
   109         -  unset ADDLDFLAGS
           84  +	AC_ARG_ENABLE([rpath], AS_HELP_STRING([--disable-rpath], [disable setting of rpath]), [
           85  +		if test "$enableval" = 'no'; then
           86  +			set_rpath='no'
           87  +		else
           88  +			set_rpath='yes'
           89  +		fi
           90  +	], [
           91  +		if test "$cross_compiling" = 'yes'; then
           92  +			set_rpath='no'
           93  +		else
           94  +			ifelse($1, [], [
           95  +				set_rpath='yes'
           96  +			], [
           97  +				set_rpath='$1'
           98  +			])
           99  +		fi
          100  +	])
          101  +
          102  +	if test "$set_rpath" = 'yes'; then
          103  +		OLD_LDFLAGS="$LDFLAGS"
          104  +
          105  +		AC_CACHE_CHECK([how to set rpath], [rsk_cv_link_set_rpath], [
          106  +			AC_LANG_PUSH(C)
          107  +			for tryrpath in "-Wl,-rpath" "-Wl,--rpath" "-Wl,-R"; do
          108  +				LDFLAGS="$OLD_LDFLAGS $tryrpath -Wl,/tmp"
          109  +				AC_LINK_IFELSE([AC_LANG_PROGRAM([], [ return(0); ])], [
          110  +					rsk_cv_link_set_rpath="$tryrpath"
          111  +					break
          112  +				])
          113  +			done
          114  +			AC_LANG_POP(C)
          115  +			unset tryrpath
          116  +		])
          117  +
          118  +		LDFLAGS="$OLD_LDFLAGS"
          119  +		unset OLD_LDFLAGS
          120  +
          121  +		ADDLDFLAGS=""
          122  +		for opt in $LDFLAGS $LIBS; do
          123  +			if echo "$opt" | grep '^-L' >/dev/null; then
          124  +				rpathdir="`echo "$opt" | sed 's@^-L *@@'`"
          125  +				ADDLDFLAGS="$ADDLDFLAGS $rsk_cv_link_set_rpath -Wl,$rpathdir"
          126  +			fi
          127  +		done
          128  +		unset opt
          129  +
          130  +		LDFLAGS="$LDFLAGS $ADDLDFLAGS"
          131  +
          132  +		unset ADDLDFLAGS
          133  +	fi
   110    134   ])
   111    135   
   112    136   AC_DEFUN([DC_CHK_OS_INFO], [
   113    137   	AC_CANONICAL_HOST
   114    138   	AC_SUBST(SHOBJEXT)
   115    139   	AC_SUBST(SHOBJFLAGS)
   116    140   	AC_SUBST(SHOBJCPPFLAGS)
................................................................................
   138    162   						SHOBJEXT="so"
   139    163   						;;
   140    164   					*)
   141    165   						SHOBJEXT="sl"
   142    166   						;;
   143    167   				esac
   144    168   				;;
   145         -			aix[0-9].*)
   146         -				SHOBJEXT="a"
   147         -				;;
   148    169   			mingw32|mingw32msvc*)
   149    170   				SHOBJEXT="dll"
          171  +				AREXT='lib'
   150    172   				CFLAGS="$CFLAGS -mms-bitfields"
   151    173   				CPPFLAGS="$CPPFLAGS -mms-bitfields"
   152    174   				SHOBJCPPFLAGS="-DPIC"
   153    175   				SHOBJLDFLAGS='-shared -Wl,--dll -Wl,--enable-auto-image-base -Wl,--output-def,$[@].def,--out-implib,$[@].a'
   154    176   				;;
   155    177   			msvc)
   156    178   				SHOBJEXT="dll"
          179  +				AREXT='lib'
   157    180   				CFLAGS="$CFLAGS -nologo"
   158    181   				SHOBJCPPFLAGS='-DPIC'
   159    182   				SHOBJLDFLAGS='/LD /LINK /NODEFAULTLIB:MSVCRT'
   160    183   				;;
   161    184   			cygwin*)
   162    185   				SHOBJEXT="dll"
   163    186   				SHOBJFLAGS="-fPIC"
................................................................................
   166    189   				CPPFLAGS="$CPPFLAGS -mms-bitfields"
   167    190   				SHOBJLDFLAGS='-shared -Wl,--enable-auto-image-base -Wl,--output-def,$[@].def,--out-implib,$[@].a'
   168    191   				;;
   169    192   		esac
   170    193   	fi
   171    194   ])
   172    195   
   173         -AC_DEFUN(SHOBJ_SET_SONAME, [
          196  +AC_DEFUN([SHOBJ_SET_SONAME], [
   174    197   	SAVE_LDFLAGS="$LDFLAGS"
   175    198   
   176    199   	AC_MSG_CHECKING([how to specify soname])
   177    200   
   178    201   	for try in "-Wl,--soname,$1" "Wl,-install_name,$1" '__fail__'; do
   179    202   		LDFLAGS="$SAVE_LDFLAGS"
   180    203   
................................................................................
   193    216   
   194    217   			break
   195    218   		])
   196    219   	done
   197    220   
   198    221   	AC_SUBST(SHOBJLDFLAGS)
   199    222   ])
          223  +
          224  +dnl $1 = Description to show user
          225  +dnl $2 = Libraries to link to
          226  +dnl $3 = Variable to update (optional; default LIBS)
          227  +dnl $4 = Action to run if found
          228  +dnl $5 = Action to run if not found
          229  +AC_DEFUN([SHOBJ_DO_STATIC_LINK_LIB], [
          230  +        ifelse($3, [], [
          231  +                define([VAR_TO_UPDATE], [LIBS])
          232  +        ], [
          233  +                define([VAR_TO_UPDATE], [$3])
          234  +        ])  
          235  +
          236  +
          237  +	AC_MSG_CHECKING([for how to statically link to $1])
          238  +
          239  +	trylink_ADD_LDFLAGS=''
          240  +	for arg in $VAR_TO_UPDATE; do
          241  +		case "${arg}" in
          242  +			-L*)
          243  +				trylink_ADD_LDFLAGS="${arg}"
          244  +				;;
          245  +		esac
          246  +	done
          247  +
          248  +	SAVELIBS="$LIBS"
          249  +	staticlib=""
          250  +	found="0"
          251  +	dnl HP/UX uses -Wl,-a,archive ... -Wl,-a,shared_archive
          252  +	dnl Linux and Solaris us -Wl,-Bstatic ... -Wl,-Bdynamic
          253  +	AC_LANG_PUSH([C])
          254  +	for trylink in "-Wl,-a,archive $2 -Wl,-a,shared_archive" "-Wl,-Bstatic $2 -Wl,-Bdynamic" "$2"; do
          255  +		if echo " ${LDFLAGS} " | grep ' -static ' >/dev/null; then
          256  +			if test "${trylink}" != "$2"; then
          257  +				continue
          258  +			fi
          259  +		fi
          260  +
          261  +		LIBS="${SAVELIBS} ${trylink_ADD_LDFLAGS} ${trylink}"
          262  +
          263  +		AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [
          264  +			staticlib="${trylink}"
          265  +			found="1"
          266  +
          267  +			break
          268  +		])
          269  +	done
          270  +	AC_LANG_POP([C])
          271  +	LIBS="${SAVELIBS}"
          272  +
          273  +	if test "${found}" = "1"; then
          274  +		new_RESULT=''
          275  +		SAVERESULT="$VAR_TO_UPDATE"
          276  +		for lib in ${SAVERESULT}; do
          277  +			addlib='1'
          278  +			for removelib in $2; do
          279  +				if test "${lib}" = "${removelib}"; then
          280  +					addlib='0'
          281  +					break
          282  +				fi
          283  +			done
          284  +
          285  +			if test "$addlib" = '1'; then
          286  +				new_RESULT="${new_RESULT} ${lib}"
          287  +			fi
          288  +		done
          289  +		VAR_TO_UPDATE="${new_RESULT} ${staticlib}"
          290  +
          291  +		AC_MSG_RESULT([${staticlib}])
          292  +
          293  +		$4
          294  +	else
          295  +		AC_MSG_RESULT([cant])
          296  +
          297  +		$5
          298  +	fi
          299  +])
          300  +

Modified aclocal/tcl.m4 from [7fd1e39b5f] to [71c8f9aee7].

     1      1   dnl Tcl M4 Routines
            2  +
            3  +dnl Find a runnable Tcl
            4  +AC_DEFUN([TCLEXT_FIND_TCLSH_PROG], [
            5  +	AC_CACHE_CHECK([runnable tclsh], [tcl_cv_tclsh_native_path], [
            6  +		dnl Try to find a runnable tclsh
            7  +		if test -z "$TCLCONFIGPATH"; then
            8  +			TCLCONFIGPATH=/dev/null/null
            9  +		fi
           10  +
           11  +		for try_tclsh in "$TCLSH_NATIVE" "$TCLCONFIGPATH/../bin/tclsh" \
           12  +		                 "$TCLCONFIGPATH/../bin/tclsh8.6" \
           13  +		                 "$TCLCONFIGPATH/../bin/tclsh8.5" \
           14  +		                 "$TCLCONFIGPATH/../bin/tclsh8.4" \
           15  +		                 `which tclsh 2>/dev/null` \
           16  +		                 `which tclsh8.6 2>/dev/null` \
           17  +		                 `which tclsh8.5 2>/dev/null` \
           18  +		                 `which tclsh8.4 2>/dev/null` \
           19  +		                 tclsh; do
           20  +			if test -z "$try_tclsh"; then
           21  +				continue
           22  +			fi
           23  +			if test -x "$try_tclsh"; then
           24  +				if echo 'exit 0' | "$try_tclsh" 2>/dev/null >/dev/null; then
           25  +					tcl_cv_tclsh_native_path="$try_tclsh"
           26  +
           27  +					break
           28  +				fi
           29  +			fi
           30  +		done
           31  +
           32  +		if test "$TCLCONFIGPATH" = '/dev/null/null'; then
           33  +			unset TCLCONFIGPATH
           34  +		fi
           35  +	])
           36  +
           37  +	TCLSH_PROG="${tcl_cv_tclsh_native_path}"
           38  +	AC_SUBST(TCLSH_PROG)
           39  +])
           40  +
     2     41   
     3     42   dnl Must call AC_CANONICAL_HOST  before calling us
     4     43   AC_DEFUN([TCLEXT_FIND_TCLCONFIG], [
     5         -	AC_MSG_CHECKING([for path to tclConfig.sh])
     6     44   
     7     45   	TCLCONFIGPATH=""
     8     46   	AC_ARG_WITH([tcl], AS_HELP_STRING([--with-tcl], [directory containing tcl configuration (tclConfig.sh)]), [
     9     47   		if test "x$withval" = "xno"; then
    10     48   			AC_MSG_ERROR([cant build without tcl])
    11     49   		fi
    12     50   
    13     51   		TCLCONFIGPATH="$withval"
    14     52   	], [
    15         -		for dir in "/usr/$host_alias/lib" /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64; do
           53  +		if test "$cross_compiling" = 'no'; then
           54  +			TCLEXT_FIND_TCLSH_PROG
           55  +			tclConfigCheckDir="`echo 'puts [[tcl::pkgconfig get libdir,runtime]]' | "$TCLSH_PROG" 2>/dev/null`"
           56  +		else
           57  +			tclConfigCheckDir=/dev/null/null
           58  +		fi
           59  +
           60  +		if test "$cross_compiling" = 'no'; then
           61  +			dirs="/usr/$host_alias/lib /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64"
           62  +		else
           63  +			dirs=''
           64  +		fi
           65  +
           66  +		for dir in "$tclConfigCheckDir" $dirs; do
    16     67   			if test -f "$dir/tclConfig.sh"; then
    17     68   				TCLCONFIGPATH="$dir"
    18     69   
    19     70   				break
    20     71   			fi
    21     72   		done
    22     73   	])
    23     74   
           75  +	AC_MSG_CHECKING([for path to tclConfig.sh])
           76  +
    24     77   	if test -z "$TCLCONFIGPATH"; then
    25     78   		AC_MSG_ERROR([unable to locate tclConfig.sh.  Try --with-tcl.])
    26     79   	fi
    27     80   
    28         -	for try_tclsh in "$TCLCONFIGPATH/../bin/tclsh" \
    29         -	                 "$TCLCONFIGPATH/../bin/tclsh8.6" \
    30         -	                 "$TCLCONFIGPATH/../bin/tclsh8.5" \
    31         -	                 "$TCLCONFIGPATH/../bin/tclsh8.4" \
    32         -	                 `which tclsh 2>/dev/null` \
    33         -	                 `which tclsh8.6 2>/dev/null` \
    34         -	                 `which tclsh8.5 2>/dev/null` \
    35         -	                 `which tclsh8.4 2>/dev/null` \
    36         -	                 tclsh; do
    37         -		if test -x "$try_tclsh"; then
    38         -			break
    39         -		fi
    40         -	done
    41         -	TCLSH_PROG="${try_tclsh}"
    42         -
    43     81   	AC_SUBST(TCLCONFIGPATH)
    44         -	AC_SUBST(TCLSH_PROG)
    45     82   
    46     83   	AC_MSG_RESULT([$TCLCONFIGPATH])
           84  +
           85  +	dnl Find Tcl if we haven't already
           86  +	if test -z "$TCLSH_PROG"; then
           87  +		TCLEXT_FIND_TCLSH_PROG
           88  +	fi
    47     89   ])
    48     90   
    49     91   dnl Must define TCLCONFIGPATH before calling us (i.e., by TCLEXT_FIND_TCLCONFIG)
    50     92   AC_DEFUN([TCLEXT_LOAD_TCLCONFIG], [
    51     93   	AC_MSG_CHECKING([for working tclConfig.sh])
    52     94   
    53     95   	if test -f "$TCLCONFIGPATH/tclConfig.sh"; then
................................................................................
    63    105   AC_DEFUN([TCLEXT_INIT], [
    64    106   	AC_CANONICAL_HOST
    65    107   
    66    108   	TCLEXT_FIND_TCLCONFIG
    67    109   	TCLEXT_LOAD_TCLCONFIG
    68    110   
    69    111   	AC_DEFINE_UNQUOTED([MODULE_SCOPE], [static], [Define how to declare a function should only be visible to the current module])
          112  +
          113  +	TCLEXT_BUILD='shared'
          114  +	AC_ARG_ENABLE([static], AS_HELP_STRING([--enable-static], [enable a static build]), [
          115  +		if test "$enableval" = "yes"; then
          116  +			TCLEXT_BUILD='static'
          117  +			TCL_SUPPORTS_STUBS=0
          118  +		fi
          119  +	])
    70    120   
    71    121   	AC_ARG_ENABLE([stubs], AS_HELP_STRING([--disable-stubs], [disable use of Tcl stubs]), [
    72    122   		if test "$enableval" = "no"; then
    73    123   			TCL_SUPPORTS_STUBS=0
    74    124   		else
    75    125   			TCL_SUPPORTS_STUBS=1
    76    126   		fi
................................................................................
    86    136   		LIBS="${LIBS} ${TCL_LIB_SPEC}"
    87    137   	fi
    88    138   
    89    139   	TCL_INCLUDE_SPEC="`eval echo "${TCL_INCLUDE_SPEC}"`"
    90    140   
    91    141   	CFLAGS="${CFLAGS} ${TCL_INCLUDE_SPEC}"
    92    142   	CPPFLAGS="${CPPFLAGS} ${TCL_INCLUDE_SPEC}"
    93         -	DEFS="${DEFS} ${TCL_DEFS}"
          143  +	TCL_DEFS_TCL_ONLY=`(
          144  +		eval "set -- ${TCL_DEFS}"
          145  +		for flag in "[$]@"; do
          146  +			case "${flag}" in
          147  +				-DTCL_*)
          148  +					echo "${flag}" | sed "s/'/'\\''/g" | sed "s@^@'@;s@"'[$]'"@'@" | tr $'\n' ' '
          149  +					;;
          150  +			esac
          151  +		done
          152  +	)`
          153  +	TCL_DEFS="${TCL_DEFS_TCL_ONLY}"
          154  +	AC_SUBST(TCL_DEFS)
    94    155   
    95    156   	dnl Needed for package installation
    96    157   	TCL_PACKAGE_PATH="`echo "${TCL_PACKAGE_PATH}" | sed 's@  *$''@@' | awk '{ print [$]1 }'`"
    97    158   	AC_SUBST(TCL_PACKAGE_PATH)
    98    159   
    99    160   	AC_SUBST(LIBS)
   100    161   ])

Modified build/autogen.sh from [f56e71ada1] to [53ac1b1339].

     4      4   (
     5      5   	mkdir aclocal >/dev/null 2>/dev/null
     6      6   	cd aclocal || exit 1
     7      7   
     8      8   	for file in shobj.m4 tcl.m4 versionscript.m4; do
     9      9   		rm -f "${file}"
    10     10   
    11         -		wget -O "${file}.new" "http://rkeene.org/devel/autoconf/${file}" || continue
           11  +		wget -O "${file}.new" "http://chiselapp.com/user/rkeene/repository/autoconf/doc/trunk/${file}" || continue
    12     12   
    13     13   		mv "${file}.new" "${file}"
    14     14   	done
    15     15   )
    16     16   
    17     17   for file in config.guess config.sub install-sh; do
    18     18   	rm -f "${file}"

Modified configure.ac from [09c35b571c] to [1f51af3ae0].

    10     10   AC_PROG_MAKE_SET
    11     11   AC_PROG_INSTALL
    12     12   AC_GNU_SOURCE
    13     13   AC_LANG(C)
    14     14   
    15     15   dnl Determine system information
    16     16   DC_CHK_OS_INFO
           17  +
           18  +dnl Perform Tcl Extension required stuff
           19  +TCLEXT_INIT
    17     20   
    18     21   dnl Determine if a shared or static build is requested
    19         -AC_ARG_ENABLE([shared], AS_HELP_STRING([--disable-shared], [build static library instead of shared library]), [
    20         -	if test "$enableval" = "no"; then
    21         -		TCC4TCL_TARGET=static
    22         -	else
    23         -		TCC4TCL_TARGET=shared
    24         -	fi
    25         -], [
    26         -	TCC4TCL_TARGET=shared
    27         -])
           22  +TCC4TCL_TARGET="${TCLEXT_BUILD}"
    28     23   
    29     24   dnl Configure TCC build options
    30     25   AC_SUBST(TCC_CONFIGURE_OPTS)
    31     26   TCC_CONFIGURE_OPTS=""
    32     27   
    33     28   if test "${TCC4TCL_TARGET}" = "shared"; then
    34     29   	dnl Determine how to make shared objects
................................................................................
    84     79   		;;
    85     80   esac
    86     81   AC_SUBST(HOST_PATH_SEPARATOR)
    87     82   
    88     83   dnl Find a suitable awk
    89     84   AC_CHECK_TOOLS(AWK, gawk awk, [false])
    90     85   
    91         -dnl Perform Tcl Extension required stuff
    92         -TCLEXT_INIT
    93         -
    94     86   dnl This must be done last since it breaks the compilation
    95     87   if test "${TCC4TCL_TARGET}" = "shared"; then
    96     88   	DC_SETUP_STABLE_API([${srcdir}/tcc4tcl.vers], [tcc4tcl.syms])
    97     89   fi
    98     90   
    99     91   dnl Produce output
   100     92   AC_OUTPUT(Makefile pkgIndex.tcl tcc4tcl.syms)