Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 77197 | Differences between
and this patch

Collapse All | Expand All

(-)brlcad-7.6.6/configure.ac (-174 / +39 lines)
Lines 147-155 Link Here
147
147
148
# where are we coming from and where are we going to.
148
# where are we coming from and where are we going to.
149
# prefix is set to NONE until AC_OUTPUT unless --prefix is used
149
# prefix is set to NONE until AC_OUTPUT unless --prefix is used
150
AC_CONFIG_SRCDIR([src/librt/bool.c])
150
151
AC_PREFIX_DEFAULT([/usr/brlcad])
152
AC_MSG_CHECKING([where BRL-CAD is to be installed])
153
if test "x$prefix" = "xNONE" ; then
151
if test "x$prefix" = "xNONE" ; then
154
	bc_prefix="$ac_default_prefix"
152
	bc_prefix="$ac_default_prefix"
155
else
153
else
Lines 962-990 Link Here
962
)
960
)
963
LIBS="$PRELIBS"
961
LIBS="$PRELIBS"
964
962
965
dnl check if libtcl library links
966
tcl_link_works=no
967
LIBTCL=""
968
AC_CHECK_LIB(tcl8.6, Tcl_Main, tcl_link_works=yes ; LIBTCL="-ltcl8.6",
969
    [AC_CHECK_LIB(tcl8.5, Tcl_Main, tcl_link_works=yes ; LIBTCL="-ltcl8.5",
970
	[AC_CHECK_LIB(tcl8.4, Tcl_Main, tcl_link_works=yes ; LIBTCL="-ltcl8.4",
971
	    [AC_CHECK_LIB(tcl84, Tcl_Main, tcl_link_works=yes ; LIBTCL="-ltcl84",
972
		[AC_CHECK_LIB(tcl, Tcl_Main, tcl_link_works=yes ; LIBTCL="-ltcl")]
973
	    )]
974
	)]
975
    )]
976
)
977
978
dnl check if libtk library links
979
tk_link_works=no
980
LIBTK=""
981
AC_CHECK_LIB(tk8.6, Tk_MainLoop, tk_link_works=yes ; LIBTK="-ltk8.6",
982
    [AC_CHECK_LIB(tk8.5, Tk_MainLoop, tk_link_works=yes ; LIBTK="-ltk8.5",
983
	[AC_CHECK_LIB(tk8.4, Tk_MainLoop, tk_link_works=yes ; LIBTK="-ltk8.4",
984
	    [AC_CHECK_LIB(tk, Tk_MainLoop, tk_link_works=yes ; LIBTK="-ltk")]
985
	)]
986
    )]
987
)
988
963
989
dnl check if libitcl library links
964
dnl check if libitcl library links
990
itcl_link_works=no
965
itcl_link_works=no
Lines 1806-1854 Link Here
1806
1781
1807
1782
1808
dnl *** Tcl ***
1783
dnl *** Tcl ***
1784
builtin(include,m4/tcl.m4)
1785
SC_PATH_TCLCONFIG
1786
SC_LOAD_TCLCONFIG
1809
dnl See if libtcl seems to work
1787
dnl See if libtcl seems to work
1788
1810
tcl_works=no
1789
tcl_works=no
1811
AC_MSG_CHECKING(for Tcl library functionality)
1790
AC_MSG_CHECKING(for Tcl library functionality)
1812
PRELIBS="$LIBS"
1791
1813
if test "x$tcl_link_works" = "xyes" ; then
1792
if test ${TCL_LIB_FLAG} -a ${TCL_VERSION} -a ${TCL_MAJOR_VERSION} -a ${TCL_MINOR_VERSION} -a ${TCL_PATCH_LEVEL}; then
1814
	LIBS="$LIBS $LIBTCL"
1793
1815
fi
1794
        LIBTCL=${TCL_LIB_FLAG}
1816
AC_TRY_RUN([
1795
        if test ${TCL_MAJOR_VERSION} -ge 8 -a ${TCL_MINOR_VERSION} -ge 4; then
1817
#ifdef HAVE_TCL_H
1796
                tcl_works=ok
1818
#  include <tcl.h>
1797
        fi
1819
#endif
1820
#ifndef TCL_MAJOR_VERSION
1821
#  error Unknown major version of Tcl
1822
#endif
1823
#ifndef TCL_MINOR_VERSION
1824
#  error Unknown minor version of Tcl
1825
#endif
1826
#include <stdio.h>
1827
int main() {
1828
    Tcl_Time time;
1829
    Tcl_Interp *interp;
1830
    interp = Tcl_CreateInterp();
1831
    if (Tcl_Init(interp) == TCL_ERROR) {
1832
	fprintf(stderr, "Tcl_Init returned error\n");
1833
	return 1;
1834
    }
1835
    /* Tcl_GetTime is an 8.4 symbol */
1836
    Tcl_GetTime(&time);
1837
#if TCL_MAJOR_VERSION < 8
1838
    fprintf(stderr, "major version < 8\n");
1839
    return 1;
1840
#elif TCl_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 4
1841
    fprintf(stderr, "minor version < 4\n");
1842
    return 1;
1843
#endif
1844
    return 0;
1845
}
1846
	],
1847
	[tcl_works=yes]
1848
)
1849
if test "x$tcl_link_works" = "xyes" ; then
1850
	LIBS="$PRELIBS"
1851
fi
1798
fi
1799
1852
AC_MSG_RESULT($tcl_works)
1800
AC_MSG_RESULT($tcl_works)
1853
1801
1854
dnl figure out whether we need to build Tcl
1802
dnl figure out whether we need to build Tcl
Lines 1871-1884 Link Here
1871
	fi
1819
	fi
1872
fi
1820
fi
1873
AC_MSG_CHECKING(whether to build Tcl)
1821
AC_MSG_CHECKING(whether to build Tcl)
1874
TCL_VERSION="8.4"
1875
AC_DEFINE_UNQUOTED([TCL_VERSION], "$TCL_VERSION", "Version of Tcl")
1822
AC_DEFINE_UNQUOTED([TCL_VERSION], "$TCL_VERSION", "Version of Tcl")
1876
AC_SUBST(TCL_VERSION)
1823
AC_SUBST(TCL_VERSION)
1877
TCL_MAJOR_VERSION=8
1878
AC_SUBST(TCL_MAJOR_VERSION)
1824
AC_SUBST(TCL_MAJOR_VERSION)
1879
TCL_MINOR_VERSION=4
1880
AC_SUBST(TCL_MINOR_VERSION)
1825
AC_SUBST(TCL_MINOR_VERSION)
1881
TCL_PATCH_LEVEL=".6"
1882
AC_SUBST(TCL_PATCH_LEVEL)
1826
AC_SUBST(TCL_PATCH_LEVEL)
1883
TCL=""
1827
TCL=""
1884
if test "x$build_brlcad_tcl" = "xyes" ; then
1828
if test "x$build_brlcad_tcl" = "xyes" ; then
Lines 1894-1947 Link Here
1894
1838
1895
1839
1896
dnl *** Tk ***
1840
dnl *** Tk ***
1841
SC_PATH_TKCONFIG
1842
SC_LOAD_TKCONFIG
1897
dnl See if libtk seems to work
1843
dnl See if libtk seems to work
1844
1845
1898
tk_works=no
1846
tk_works=no
1899
AC_MSG_CHECKING(for Tk library functionality)
1847
AC_MSG_CHECKING(for Tk library functionality)
1900
PRELIBS="$LIBS"
1901
if test "x$tk_link_works" = "xyes" ; then
1902
	LIBS="$LIBS $LIBTK $LIBTCL"
1903
fi
1904
AC_TRY_RUN([
1905
#ifdef HAVE_TCL_H
1906
#  include <tcl.h>
1907
#endif
1908
#ifdef HAVE_TK_H
1909
#  include <tk.h>
1910
#endif
1911
#ifndef TK_MAJOR_VERSION
1912
#  error Unknown major version of Tk
1913
#endif
1914
#ifndef TK_MINOR_VERSION
1915
#  error Unknown minor version of Tk
1916
#endif
1917
#include <stdio.h>
1918
int main() {
1919
    Tcl_Interp *interp;
1920
    interp = Tcl_CreateInterp();
1921
    if (Tcl_Init(interp) == TCL_ERROR) {
1922
	fprintf(stderr, "Tcl_Init returned error\n");
1923
	return 1;
1924
    }
1925
    if (Tk_Init(interp) == TCL_ERROR) {
1926
	fprintf(stderr, "Tk_Init returned error\n");
1927
	return 1;
1928
    }
1929
1848
1930
#if TK_MAJOR_VERSION < 8
1849
if test ${TK_LIB_FLAG} -a ${TK_VERSION} -a ${TK_MAJOR_VERSION} -a ${TK_MINOR_VERSION} -a ${TK_PATCH_LEVEL}; then
1931
    fprintf(stderr, "major version < 8\n");
1850
1932
    return 1;
1851
        LIBTK=${TK_LIB_FLAG}
1933
#elif TK_MAJOR_VERSION == 8 && TK_MINOR_VERSION < 4
1852
1934
    fprintf(stderr, "minor version < 4\n");
1853
        if test ${TK_MAJOR_VERSION} -ge 8 -a ${TK_MINOR_VERSION} -ge 4; then
1935
    return 1;
1854
                tk_works=ok
1936
#endif
1855
        fi
1937
    return 0;
1938
}
1939
	],
1940
	[tk_works=yes]
1941
)
1942
if test "x$tk_link_works" = "xyes" ; then
1943
	LIBS="$PRELIBS"
1944
fi
1856
fi
1857
1945
AC_MSG_RESULT($tk_works)
1858
AC_MSG_RESULT($tk_works)
1946
1859
1947
dnl figure out whether we need to build Tk
1860
dnl figure out whether we need to build Tk
Lines 1965-1971 Link Here
1965
fi
1878
fi
1966
AC_MSG_CHECKING(whether to build Tk)
1879
AC_MSG_CHECKING(whether to build Tk)
1967
dnl Need to update version number(s) in src/other/libtk/Makefile.am too
1880
dnl Need to update version number(s) in src/other/libtk/Makefile.am too
1968
TK_VERSION="8.4"
1969
AC_DEFINE_UNQUOTED([TK_VERSION], "$TK_VERSION", "Version of Tk")
1881
AC_DEFINE_UNQUOTED([TK_VERSION], "$TK_VERSION", "Version of Tk")
1970
AC_SUBST(TK_VERSION)
1882
AC_SUBST(TK_VERSION)
1971
TK_LIBRARY='${prefix}/lib/tk${TK_VERSION}'
1883
TK_LIBRARY='${prefix}/lib/tk${TK_VERSION}'
Lines 1984-2020 Link Here
1984
dnl See if libitcl and libitk seem to work, make sure it's not dependant upon libtcl
1896
dnl See if libitcl and libitk seem to work, make sure it's not dependant upon libtcl
1985
itcl_works=no
1897
itcl_works=no
1986
AC_MSG_CHECKING(for incrTcl library functionality)
1898
AC_MSG_CHECKING(for incrTcl library functionality)
1987
PRELIBS="$LIBS"
1899
1988
if test "x$itcl_link_works" = "xyes" ; then
1900
if test -f ${TCL_BIN_DIR}/itclConfig.sh; then
1989
	LIBS="$LIBS $LIBITCL $LIBTCL"
1901
	. ${TCL_BIN_DIR}/itclConfig.sh
1990
fi
1902
	if test ITCL_VERSION; then
1991
AC_TRY_RUN([
1903
		itcl_works=ok
1992
#include <itcl.h>
1904
	fi
1993
#ifndef ITCL_MAJOR_VERSION
1994
#  error Unknown major version of incrTcl
1995
#endif
1996
#ifndef ITCL_MINOR_VERSION
1997
#  error Unknown minor version of incrTcl
1998
#endif
1999
#include <stdio.h>
2000
int main() {
2001
    Itcl_Stack stack;
2002
    Itcl_InitStack(&stack);
2003
#if ITCL_MAJOR_VERSION < 3
2004
    fprintf(stderr, "major version < 3\n");
2005
    return 1;
2006
#elif ITCl_MAJOR_VERSION == 3 && ITCL_MINOR_VERSION < 2
2007
    fprintf(stderr, "minorversion < 2\n");
2008
    return 1;
2009
#endif
2010
    return 0;
2011
}
2012
	],
2013
	[itcl_works=yes]
2014
)
2015
if test "x$itcl_link_works" = "xyes" ; then
2016
	LIBS="$PRELIBS"
2017
fi
1905
fi
1906
2018
AC_MSG_RESULT($itcl_works)
1907
AC_MSG_RESULT($itcl_works)
2019
1908
2020
dnl figure out whether we need to build incrTcl
1909
dnl figure out whether we need to build incrTcl
Lines 2059-2095 Link Here
2059
1948
2060
dnl *** iwidgets ***
1949
dnl *** iwidgets ***
2061
dnl See if the iwidgets are available
1950
dnl See if the iwidgets are available
2062
iwidgets_works=no
1951
2063
AC_MSG_CHECKING(for iwidgets functionality)
1952
dnl ************************************************
2064
PRELIBS="$LIBS"
1953
dnl Nasty. Did not find a m4 or config.sh file to
2065
if test "x$tcl_link_works" = "xyes" ; then
1954
dnl test for iwidgets. Removing test for now
2066
	LIBS="$LIBS $LIBTCL"
1955
dnl to test if the other changes are correct.
2067
fi
1956
dnl ***********************************************
2068
dnl this test is probably not sufficient if iwidgets is not locateable
1957
iwidgets_works=yes
2069
dnl in the tcl auto_path.
2070
AC_TRY_RUN([
2071
#ifdef HAVE_TCL_H
2072
#  include <tcl.h>
2073
#endif
2074
int main() {
2075
    Tcl_Interp *interp;
2076
    const char *cmd = "package require Iwidgets";
2077
    interp = Tcl_CreateInterp();
2078
    if (Itcl_Init(interp) == TCL_ERROR) {
2079
	return 1;
2080
    }
2081
    if (Tcl_Eval(interp, cmd) != TCL_OK || interp->result[0] == '\0') {
2082
	return 1;
2083
    }
2084
    return 0;
2085
}
2086
	],
2087
	[iwidgets_works=yes]
2088
)
2089
if test "x$tcl_link_works" = "xyes" ; then
2090
	LIBS="$PRELIBS"
2091
fi
2092
AC_MSG_RESULT($iwidgets_works)
2093
1958
2094
dnl figure out whether we need to install the iwidgets package
1959
dnl figure out whether we need to install the iwidgets package
2095
build_brlcad_iwidgets="no (using system)"
1960
build_brlcad_iwidgets="no (using system)"

Return to bug 77197