Changeset 11573 in project


Ignore:
Timestamp:
08/09/08 00:11:04 (13 years ago)
Author:
felix winkelmann
Message:

integrated setup tools into build (optional); some enhancements, mostly untested

Location:
chicken/branches/hygienic
Files:
1 deleted
8 edited
1 moved

Legend:

Unmodified
Added
Removed
  • chicken/branches/hygienic/Makefile.cross-linux-mingw

    r8361 r11573  
    7777# main target
    7878
     79ifndef BUILD_SETUP_TOOLS
    7980TARGETS = libchicken$(A) libuchicken$(A) chicken$(EXE) csi$(EXE) \
    8081        chicken-profile$(EXE) csc$(EXE) libchicken$(SO) \
    8182        libuchicken$(SO) chicken-setup$(EXE) chicken.info \
    8283        libchickengui$(SO) chicken-bug$(EXE)
     84else
     85TARGETS = libchicken$(A) libuchicken$(A) chicken$(EXE) csi$(EXE) \
     86        chicken-profile$(EXE) csc$(EXE) libchicken$(SO) \
     87        libuchicken$(SO) chicken-install$(EXE) chicken-uninstall$(EXE) \
     88        chicken-status$(EXE) chicken.info \
     89        libchickengui$(SO) chicken-bug$(EXE)
     90endif
    8391
    8492chicken-config.h: chicken-defaults.h
  • chicken/branches/hygienic/Makefile.cygwin

    r9182 r11573  
    214214        echo "# define C_CSI_PROGRAM \"$(CSI_PROGRAM)\"" >>$@
    215215        echo "#endif" >>$@
    216         echo "#ifndef C_CHICKEN_PROFILE_PROGRAM" >>$@
    217         echo "# define C_CHICKEN_PROFILE_PROGRAM \"$(CHICKEN_PROFILE_PROGRAM)\"" >>$@
    218         echo "#endif" >>$@
    219         echo "#ifndef C_CHICKEN_SETUP_PROGRAM" >>$@
    220         echo "# define C_CHICKEN_SETUP_PROGRAM \"$(CHICKEN_SETUP_PROGRAM)\"" >>$@
    221         echo "#endif" >>$@
    222216        echo "#ifndef C_CHICKEN_BUG_PROGRAM" >>$@
    223217        echo "# define C_CHICKEN_BUG_PROGRAM \"$(CHICKEN_BUG_PROGRAM)\"" >>$@
  • chicken/branches/hygienic/Makefile.msvc

    r10788 r11573  
    144144CSC_MANIFEST = $(CSC_PROGRAM)$(EXE)$(MANIFEST)
    145145CHICKEN_BUG_MANIFEST = $(CHICKEN_BUG_PROGRAM)$(EXE)$(MANIFEST)
     146ifndef BUILD_SETUP_TOOLS
    146147CHICKEN_SETUP_MANIFEST = $(CHICKEN_SETUP_PROGRAM)$(EXE)$(MANIFEST)
    147 
    148148CLEAN_MANIFESTS = $(CHICKEN_MANIFEST) $(CSI_MANIFEST) $(CHICKEN_PROFILE_MANIFEST) \
    149149                  $(CSC_MANIFEST) $(CHICKEN_BUG_MANIFEST) $(CHICKEN_SETUP_MANIFEST) \
    150150                  $(LIBCHICKEN_SO_FILE)$(MANIFEST) $(LIBUCHICKEN_SO_FILE)$(MANIFEST) \
    151151                  $(LIBCHICKENGUI_SO_FILE)$(MANIFEST)
     152else
     153CHICKEN_INSTALL_MANIFEST = $(CHICKEN_INSTALL_PROGRAM)$(EXE)$(MANIFEST)
     154CHICKEN_UNINSTALL_MANIFEST = $(CHICKEN_UNINSTALL_PROGRAM)$(EXE)$(MANIFEST)
     155CHICKEN_STATUS_MANIFEST = $(CHICKEN_STATUS_PROGRAM)$(EXE)$(MANIFEST)
     156CLEAN_MANIFESTS = $(CHICKEN_MANIFEST) $(CSI_MANIFEST) $(CHICKEN_PROFILE_MANIFEST) \
     157                  $(CSC_MANIFEST) $(CHICKEN_BUG_MANIFEST) $(CHICKEN_INSTALL_MANIFEST) \
     158                  $(CHICKEN_UNINSTALL_MANIFEST) $(CHICKEN_STATUS_MANIFEST) \
     159                  $(LIBCHICKEN_SO_FILE)$(MANIFEST) $(LIBUCHICKEN_SO_FILE)$(MANIFEST) \
     160                  $(LIBCHICKENGUI_SO_FILE)$(MANIFEST)
     161endif
    152162
    153163# special files
  • chicken/branches/hygienic/chicken-install.scm

    r11558 r11573  
    4444          srfi-13)
    4545  (import setup-utils setup-download)
     46 
     47  #+(not csi) (import foreign)
    4648
    4749  (define *program-path*
     
    5052        (cond-expand
    5153         (csi (make-pathname (current-directory) "bin"))                        ; just for debugging
    52          (foreign-value "C_INSTALL_BIN_HOME" c-string) ) ))
     54         (else (foreign-value "C_INSTALL_BIN_HOME" c-string) ) )) )
    5355
    5456  (define *default-transport* #f)
     
    5759  (define *force* #f)
    5860  (define *sudo* #f)
     61  (define *prefix* #f)
     62  (define *host-extension* #f)
    5963
    6064  (define (load-defaults)
    61     (let* ((deff (make-pathname (repository-path) "DEFAULTS"))
     65    (let* ((deff (make-pathname (repository-path) "setup.defaults"))
    6266           (def (cond ((file-exists? deff)
    6367                       (with-input-from-file deff read))
     
    137141                          (retrieve missing))
    138142                        (when (and (pair? upgrade)
    139                                    (yes-or-no?
    140                                     (string-concatenate
    141                                      (append
    142                                       (list "The following installed extensions are outdated, because `"
    143                                             (car e+d) "' requires later versions:\n")
    144                                       (map (lambda (e)
    145                                              (sprintf
    146                                               "  ~a (~a -> ~a)~%"
    147                                               (car e)
    148                                               (let ((v (assq 'version (extension-information (car e)))))
    149                                                 (if v (cadr v) "???"))
    150                                               (cdr e)))
    151                                            upgrade)
    152                                       '("\nDo you want to replace the existing extensions?")))
    153                                     "no") )
     143                                   (or *force*
     144                                       (yes-or-no?
     145                                        (string-concatenate
     146                                         (append
     147                                          (list "The following installed extensions are outdated, because `"
     148                                                (car e+d) "' requires later versions:\n")
     149                                          (map (lambda (e)
     150                                                 (sprintf
     151                                                  "  ~a (~a -> ~a)~%"
     152                                                  (car e)
     153                                                  (let ((v (assq 'version (extension-information (car e)))))
     154                                                    (if v (cadr v) "???"))
     155                                                  (cdr e)))
     156                                               upgrade)
     157                                          '("\nDo you want to replace the existing extensions?")))
     158                                        "no") ) )
    154159                          (let ((ueggs (unzip1 upgrade)))
    155160                            (print " upgrade: " (string-intersperse ueggs ", "))
     
    172177       (lambda (e+d)
    173178         (print "installing " (car e+d) " ...")
    174          (print "cd'ing to " (cdr e+d))
     179         (print "changing current directory to " (cdr e+d))
    175180         (parameterize ((current-directory (cdr e+d)))
    176181           (let ((cmd (sprintf
    177                        "~a/csi -e \"(require-library setup-api)\" -e \"(import setup-api)\" -e \"~a\" \"~a\""
     182                       "~a/csi -e \"(require-library setup-api)\" -e \"(import setup-api)\" ~a ~a ~a ~a ~a"
    178183                       *program-path*
    179                        (if *sudo* "(use-sudo)" "(begin)")
     184                       (if *sudo* "-e \"(sudo-install #t)\"" "")
     185                       (if *keep* "-e \"(keep-intermediates #t)\"" "")
     186                       (if *host-extension* "-e \"(host-extension #t)\"" "")
     187                       (if *prefix*
     188                           (sprintf "-e \"(installation-prefix \\\"~a\\\")\"" *prefix*)
     189                           "")
    180190                       (make-pathname (cdr e+d) (car e+d) "setup"))))
    181191             (system* cmd))))
     
    183193
    184194  (define (cleanup)
    185     (and-let* ((tmpdir (temporary-directory)))
    186       (print "removing temporary directory " tmpdir)
    187       (remove-directory tmpdir)))
     195    (unless *keep*
     196      (and-let* ((tmpdir (temporary-directory)))
     197        (print "removing temporary directory " tmpdir)
     198        (remove-directory tmpdir))))
    188199
    189200  (define (usage code)
     
    197208  -t   -transport TRANSPORT     use given transport instead of default (#{*default-transport*})
    198209  -s   -sudo                    use sudo(1) for installing or removing files
     210  -p   -prefix PREFIX           change installation prefix to PREFIX
     211       -host-extension          when cross-compiling, compile extension for host
    199212EOF
    200213);|
    201214    (exit code))
    202215
    203   (define *short-options* '(#\h #\f #\k #\l #\t #\s))
     216  (define *short-options* '(#\h #\f #\k #\l #\t #\s #\p))
    204217
    205218  (define (main args)
     
    238251                     (set! *default-transport* (string->symbol (cadr args)))
    239252                     (loop (cddr args) eggs))
     253                    ((or (string=? arg "-p") (string=? arg "-prefix"))
     254                     (unless (pair? (cdr args)) (usage 1))
     255                     (set! *prefix* (cadr args))
     256                     (loop (cddr args) eggs))
     257                    ((string=? "-host-extension" arg)
     258                     (set! *host-extension* #t)
     259                     (loop (cddr args) eggs))
    240260                    ((and (positive? (string-length arg))
    241261                          (char=? #\- (string-ref arg 0)))
  • chicken/branches/hygienic/defaults.make

    r11149 r11573  
    302302CHICKEN_COMPILER_OPTIONS = $(CHICKEN_PROGRAM_OPTIONS) -extend private-namespace.scm
    303303CHICKEN_UNSAFE_OPTIONS = -unsafe -no-lambda-info
    304 CHICKEN_IMPORT_LIBRARY_OPTIONS = $(CHICKEN_OPTIONS) -feature chicken-compile-shared -dynamic
     304CHICKEN_DYNAMIC_OPTIONS = $(CHICKEN_OPTIONS) -feature chicken-compile-shared -dynamic
     305CHICKEN_IMPORT_LIBRARY_OPTIONS = $(CHICKEN_DYNAMIC_OPTIONS)
    305306
    306307ifneq ($(USE_HOST_PCRE),)
     
    316317CSI_PROGRAM = $(PROGRAM_PREFIX)csi$(PROGRAM_SUFFIX)
    317318CHICKEN_PROFILE_PROGRAM = $(PROGRAM_PREFIX)chicken-profile$(PROGRAM_SUFFIX)
     319ifndef BUILD_SETUP_TOOLS
    318320CHICKEN_SETUP_PROGRAM = $(PROGRAM_PREFIX)chicken-setup$(PROGRAM_SUFFIX)
     321else
     322CHICKEN_INSTALL_PROGRAM = $(PROGRAM_PREFIX)chicken-install$(PROGRAM_SUFFIX)
     323CHICKEN_UNINSTALL_PROGRAM = $(PROGRAM_PREFIX)chicken-uninstall$(PROGRAM_SUFFIX)
     324CHICKEN_STATUS_PROGRAM = $(PROGRAM_PREFIX)chicken-status$(PROGRAM_SUFFIX)
     325endif
    319326CHICKEN_BUG_PROGRAM = $(PROGRAM_PREFIX)chicken-bug$(PROGRAM_SUFFIX)
    320327IMPORT_LIBRARIES = chicken lolevel srfi-1 srfi-4 data-structures ports posix srfi-13 srfi-69 extras \
    321328        regex srfi-14 tcp foreign scheme srfi-18 utils csi
     329ifdef BUILD_SETUP_TOOLS
     330IMPORT_LIBRARIES += setup-api setup-download setup-utils
     331endif
    322332
    323333ifdef STATICBUILD
     
    338348TARGETLIBS ?= libchicken$(A) libuchicken$(A) \
    339349        $(LIBCHICKEN_SO_FILE) $(LIBUCHICKEN_SO_FILE)
     350ifndef BUILD_SETUP_TOOLS
    340351TARGETS ?= $(TARGETLIBS) $(CHICKEN_SHARED_EXECUTABLE) \
    341352        $(CSI_SHARED_EXECUTABLE) $(CHICKEN_PROFILE_PROGRAM)$(EXE) \
     
    343354        $(CHICKEN_BUG_PROGRAM)$(EXE) \
    344355        $(IMPORT_LIBRARIES:=.import.so)
     356else
     357TARGETS ?= $(TARGETLIBS) $(CHICKEN_SHARED_EXECUTABLE) \
     358        $(CSI_SHARED_EXECUTABLE) $(CHICKEN_PROFILE_PROGRAM)$(EXE) \
     359        $(CSC_PROGRAM)$(EXE) $(CHICKEN_INSTALL_PROGRAM)$(EXE) $(CHICKEN_UNINSTALL_PROGRAM)$(EXE) \
     360        $(CHICKEN_STATUS_PROGRAM)$(EXE) setup-utils.so setup-download.so setup-api.so \
     361        chicken.info $(CHICKEN_BUG_PROGRAM)$(EXE) \
     362        $(IMPORT_LIBRARIES:=.import.so)
     363endif
    345364endif
    346365
     
    452471        echo "# define C_CSI_PROGRAM \"$(CSI_PROGRAM)\"" >>$@
    453472        echo "#endif" >>$@
    454         echo "#ifndef C_CHICKEN_PROFILE_PROGRAM" >>$@
    455         echo "# define C_CHICKEN_PROFILE_PROGRAM \"$(CHICKEN_PROFILE_PROGRAM)\"" >>$@
    456         echo "#endif" >>$@
    457         echo "#ifndef C_CHICKEN_SETUP_PROGRAM" >>$@
    458         echo "# define C_CHICKEN_SETUP_PROGRAM \"$(CHICKEN_SETUP_PROGRAM)\"" >>$@
    459         echo "#endif" >>$@
    460473        echo "#ifndef C_CHICKEN_BUG_PROGRAM" >>$@
    461474        echo "# define C_CHICKEN_BUG_PROGRAM \"$(CHICKEN_BUG_PROGRAM)\"" >>$@
  • chicken/branches/hygienic/distribution/manifest

    r11542 r11573  
    311311chicken-install.scm
    312312chicken-uninstall.scm
    313 DEFAULTS
     313setup.defaults
  • chicken/branches/hygienic/rules.make

    r11324 r11573  
    492492          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
    493493          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     494ifdef BUILD_SETUP_TOOLS
     495setup-api.import$(O): setup-api.import.c chicken.h $(CHICKEN_CONFIG_H)
     496        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     497          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     498          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     499setup-download.import$(O): setup-download.import.c chicken.h $(CHICKEN_CONFIG_H)
     500        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     501          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     502          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     503setup-utils.import$(O): setup-utils.import.c chicken.h $(CHICKEN_CONFIG_H)
     504        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     505          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     506          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     507endif
     508
     509# setup extension objects
     510ifdef BUILD_SETUP_TOOLS
     511setup-api$(O): setup-api.c chicken.h $(CHICKEN_CONFIG_H)
     512        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     513          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     514          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     515setup-download$(O): setup-download.c chicken.h $(CHICKEN_CONFIG_H)
     516        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     517          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     518          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     519setup-utils$(O): setup-utils.c chicken.h $(CHICKEN_CONFIG_H)
     520        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     521          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     522          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     523endif
    494524
    495525# compiler objects
     
    726756        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) $(C_COMPILER_SHARED_OPTIONS) \
    727757          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< $(C_COMPILER_OUTPUT)
     758ifndef BUILD_SETUP_TOOLS
    728759chicken-setup$(O): chicken-setup.c chicken.h $(CHICKEN_CONFIG_H)
    729760        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) $(C_COMPILER_SHARED_OPTIONS) \
    730761          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< $(C_COMPILER_OUTPUT)
     762else
     763chicken-install$(O): chicken-install.c chicken.h $(CHICKEN_CONFIG_H)
     764        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) $(C_COMPILER_SHARED_OPTIONS) \
     765          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< $(C_COMPILER_OUTPUT)
     766chicken-uninstall$(O): chicken-uninstall.c chicken.h $(CHICKEN_CONFIG_H)
     767        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) $(C_COMPILER_SHARED_OPTIONS) \
     768          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< $(C_COMPILER_OUTPUT)
     769chicken-status$(O): chicken-status.c chicken.h $(CHICKEN_CONFIG_H)
     770        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) $(C_COMPILER_SHARED_OPTIONS) \
     771          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< $(C_COMPILER_OUTPUT)
     772endif
    731773csc$(O): csc.c chicken.h $(CHICKEN_CONFIG_H)
    732774        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) $(C_COMPILER_SHARED_OPTIONS) \
     
    800842        $(LIBRARIAN) $(LIBRARIAN_OPTIONS) $(LIBRARIAN_OUTPUT) $^
    801843
    802 # import libraries
    803 
    804 .SUFFIXES: .import.so
    805 
    806 %.import.so: %.import.o
     844# import libraries and extensions
     845
     846.SUFFIXES: .so
     847
     848%.so: %.o
    807849        $(HOST_LINKER) $(HOST_LINKER_OPTIONS) $(HOST_LINKER_LINK_DLOADABLE_OPTIONS) $^ $(HOST_LINKER_OUTPUT_OPTION) $@ \
    808850          $(HOST_LINKER_LIBRARY_PREFIX)chicken$(HOST_LINKER_LIBRARY_SUFFIX) \
     
    819861          $(LINKER_LIBRARY_PREFIX)chicken$(LINKER_LIBRARY_SUFFIX) $(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $(LIBRARIES)
    820862
     863ifndef BUILD_SETUP_TOOLS
    821864$(CHICKEN_SETUP_PROGRAM)$(EXE): chicken-setup$(O) $(PRIMARY_LIBCHICKEN)
    822865        $(LINKER) $(LINKER_OPTIONS) $(LINKER_EXECUTABLE_OPTIONS) $< $(LINKER_OUTPUT) \
    823866          $(LINKER_LIBRARY_PREFIX)chicken$(LINKER_LIBRARY_SUFFIX) $(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $(LIBRARIES)
     867else
     868$(CHICKEN_INSTALL_PROGRAM)$(EXE): chicken-install$(O) $(PRIMARY_LIBCHICKEN)
     869        $(LINKER) $(LINKER_OPTIONS) $(LINKER_EXECUTABLE_OPTIONS) $< $(LINKER_OUTPUT) \
     870          $(LINKER_LIBRARY_PREFIX)chicken$(LINKER_LIBRARY_SUFFIX) $(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $(LIBRARIES)
     871$(CHICKEN_UNINSTALL_PROGRAM)$(EXE): chicken-uninstall$(O) $(PRIMARY_LIBCHICKEN)
     872        $(LINKER) $(LINKER_OPTIONS) $(LINKER_EXECUTABLE_OPTIONS) $< $(LINKER_OUTPUT) \
     873          $(LINKER_LIBRARY_PREFIX)chicken$(LINKER_LIBRARY_SUFFIX) $(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $(LIBRARIES)
     874$(CHICKEN_STATUS_PROGRAM)$(EXE): chicken-status$(O) $(PRIMARY_LIBCHICKEN)
     875        $(LINKER) $(LINKER_OPTIONS) $(LINKER_EXECUTABLE_OPTIONS) $< $(LINKER_OUTPUT) \
     876          $(LINKER_LIBRARY_PREFIX)chicken$(LINKER_LIBRARY_SUFFIX) $(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $(LIBRARIES)
     877endif
    824878
    825879$(CHICKEN_PROFILE_PROGRAM)$(EXE): chicken-profile$(O) $(PRIMARY_LIBCHICKEN)
     
    850904# installation
    851905
    852 .PHONY: install uninstall install-libs install-manifests install-import-libs
     906.PHONY: install uninstall install-libs install-manifests install-import-libs install-setup-files
    853907
    854908install-libs:
     
    906960        -$(INSTALL_PROGRAM) $(INSTALL_MANIFEST_OPTIONS) $(CHICKEN_BUG_MANIFEST) $(DESTDIR)$(IBINDIR)
    907961ifndef STATICBUILD
     962ifndef BUILD_SETUP_TOOLS
    908963        -$(INSTALL_PROGRAM) $(INSTALL_MANIFEST_OPTIONS) $(CHICKEN_SETUP_MANIFEST) $(DESTDIR)$(IBINDIR)
     964else
     965        -$(INSTALL_PROGRAM) $(INSTALL_MANIFEST_OPTIONS) $(CHICKEN_INSTALL_MANIFEST) $(DESTDIR)$(IBINDIR)
     966        -$(INSTALL_PROGRAM) $(INSTALL_MANIFEST_OPTIONS) $(CHICKEN_UNINSTALL_MANIFEST) $(DESTDIR)$(IBINDIR)
     967        -$(INSTALL_PROGRAM) $(INSTALL_MANIFEST_OPTIONS) $(CHICKEN_STATUS_MANIFEST) $(DESTDIR)$(IBINDIR)
     968endif
    909969endif
    910970endif
     
    912972ifeq ($(NEEDS_RELINKING),yes)
    913973install:
     974ifndef BUILD_SETUP_TOOLS
    914975        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(CHICKEN_PROGRAM)$(EXE) \
    915976          $(CSI_PROGRAM)$(EXE) $(CSC_PROGRAM)$(EXE) $(CHICKEN_PROFILE_PROGRAM)$(EXE) \
    916977          $(CHICKEN_SETUP_PROGRAM)$(EXE)
     978else
     979        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(CHICKEN_PROGRAM)$(EXE) \
     980          $(CSI_PROGRAM)$(EXE) $(CSC_PROGRAM)$(EXE) $(CHICKEN_PROFILE_PROGRAM)$(EXE) \
     981          $(CHICKEN_INSTALL_PROGRAM)$(EXE) $(CHICKEN_UNINSTALL_PROGRAM)$(EXE) \
     982          $(CHICKEN_STATUS_PROGRAM)$(EXE)
     983endif
    917984        $(MAKE) NEEDS_RELINKING=no RUNTIME_LINKER_PATH=$(LIBDIR) install
    918985        $(MAKE_WRITABLE_COMMAND) $(CHICKEN_PROGRAM)$(EXE) $(CSI_PROGRAM)$(EXE) \
    919986          $(CSC_PROGRAM)$(EXE) $(CHICKEN_PROFILE_PROGRAM)$(EXE)
    920987ifndef STATICBUILD
     988ifndef BUILD_SETUP_TOOLS
    921989        $(MAKE_WRITABLE_COMMAND) $(CHICKEN_SETUP_PROGRAM)$(EXE)
    922 endif
    923 else
     990else
     991        $(MAKE_WRITABLE_COMMAND) $(CHICKEN_INSTALL_PROGRAM)$(EXE)
     992        $(MAKE_WRITABLE_COMMAND) $(CHICKEN_UNINSTALL_PROGRAM)$(EXE)
     993        $(MAKE_WRITABLE_COMMAND) $(CHICKEN_STATUS_PROGRAM)$(EXE)
     994endif
     995endif
     996else
     997ifndef BUILD_SETUP_TOOLS
    924998install: $(TARGETS) install-libs install-import-libs install-manifests
     999else
     1000install: $(TARGETS) install-libs install-import-libs install-manifests install-setup-files
     1001endif
    9251002ifneq ($(DESTDIR),)
    9261003        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)
     
    9421019        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IBINDIR)/$(CSC_PROGRAM)
    9431020        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IBINDIR)/$(CHICKEN_BUG_PROGRAM)
     1021ifdef BUILD_SETUP_TOOLS
     1022        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/setup-api.so
     1023        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/setup-download.so
     1024        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/setup-utils.so
     1025        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/setup-api.import.so
     1026        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/setup-download.import.so
     1027        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/setup-utils.import.so
     1028endif
    9441029        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/chicken.import.so
    9451030        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/lolevel.import.so
     
    9621047endif
    9631048ifndef STATICBUILD
     1049ifndef BUILD_SETUP_TOOLS
    9641050        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(CHICKEN_SETUP_PROGRAM)$(EXE) \
    9651051          $(DESTDIR)$(IBINDIR)
     1052else
     1053        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(CHICKEN_INSTALL_PROGRAM)$(EXE) $(DESTDIR)$(IBINDIR)
     1054        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(CHICKEN_UNINSTALL_PROGRAM)$(EXE) $(DESTDIR)$(IBINDIR)
     1055        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(CHICKEN_STATUS_PROGRAM)$(EXE) $(DESTDIR)$(IBINDIR)
     1056endif
    9661057ifneq ($(POSTINSTALL_PROGRAM),true)
     1058ifndef BUILD_SETUP_TOOLS
    9671059        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IBINDIR)/$(CHICKEN_SETUP_PROGRAM)
     1060else
     1061        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IBINDIR)/$(CHICKEN_INSTALL_PROGRAM)
     1062        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IBINDIR)/$(CHICKEN_UNINSTALL_PROGRAM)
     1063        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IBINDIR)/$(CHICKEN_STATUS_PROGRAM)
     1064endif
    9681065endif
    9691066endif
     
    9951092endif
    9961093
     1094ifndef BUILD_SETUP_TOOLS
     1095install-setup-files:
     1096else
     1097install-setup-files:
     1098        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) setup.defaults $(DESTDIR)$(IEGGDIR)
     1099        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) setup-api.so $(DESTDIR)$(IEGGDIR)
     1100        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) setup-download.so $(DESTDIR)$(IEGGDIR)
     1101        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) setup-utils.so $(DESTDIR)$(IEGGDIR)
     1102endif
     1103
    9971104uninstall:
     1105ifndef BUILD_SETUP_TOOLS
    9981106        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(IBINDIR)/$(CHICKEN_PROGRAM)$(EXE) \
    9991107          $(DESTDIR)$(IBINDIR)/$(CSI_PROGRAM)$(EXE) $(DESTDIR)$(IBINDIR)/$(CHICKEN_PROFILE_PROGRAM)$(EXE) \
    10001108          $(DESTDIR)$(IBINDIR)/$(CHICKEN_SETUP_PROGRAM)$(EXE) $(DESTDIR)$(IBINDIR)/$(CSC_PROGRAM)$(EXE) \
    10011109          $(DESTDIR)$(IBINDIR)/$(CHICKEN_BUG_PROGRAM)$(EXE)
     1110else
     1111        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(IBINDIR)/$(CHICKEN_PROGRAM)$(EXE) \
     1112          $(DESTDIR)$(IBINDIR)/$(CSI_PROGRAM)$(EXE) $(DESTDIR)$(IBINDIR)/$(CHICKEN_PROFILE_PROGRAM)$(EXE) \
     1113          $(DESTDIR)$(IBINDIR)/$(CHICKEN_INSTALL_PROGRAM)$(EXE) \
     1114          $(DESTDIR)$(IBINDIR)/$(CHICKEN_UNINSTALL_PROGRAM)$(EXE) \
     1115          $(DESTDIR)$(IBINDIR)/$(CHICKEN_STATUS_PROGRAM)$(EXE) \
     1116          $(DESTDIR)$(IBINDIR)/$(CSC_PROGRAM)$(EXE) \
     1117          $(DESTDIR)$(IBINDIR)/$(CHICKEN_BUG_PROGRAM)$(EXE)
     1118endif
    10021119        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(ILIBDIR)/libchicken*.* $(DESTDIR)$(ILIBDIR)/libuchicken*.* $(DESTDIR)$(IBINDIR)/libchicken*.* $(DESTDIR)$(IBINDIR)/libuchicken*.*
    10031120ifdef ($(PLATFORM),cygwin)
     
    10051122endif
    10061123ifneq ($(CHICKEN_MANIFEST),)
     1124ifndef BUILD_SETUP_TOOLS
    10071125        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(IBINDIR)/$(CHICKEN_MANIFEST) \
    10081126        $(DESTDIR)$(IBINDIR)/$(CSI_MANIFEST) $(DESTDIR)$(IBINDIR)/$(CHICKEN_PROFILE_MANIFEST) \
    10091127        $(DESTDIR)$(IBINDIR)/$(CSC_MANIFEST) $(DESTDIR)$(IBINDIR)/$(CHICKEN_BUG_MANIFEST) \
    10101128        $(DESTDIR)$(IBINDIR)/$(CHICKEN_SETUP_MANIFEST)
     1129else
     1130        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(IBINDIR)/$(CHICKEN_MANIFEST) \
     1131        $(DESTDIR)$(IBINDIR)/$(CSI_MANIFEST) $(DESTDIR)$(IBINDIR)/$(CHICKEN_PROFILE_MANIFEST) \
     1132        $(DESTDIR)$(IBINDIR)/$(CSC_MANIFEST) $(DESTDIR)$(IBINDIR)/$(CHICKEN_BUG_MANIFEST) \
     1133        $(DESTDIR)$(IBINDIR)/$(CHICKEN_INSTALL_MANIFEST) \
     1134        $(DESTDIR)$(IBINDIR)/$(CHICKEN_UNINSTALL_MANIFEST) \
     1135        $(DESTDIR)$(IBINDIR)/$(CHICKEN_STATUS_MANIFEST)
     1136endif
    10111137endif
    10121138        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(IMANDIR)/chicken.1 $(DESTDIR)$(IMANDIR)/csi.1 \
     
    11401266utils.import.c: utils.import.scm
    11411267        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1268ifdef BUILD_SETUP_TOOLS
     1269setup-api.import.c: setup-api.import.scm setup-api.scm
     1270        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1271setup-download.import.c: setup-download.import.scm setup-download.scm
     1272        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1273setup-utils.import.c: setup-utils.import.scm setup-utils.scm
     1274        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1275endif
    11421276
    11431277chicken.c: chicken.scm chicken-more-macros.scm chicken-ffi-macros.scm private-namespace.scm
     
    11601294chicken-profile.c: chicken-profile.scm
    11611295        $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@
     1296ifndef BUILD_SETUP_TOOLS
    11621297chicken-setup.c: chicken-setup.scm chicken-more-macros.scm
    11631298        $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@
     1299else
     1300chicken-install.c: chicken-install.scm setup-download.c setup-utils.c
     1301        $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@
     1302chicken-uninstall.c: chicken-uninstall.scm setup-utils.c
     1303        $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@
     1304chicken-status.c: chicken-status.scm setup-utils.c
     1305        $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@
     1306endif
    11641307csc.c: csc.scm
    11651308        $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@
    11661309chicken-bug.c: chicken-bug.scm
    11671310        $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@
     1311
     1312ifdef BUILD_SETUP_TOOLS
     1313setup-api.c: setup-api.scm setup-utils.c
     1314        $(CHICKEN) $< $(CHICKEN_DYNAMIC_OPTIONS) -emit-import-library setup-api -output-file $@
     1315setup-download.c: setup-download.scm setup-utils.c
     1316        $(CHICKEN) $< $(CHICKEN_DYNAMIC_OPTIONS) -emit-import-library setup-download -output-file $@
     1317setup-utils.c: setup-utils.scm
     1318        $(CHICKEN) $< $(CHICKEN_DYNAMIC_OPTIONS) -emit-import-library setup-utils -output-file $@
     1319endif
    11681320
    11691321# distribution files
  • chicken/branches/hygienic/setup-api.scm

    r11558 r11573  
    3434     compile
    3535     make make/proc
     36     host-extension
    3637     install-extension install-program install-script
    3738     setup-verbose-flag
     
    4344     test-compile try-compile copy-file run-verbose
    4445     required-chicken-version required-extension-version cross-chicken
    45      use-sudo)
     46     sudo-install keep-intermediates)
    4647
    4748  (import scheme chicken foreign
     
    100101#endif
    101102
    102 #ifndef C_CHICKEN_PROFILE_PROGRAM
    103 # define C_CHICKEN_PROFILE_PROGRAM   "chicken-profile"
    104 #endif
    105 
    106 #ifndef C_CHICKEN_SETUP_PROGRAM
    107 # define C_CHICKEN_SETUP_PROGRAM   "chicken-setup"
    108 #endif
    109 
    110103#ifndef C_CHICKEN_BUG_PROGRAM
    111104# define C_CHICKEN_BUG_PROGRAM   "chicken-bug"
     
    120113    ("csc" . ,(foreign-value "C_CSC_PROGRAM" c-string))
    121114    ("csi" . ,(foreign-value "C_CSI_PROGRAM" c-string))
    122     ("chicken-profile" . ,(foreign-value "C_CHICKEN_PROFILE_PROGRAM" c-string))
    123     ("chicken-setup" . ,(foreign-value "C_CHICKEN_SETUP_PROGRAM" c-string))
    124115    ("chicken-bug" . ,(foreign-value "C_CHICKEN_BUG_PROGRAM" c-string))))
    125116
     
    144135
    145136(register-feature! 'chicken-setup)
     137
     138(define host-extension (make-parameter #f))
    146139
    147140(define chicken-bin-path
     
    172165(define setup-install-flag        (make-parameter #t))
    173166(define program-path (make-parameter chicken-bin-path))
    174 
    175 (define (use-sudo)
     167(define keep-intermediates (make-parameter #f))
     168
     169(define (sudo-install)
    176170  (set! *copy-command* "sudo cp -r")
    177171  (set! *remove-command* "sudo rm -fr")
     
    282276                   (cdr (assoc prg *installed-executables*))))
    283277                 "-feature" "compiling-extension"
     278                 (if (host-extension) "-host" "")
    284279                 *csc-options*)
    285280          " ") )
Note: See TracChangeset for help on using the changeset viewer.