From c61430660f5c657a7ef2344cf3541687abfc1e67 Mon Sep 17 00:00:00 2001 From: William Joye Date: Fri, 27 Jan 2017 11:26:18 -0500 Subject: simplify build --- ds9/macosx/Makefile.in | 18 ++++--------- ds9/make.include | 8 ++++++ ds9/unix/Makefile.in | 16 +++++------- ds9/unix/configure | 69 +++++++++++++++++++++++++++++++++++++++++++++++++- ds9/unix/configure.ac | 2 +- ds9/win/Makefile.in | 21 +++++++-------- 6 files changed, 97 insertions(+), 37 deletions(-) diff --git a/ds9/macosx/Makefile.in b/ds9/macosx/Makefile.in index d6ba339..df97176 100644 --- a/ds9/macosx/Makefile.in +++ b/ds9/macosx/Makefile.in @@ -9,6 +9,8 @@ datarootdir = @datarootdir@ datadir = @datadir@ mandir = @mandir@ +TCLSH_PROG = @TCLSH_PROG@ + TCL_VERSION = @TCL_VERSION@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_STUB_LIB_SPEC= @TCL_STUB_LIB_SPEC@ @@ -64,18 +66,16 @@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) .C.@OBJEXT@: $(COMPILE) -c $< -o $@ -include ../make.include - #--------------------------defines APPDIR = $(bindir)/SAOImage\ DS9.app +TKSAORES= $(bindir)/SAOImage\ DS9.app/Contents/Frameworks/Tksao.framework/Resources ID = $(shell finger $(shell whoami) | egrep -o 'Name: [a-zA-Z0-9 ]{1,}' | cut -d ':' -f 2 | xargs echo) OBJS = ds9.o tkAppInit.o TKSAOFW = $(bindir)/SAOImage\ DS9.app/Contents/Frameworks/Tksao.framework -TKSAORES= $(bindir)/SAOImage\ DS9.app/Contents/Frameworks/Tksao.framework/Resources TCLFW = $(bindir)/SAOImage\ DS9.app/Contents/Frameworks/Tcl.framework TCLRES = $(bindir)/SAOImage\ DS9.app/Contents/Frameworks/Tcl.framework/Resources TKFW = $(bindir)/SAOImage\ DS9.app/Contents/Frameworks/Tk.framework @@ -153,20 +153,12 @@ ds9base : $(OBJS) $(TK_LIBS) \ $(LIBS) +include ../make.include + appdir : rm -rf $(APPDIR) cp -rp SAOImage\ DS9.app $(bindir)/. -framework: - cp -pr ../library $(TKSAORES)/. - cp -pr ../msgs $(TKSAORES)/. - cp -pr ../doc $(TKSAORES)/. - cp -pr ../cmaps $(TKSAORES)/. - cp -pr ../template $(TKSAORES)/. - - rm $(TKSAORES)/library/source.tcl - echo "pkg_mkIndex $(TKSAORES)/library *.tcl; exit" | $(bindir)/tclsh8.6 - tcl : cp -p $(prefix)/build/tcl/Tcl.framework/Versions/8.6/Tcl $(TCLFW)/. cp -pr $(prefix)/build/tcl/Tcl.framework/Versions/8.6/Resources/* $(TCLRES)/. diff --git a/ds9/make.include b/ds9/make.include index e69de29..96699f8 100644 --- a/ds9/make.include +++ b/ds9/make.include @@ -0,0 +1,8 @@ +framework: + cp -pr $(prefix)/ds9/library $(TKSAORES)/. + cp -pr $(prefix)/ds9/msgs $(TKSAORES)/. + cp -pr $(prefix)/ds9/doc $(TKSAORES)/. + cp -pr $(prefix)/ds9/cmaps $(TKSAORES)/. + cp -pr $(prefix)/ds9/template $(TKSAORES)/. + echo "pkg_mkIndex $(TKSAORES)/library *.tcl; exit" | $(TCLSH_PROG) + diff --git a/ds9/unix/Makefile.in b/ds9/unix/Makefile.in index c25c3f8..4b93160 100644 --- a/ds9/unix/Makefile.in +++ b/ds9/unix/Makefile.in @@ -9,6 +9,8 @@ datarootdir = @datarootdir@ datadir = @datadir@ mandir = @mandir@ +TCLSH_PROG = @TCLSH_PROG@ + TCL_VERSION = @TCL_VERSION@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_STUB_LIB_SPEC= @TCL_STUB_LIB_SPEC@ @@ -66,11 +68,10 @@ system = @system@ .C.@OBJEXT@: $(COMPILE) -c `@CYGPATH@ $<` -o $@ -include ../make.include - #--------------------------defines APPDIR = zvfsmntpt +TKSAORES= $(APPDIR) ID = $(shell finger $(shell whoami) | egrep -o 'Name: [a-zA-Z0-9 ]{1,}' | cut -d ':' -f 2 | xargs echo) @@ -176,17 +177,12 @@ tkAppInit.o : tkAppInit.c tkAppInit.c : $(prefix)/tk$(TCL_VERSION)/unix/tkAppInit.c cp $(prefix)/tk$(TCL_VERSION)/unix/tkAppInit.c . -$(APPDIR) : +include ../make.include + +$(APPDIR) : rm -rf $(APPDIR) mkdir $@ -framework : - cp -r ../library $(APPDIR)/. - cp -r ../msgs $(APPDIR)/. - cp -r ../doc $(APPDIR)/. - cp -r ../cmaps $(APPDIR)/. - cp -r ../template $(APPDIR)/. - $(APPDIR)/tcl$(TCL_VERSION) : $(prefix)/lib/tcl$(TCL_VERSION) cp -r $(prefix)/lib/tcl$(TCL_VERSION) $(APPDIR)/. diff --git a/ds9/unix/configure b/ds9/unix/configure index b932b28..ac97db0 100755 --- a/ds9/unix/configure +++ b/ds9/unix/configure @@ -620,6 +620,7 @@ ac_includes_default="\ ac_subst_vars='LTLIBOBJS LIBOBJS +TCLSH_PROG PRACTCL_NAME_LIBRARY PRACTCL_VC_MANIFEST_EMBED_EXE PRACTCL_VC_MANIFEST_EMBED_DLL @@ -946,6 +947,7 @@ enable_rpath enable_wince with_celib enable_symbols +with_tclsh ' ac_precious_vars='build_alias host_alias @@ -1607,6 +1609,7 @@ Optional Packages: --with-tkinclude directory containing the public Tk header files --with-x use the X Window System --with-celib=DIR use Windows/CE support library from DIR + --with-tclsh Specify a local tcl shell to use for dynamic code Some influential environment variables: CC C compiler command @@ -14813,7 +14816,71 @@ rm -f conftest* # a pkgIndex.tcl file or anything else at extension build time. #-------------------------------------------------------------------- -#TEA_PROG_TCLSH + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tclsh" >&5 +$as_echo_n "checking for tclsh... " >&6; } + + +# Check whether --with-tclsh was given. +if test "${with_tclsh+set}" = set; then : + withval=$with_tclsh; with_tclsh=${withval} +fi + + # Use the value from --with-tclsh, if it was given + TCLSH_PROG=0 + if test x"${with_tclsh}" != x ; then + if test -f "${with_tclsh}" ; then + TCLSH_PROG=${with_tclsh} + else + if test -f "${with_tclsh}/tcl8.6" ; then + TCLSH_PROG="${with_tclsh}/tcl8.6" + else + if test -f "${with_tclsh}/tclsh86.exe" ; then + TCLSH_PROG="${with_tclsh}/tclsh86.exe" + else + as_fn_error $? "${with_tclsh} does not point to a valid Tcl executable" "$LINENO" 5 + fi + fi + fi + else + if test -f "${TCL_BIN_DIR}/Makefile" ; then + # tclConfig.sh is in Tcl build directory + if test "${TEA_PLATFORM}" = "windows"; then + if test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" ; then + TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}s${EXEEXT}" ; then + TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}s${EXEEXT}" + elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}t${EXEEXT}" ; then + TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}t${EXEEXT}" + elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}st${EXEEXT}" ; then + TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}st${EXEEXT}" + fi + else + TCLSH_PROG="${TCL_BIN_DIR}/tclsh" + fi + else + # tclConfig.sh is in install location + if test "${TEA_PLATFORM}" = "windows"; then + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" + else + TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" + fi + list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ + `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ + `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" + for i in $list ; do + if test -f "$i/${TCLSH_PROG}" ; then + REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" + break + fi + done + TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${TCLSH_PROG}" >&5 +$as_echo "${TCLSH_PROG}" >&6; } + + #TEA_PROG_WISH #-------------------------------------------------------------------- diff --git a/ds9/unix/configure.ac b/ds9/unix/configure.ac index 3a1486c..93b9243 100644 --- a/ds9/unix/configure.ac +++ b/ds9/unix/configure.ac @@ -240,7 +240,7 @@ TEA_MAKE_LIB # a pkgIndex.tcl file or anything else at extension build time. #-------------------------------------------------------------------- -#TEA_PROG_TCLSH +TEA_PROG_TCLSH #TEA_PROG_WISH #-------------------------------------------------------------------- diff --git a/ds9/win/Makefile.in b/ds9/win/Makefile.in index 20b19df..af02f16 100755 --- a/ds9/win/Makefile.in +++ b/ds9/win/Makefile.in @@ -9,6 +9,8 @@ datarootdir = @datarootdir@ datadir = @datadir@ mandir = @mandir@ +TCLSH_PROG = @TCLSH_PROG@ + TCL_VERSION = @TCL_VERSION@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_STUB_LIB_SPEC= @TCL_STUB_LIB_SPEC@ @@ -63,25 +65,24 @@ STRIP = i686-w64-mingw32-strip.exe .C.@OBJEXT@: $(COMPILE) -DSTATIC_BUILD -c $< -o $@ -include ../make.include - #--------------------------defines APPDIR = $(bindir)/ds9app +TKSAORES= $(APPDIR) OBJS = ds9.o winMain.o ds9.res.o #--------------------------main .NOTPARALLEL : -.PHONY : ds9 debug appdir framework tcltk tcllib tkcon tkblt xpa cleanup +.PHONY : ds9 debug appdir framework frame2 tcltk tcllib tkcon tkblt xpa cleanup -ds9 : ds9Base$(EXEEXT) appdir framework tcltk tcllib tkcon tkblt xpa cleanup +ds9 : ds9Base$(EXEEXT) appdir framework frame2 tcltk tcllib tkcon tkblt xpa cleanup cp -p ds9base$(EXEEXT) ds9$(EXEEXT) $(STRIP) ds9$(EXEEXT) cp -p ds9$(EXEEXT) $(APPDIR)/. -debug : ds9Base$(EXEEXT) appdir framework tcltk tcllib tkcon tkblt cleanup +debug : ds9Base$(EXEEXT) appdir framework frame2 tcltk tcllib tkcon tkblt cleanup mv ds9base$(EXEEXT) ds9$(EXEEXT) cp -p ds9$(EXEEXT) $(APPDIR)/. @@ -135,18 +136,14 @@ ds9.res.o: ds9.rc ds9.ico --include $(prefix)/$(TCLDIR)/generic --include $(prefix)/tk$(TCL_VERSION)/win/rc \ ds9.rc +include ../make.include + appdir : rm -rf $(APPDIR) mkdir $(APPDIR) -framework: +frame2: cp install.vbs $(APPDIR)/. - cp -pr ../library $(APPDIR)/. - cp -pr ../msgs $(APPDIR)/. - cp -pr ../doc $(APPDIR)/. - cp -pr ../cmaps $(APPDIR)/. - cp -pr ../template $(APPDIR)/. - echo "pkg_mkIndex ../../bin/ds9app/library *.tcl; exit" | $(bindir)/tclsh86s tcltk : cp -pr $(prefix)/lib/tcl8 $(APPDIR)/. -- cgit v0.12