Changeset 7128

Show
Ignore:
Timestamp:
02/01/10 18:37:23 (7 months ago)
Author:
metamorph68
Message:

Win32 specifics:

  • Disable daemon option: Unix.fork is not implemented.
  • Use local directory for pervasives and etc..

Also remove configure.ml in clean target..

Location:
trunk
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/liquidsoap/Makefile

    r7121 r7128  
    2727finish-configure: 
    2828        @echo Creating src/configure.ml 
     29ifneq ($(OS_TYPE),Win32) 
    2930        @echo let tts_program = \"$(libdir)/liquidsoap/$(libs_dir_version)/liquidtts\" >> src/configure.ml 
    3031        @echo let rundir = \"$(localstatedir)/run/liquidsoap\" >> src/configure.ml 
     
    3435        @echo let \(\) = add_subst \"\<sysrundir\>\" \"$(localstatedir)/run/liquidsoap\" >> src/configure.ml 
    3536        @echo let \(\) = add_subst \"\<syslogdir\>\" \"$(localstatedir)/log/liquidsoap\" >> src/configure.ml 
     37else 
     38        # In windows, we load everything from the current directory. 
     39        @echo let tts_program = \"liquidtts\" >> src/configure.ml 
     40        @echo let rundir = \"run\" >> src/configure.ml 
     41        @echo let logdir = \"logs\" >> src/configure.ml 
     42        @echo let libs_dir = \"libs\" >> src/configure.ml 
     43        @echo let \(\) = add_subst \"\<sysrundir\>\" \".\" >> src/configure.ml 
     44        @echo let \(\) = add_subst \"\<syslogdir\>\" \".\" >> src/configure.ml 
     45endif 
     46        @echo let display_types = ref false >> src/configure.ml 
    3647        @echo "(* Enable backtrace printing if possible, does nothing on ocaml<3.11 *)" >> src/configure.ml 
    3748        @echo "let record_backtrace _ = ()" >> src/configure.ml 
  • trunk/liquidsoap/Makefile.defs.in

    r7111 r7128  
    2626LIBS = @LIBS@ 
    2727LDFLAGS = @LDFLAGS@ 
     28OS_TYPE = @OS_TYPE@ 
    2829OS_EXEC_SUFFIX = @OS_EXEC_SUFFIX@ 
    2930 
  • trunk/liquidsoap/Makefile.rules

    r7113 r7128  
    1212install: install-local install-subdirs 
    1313clean: clean-subdirs clean-local clean-buildings 
    14         rm -f *.cmo *.cmi *.cmx *.cma *.cmxa *.o *.annot 
     14        rm -f *.cmo *.cmi *.cmx *.cma *.cmxa *.o *.annot configure.ml 
    1515doc: doc-local doc-subdirs doc-auto 
    1616 
  • trunk/liquidsoap/configure.ac

    r7113 r7128  
    146146# Check for OS 
    147147OS_TYPE=`$OCAMLFIND ocamlc -config | grep os_type | tr -d ' ' | cut -d':' -f 2` 
     148AC_SUBST(OS_TYPE) 
     149 
    148150if test "$OS_TYPE" \!= "Unix" ; then 
    149151  OS_EXEC_SUFFIX=".exe" 
     
    17071709fi 
    17081710 
    1709 AC_PATH_PROG(TEXT2WAVE,text2wave,false) 
     1711AC_PATH_PROG(TEXT2WAVE,text2wave$(OS_EXEC_SUFFIX),false) 
    17101712AC_PATH_PROG(SOX,sox,false) 
    17111713AC_PATH_PROG(NORMALIZE,normalize,false) 
  • trunk/liquidsoap/src/main.ml

    r7057 r7128  
    316316      ["--debug"], 
    317317      Arg.Unit (fun () -> Log.conf_level#set (max 4 Log.conf_level#get)), 
    318       "Print debugging log messages." ; 
    319  
    320       ["-d";"--daemon"], 
    321       Arg.Unit (fun f -> Init.conf_daemon#set true), 
    322       "Run in daemon mode." ; 
    323  
    324       ["-t";"--enable-telnet"], 
     318      "Print debugging log messages." ] 
     319      @ 
     320      (* Unix.fork is not implemented in Win32. *)  
     321      (if Sys.os_type <> "Win32" then 
     322        [["-d";"--daemon"], 
     323         Arg.Unit (fun f -> Init.conf_daemon#set true), 
     324         "Run in daemon mode."] 
     325       else []) 
     326      @ 
     327      [["-t";"--enable-telnet"], 
    325328      Arg.Unit (fun _ -> Server.conf_telnet#set true), 
    326329      "Enable the telnet server." ; 
  • trunk/ocaml-dtools/src/dtools.ml

    r7111 r7128  
    383383  let conf = 
    384384    Conf.void "initialization configuration" 
     385  (* Unix.fork is not implemented in Win32. *) 
     386  let daemon_conf =  
     387    if Sys.os_type <> "Win32" then conf 
     388    else Conf.void "dummy conf" 
    385389  let conf_daemon = 
    386     Conf.bool ~p:(conf#plug "daemon") ~d:false 
     390    Conf.bool ~p:(daemon_conf#plug "daemon") ~d:false 
    387391      "run in daemon mode" 
    388392  let conf_daemon_pidfile = 
     
    614618    if Sys.os_type <> "Win32" then 
    615619      ignore (Unix.sigprocmask Unix.SIG_BLOCK [Sys.sigterm; Sys.sigint]); 
    616     if conf_daemon#get 
    617     then daemonize (main f) 
     620      if conf_daemon#get && Sys.os_type <> "Win32" 
     621      then daemonize (main f) 
    618622    else catch (main f) (fun () -> ()) 
    619623 
    620624  let args = 
    621     [ 
    622       ["--daemon";"-d"], 
    623       Arg.Unit (fun () -> conf_daemon#set true), 
    624       "run in daemon mode"; 
    625     ] 
     625    if Sys.os_type <> "Win32" then 
     626      [ 
     627        ["--daemon";"-d"], 
     628        Arg.Unit (fun () -> conf_daemon#set true), 
     629        "run in daemon mode"; 
     630      ] 
     631    else [] 
    626632 
    627633end