capi4hylafax-svn/0000755000175000017500000000000010470310065013603 5ustar mastermastercapi4hylafax-svn/config.faxCAPI0000644000175000017500000003633410470310065016216 0ustar mastermaster# # EDIT THIS CONFIGURATION TO REFLECT YOUR SETUP # # Grundsätzliches: # - Es gibt für jeden Wert einen Standardzustand (default), sodass jede Zeile # der Datei oder auch das komplette Configfile ausgelassen werden kann. # - Es gibt ausschließlich ein Configfile, in dem alle nötigen Angaben für # "c2faxsend/-receive" eingetragen werden können. # - Werden für HylaFAX mehrere virtuelle Geräte (devices) angelegt, muss es # für jedes Device ein Configfile im Format config.[DeviceName] geben. # Dessen Existenz wird von HylaFAX überprüft. Ohne dieses File kann die # Arbeit mit dem Device nicht aufgenommen werden. Die Existenz einer # solchen Datei kann am einfachsten durch einen Link auf dieses ConfigFile # oder ein minimales "dummy"-ConfigFile nachgewiesen werden. # # Basics: # - There is a default condition for each value, such that each line of the # file or the complete configfile can be left out. # - There is only one configfile in which all information required for # "c2faxsend/-receive" can be entered. # - If multiple virtual devices are created for HylaFAX, there must be a # Configfile in the format config.[DeviceName] for each device. HylaFAX # checks that this file exists. Without this file, it is not possible to # start working with the device. The easiest way to establish the existence # of such a file is to create a link to this ConfigFile or a minimum # "dummy" ConfigFile. # "SpoolDir" gibt den Pfad an, unter dem im HylaFAX-kompatiblen Betrieb die # HylaFAX-Dateien zu finden sind oder unter dem im Stand-Alone-Betrieb die # empfangenen Faxe gespeichert werden sollen. Im HylaFAX-kompatiblen Betrieb # werden die Faxe im Verzeichnis $(SpoolDir)/recvq gespeichert. # # "SpoolDir" indicates the path in which the HylaFAX are located in HylaFAX- # compatible operation or in which received faxes are to be saved in # stand-alone operation. In HylaFAX-compatible operation, faxes are saved in # the directory $(SpoolDir)/recvq. # # default /var/spool/fax # SpoolDir: /var/spool/fax # "FaxRcvdCmd" gibt das Skript an, das ausgeführt wird, sobald ein Fax # empfangen wurde. Im Stand-Alone-Betrieb werden andere Parameter # übergeben als für HylaFAX (mehr dazu im sample_faxrcvd). # # "FaxRcvdCmd" indicates the script performed whenever a fax is # received. Parameters other than the ones for HylaFAX are returned in # stand-alone operation (see sample_faxrcvd for more information). # # default /var/spool/hylafax/bin/faxrcvd # FaxRcvdCmd: /var/spool/fax/bin/faxrcvd # "PollRcvdCmd" gibt das Skript an, das ausgeführt wird, sobald ein # Fax per Faxabruf empfangen wurde. Im Stand-Alone-Betrieb werden # andereParameter übergeben als für HylaFAX (mehr dazu im # sample_faxrcvd). # # "PollRcvdCmd" indicates the script performed whenever a fax was # received by fax polling. Parameters other than the ones for HylaFAX # are returned in stand-alone operation (see sample_faxrcvd for more # information). # # default /var/spool/hylafax/bin/pollrcvd # PollRcvdCmd: /var/spool/fax/bin/pollrcvd # "FaxReceiveUser" und "FaxReceiveGroup" geben den User und die Gruppenkennung # an, unter der c2faxrecv ausgeführt wird. Die Änderung des Users und der Gruppe # kann nur vom "root" bzw. Superuser erfolgen. Wenn c2faxrecv von einem anderen # User gestartet wird, werden dieser Einträge ignoriert. Wenn jedoch die Rechte # von /dev/capi20 nicht geändert werden sollen oder Ihre Linux-Distribution einen # anderen User oder eine andere Gruppe voraussetzt, sollten Sie an dieser Stelle # etwas anderes als den Hylafax-Standardwert "uucp" eintragen. # "FaxReceiveUser" and "FaxReceiveGroup" indicate the user and the group ID used # to execute c2faxrecv. The user and the group can only be changed by the "root" # or superuser. These entries will be ignored when c2faxrecv is started by another # user. However, if the rights for /dev/capi20 should not be changed, or if your # Linux distribution requires a different user or group, something other than the # Hylafax default value "uucp" should be entered here. # # default "" # FaxReceiveUser: fax FaxReceiveGroup: dialout # Im "LogFile" werden Informationen über den Faxablauf abgespeichert. # # Information about the order of events in faxing are saved in the "LogFile". # # default "/tmp/capifax.log" # LogFile: /tmp/capifax.log # Der Befehl "LogTraceLevel" gibt die Menge der Daten an, die in ein LogFile # geschrieben werden. Die Spanne reicht von 0 = nichts bis 4 = vieles. # # The "LogTraceLevel" command indicates the amount of data written in a # LogFile. The range goes from 0 = nothing to 4 = many. # # default 0 # # LogTraceLevel: 4 # "LogFileMode" sind die Angaben (mode), aufgrund derer sowohl das gerade # erwähnte LogFile als auch die LogFiles für HylaFAX angelegt werden. # # "LogFileMode" is the mode, on the basis of which both the LogFile just # mentioned and the LogFiles for HylaFAX are generated. # # default 0600 # LogFileMode: 0600 # Die geschweiften Klammern geben Anfang und Ende einer Section an. # Jede Section darf eine oder mehrere SubSections enthalten. # SubSubSections sind nicht erlaubt. # Dabei enthält die Section Angaben zu einem virtuellen Device; # die Subsection die Angaben für die Rufannahme jedes Controllers. # Es können beliebig viele Sections und, darin enthalten, jeweils beliebig # viele Subsections erzeugt werden. # Jede Section muss aber einen anderen HylafaxDeviceName erhalten; # zusätzlich muss in jeder Subsection innerhalb einer Section ein anderer # Controller aufgeführt werden. Beim Stand-Alone-Betrieb ist eine Section mit # entsprechend vielen Subsections ausreichend, da in diesem Betriebsmodus die # virtuellen DeviceNamen keine Rolle spielen. # # The curved brackets indicate the beginning and end of a section. # Each section may contain one or more subsections. # SubSubSections are not permitted. # The section contains information about a virtual device; the subsection the # call acceptance information for each controller. # Any number of sections containing any number of subsections may be # generated, but each section must receive a different HylafaxDeviceName; and # a different controller must be listed in every subsection within a section. # For stand-alone operation, it is sufficient to have just one section with # as many subsections as required, since virtual DeviceNames do not play # any role in this mode of operation. # { # "HylafaxDeviceName" ist der Name, unter dem sich C4H bei HylaFAX als # "virtuelles Modem" anmeldet. Sollen für HylaFAX mehrere dieser "Modems" # erzeugt werden, legen Sie einfach eine neue Section mit einem anderen # HylafaxDeviceName an. # # "HylafaxDeviceName" is the name, under which C4H registers in HylaFAX as # a "virtual modem". If multiple "modems" are to be generated for HylaFAX, # simply create a new section with another HylafaxDeviceName. # # default faxCAPI # HylafaxDeviceName: faxCAPI # "RecvFileMode" ist der Mode, in dem empfangene Faxe abgespeichert # werden. User und Group der Datei wird durch FaxReceiveUser (s.o.) # festgelegt. # # "RecvFileMode" is the mode, in which received faxes are saved. User and # Group of the file are determined by the FaxReceiveUser (see above). # # default 0600 # RecvFileMode: 0600 # "FAXNumber" ist die eigene Nummer des Computers und wird der Gegenseite # mitgeteilt (sichtbar z. B. im Fax-Journal). # # "FAXNumber" is the fax number of the computer itself and is transmitted # to the remote site (visible in the Fax Journal). # # default "" # FAXNumber: +49.00.00000 # "LocalIdentifier" ist der von CAPI aus konfigurierbare Teil der # Kopfzeile. Ein leerer Eintrag führt dazu, dass keine Fax-Kopfzeile # eingefügt wird. # # "LocalIdentifier" is the part of the fax header which can be configured # from CAPI. An empty entry specifies an empty header. # # default "" # LocalIdentifier: "AVM CAPI4HylaFAX" # Die maximale Anzahl von gleichzeitig empfangbaren Faxen kann # durch "MaxConcurrentRecvs" angepaßt werden. Diese Anzahl wird # durch die Anzahl der durch die Hardware zur Verfügung # gestellten B-Kanäle begrenzt. # # The maximum number of faxes that can be received at the same # time can be adjusted using "MaxConcurrentRecvs". This number # is limited by the number of B channels provided by the hardware. # # default 2 # MaxConcurrentRecvs: 2 # ----------- outgoing params ----------- # "OutgoingController" gibt den Controller an, über den eine externe # Verbindung aufgebaut werden soll. # # "OutgoingController" indicates the controller which is to be used to # establish an external connection. # # default 1 # OutgoingController: 1 # Die "OutgoingMSN" ist die MSN, die für ausgehenden Faxe benutzt wird. # # The "OutgoingMSN" is the MSN used for outgoing faxes. # # default "" # OutgoingMSN: # CLIR (Rufnummernunterdrückung) kann über "SuppressMSN" und den Wert (0) # abgeschaltet oder mit dem Wert (1) erneut angeschaltet werden. # # CLIR (Calling Line Identification Restriction) can be switched off using # the value (0) or switched back on by entering the value (1). # # default 0 # SuppressMSN: 0 # "NumberPrefix" wird vor jede Telefonnummer gestellt. Dies ist bei # Nebenstellenanlagen wichtig, bei denen für den Aufbau einer externen # Verbindung eine Ziffer vorgewählt werden muss. # # "NumberPrefix" is set to precede each telephone number. This is # important for PBX systems which require that a number be dialed to # obtain an outside line. # # default "" # NumberPrefix: # Mit der Option "NumberPlusReplacer" wird das Pluszeichen am Anfang einer # Telefonnummer durch Ziffen (z.B. 00) ersetzt. Diese Option hilfreich, wenn komplette # Telefonbucheinträge verwendet werden sollen, denen ein '+' voranstehen. # # Use the option "NumberPlusReplacer" to replace the '+' character # at the beginning of a telephone number by the contents of this field, usually # "00". This option can be very helpful when complete telephone book entries are used that are # preceded by '+'. # # default "" # # NumberPlusReplacer: "00" # Wenn der Wert in "UseISDNFaxService" = 1 ist, wird ein ausgehender Ruf # mit der ISDN-FAX-G3 Dienstekennung aufgebaut. Bei 0 wird eine 3.1kHz # Audio-Verbindung hergestellt. # # When in "UseISDNFaxService" the value is = 1, an outoing call will be # established using the ISDN-FAX-G3 service indicator. For 0, a 3.1kHz # audio connection is established. # # default 0 # UseISDNFaxService: 0 # Gibt die Dauer in Sekunden an, die auf eine Verbindungsannahme durch die # Gegenseite gewartet wird. So wird beim Faxversand nicht automatisch die # gesamte von der Telekom vorgegebene Wartezeit genutzt. Eine Angabe des # Wertes 0 nutzt die gesamte Wartezeit. # # The duration in seconds you wait for the remote site to accept your # outgoing call In this way you do not have to use the entire ringing # duration preset by the telephone company. The default value 0 uses the # entire ringing duration. # # default 0 # RingingDuration: 0 # ----------- incoming params ----------- { # Controller, für den diese Subsection gilt. # # Controller for which this subsection is valid. # # default 1 # Controller: 1 # Wenn "AcceptSpeech" auf 1 steht, wird auch die Dienstekennung # "Sprache" angenommen. # # If "AcceptSpeech" is set to 1, the service indicator "Voice" also # will be accepted. # # default 0 # AcceptSpeech: 0 # Sofern man DDI nutzen will, sollte man "UseDDI" auf 1 stellen. # # If DDI is to be used, "UseDDI" should be set to a value of 1. # # default 0 # UseDDI: 0 # Die DDI-Stammnummer wird bei "DDIOffset" eingetragen. # Der Standardwert führt zu keinem korrekten Ergebnis und # sollte, sofern "UseDDI" auf 1 gestellt wurde, immer # verändert werden. # # "DDIOffset" indicates the DDI offset number which precedes # extension number. Because the default value can't guarantee # a correct result, this value should be modified whenever # "UseDDI" is set to 1. # # default "" # DDIOffset: "12345" # "DDILength" gibt die Anzahl der Durchwahlziffern an. (Diese Ziffern # werden lediglich als Teil der Empfängernummer mitgeteilt.) Der # Standardwert sollte bei Verwendung von DDI ebenfalls angepasst # werden. # # "DDILength" indicates the number of digits in the extension. (These # numbers are only used as a component of the recipient's number.) The # default value should be adapted whenever DDI is used. # # default 0 # DDILength: 3 # Bei "IncomingDDIs" können in einer durch Komma getrennten Liste alle # Durchwahlziffern (DDIs) angegeben werden, für die Rufe angenommen # werden sollen. Eine Bereichsangabe ist auch möglich (z.B. 100-300), # wobei aber keine offenen Bereiche (z.B. -100) erlaubt sind. # Sofern IncommingDDIs gesetzt ist, wird DDILength ignoriert. # # In "IncomingDDIs", all extension numbers (DDIs) for which calls are # to be accepted may be listed, separated by commas. It is also # possible to specify a range (e.g. 100-300); here no open ranges are # permitted (e.g. -100). When the "IncomingDDIs" switch is set, the # parameters for DDILength will be ignored. # # default "" # IncomingDDIs: # Bei "IncomingMSNs" können in einer durch Komma getrennten Liste alle # MSNs angegeben werden, für die Rufe angenommen werden sollen. Ist # die Liste leer, werden alle Rufe auf ISDN FAX G3, 3,1kHz Audio und # eventuell "Sprache" angenommen. # Wenn "UseDDI" auf 1 gestellt ist, wird "IncomingMSNs" ignoriert. # # In "IncomingMSNs", all MSNs for which calls are to be accepted may # be listed, separated by commas. When the list is empty, all calls # are accepted for ISDN FAX G3, 3,1kHz audio and perhaps "Voice". # When "UseDDI" is set to 1, "IncomingMSNs" is ignored. # # default "" # IncomingMSNs: # Wenn "AcceptGlobalCall" auf 1 steht, werden auch Calls ohne # Zielrufnummer (ohne MSN) angenommen. # Notwendig hinter einigen Telefonanlagen, die keine Zielrufnummer # senden. # # If "AcceptGlobalCall" is set to 1, calls without Called Party # Number also will be accepted. # Needed on internal ports of some PBX. # # default 1 # AcceptGlobalCall: 1 } } capi4hylafax-svn/configure0000755000175000017500000261276110470310065015531 0ustar mastermaster#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string="`eval $cmd`") 2>/dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi tagnames=${tagnames+${tagnames},}CXX tagnames=${tagnames+${tagnames},}F77 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="src/defaults.h.in" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBTOOL_DEPS INSTALL hylafaxbindir hylafaxspooldir LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r "./$ac_unique_file") 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP ac_env_CXXCPP_set=${CXXCPP+set} ac_env_CXXCPP_value=$CXXCPP ac_cv_env_CXXCPP_set=${CXXCPP+set} ac_cv_env_CXXCPP_value=$CXXCPP ac_env_F77_set=${F77+set} ac_env_F77_value=$F77 ac_cv_env_F77_set=${F77+set} ac_cv_env_F77_value=$F77 ac_env_FFLAGS_set=${FFLAGS+set} ac_env_FFLAGS_value=$FFLAGS ac_cv_env_FFLAGS_set=${FFLAGS+set} ac_cv_env_FFLAGS_value=$FFLAGS # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-debug Turn debugging on (default=no) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] --with-hylafax-spooldir=DIR Set dir where hylafax spool is installed. (/var/spool/hylafax) Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CC C compiler command CFLAGS C compiler flags CPP C preprocessor CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in src/scripts $srcdir/src/scripts; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in src/scripts $srcdir/src/scripts" >&5 echo "$as_me: error: cannot find install-sh or install.sh in src/scripts $srcdir/src/scripts" >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. am__api_version="1.9" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE=capi4hylafax VERSION=01.03.01svn cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi; echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE CXXFLAGS="-Wall -W -O2 $CXXFLAGS -D_GNU_SOURCE -DDONT_USE_PROTECT_FEATURE" ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C++ compiler default output file name" >&5 echo $ECHO_N "checking for C++ compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C++ compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C++ compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C++ compiler works" >&5 echo $ECHO_N "checking whether the C++ compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval="$enable_dependency_tracking" fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CXX" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi; # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi; # Check whether --enable-fast-install or --disable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval="$enable_fast_install" p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi; # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CC" am_compiler_list= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 if test "${lt_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done fi SED=$lt_cv_path_SED echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6 echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 if test "${lt_cv_ld_reload_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/${ac_tool_prefix}nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac esac fi done IFS="$lt_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 echo "${ECHO_T}$lt_cv_path_NM" >&6 NM="$lt_cv_path_NM" echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6 if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump'. lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | kfreebsd*-gnu | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case "$host_cpu" in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac fi echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 4257 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case "`/usr/bin/file conftest.o`" in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-linux*) # Test if the compiler is 64bit echo 'int i;' > conftest.$ac_ext lt_cv_cc_64bit_output=no if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *"ELF 64"*) lt_cv_cc_64bit_output=yes ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 if test "${lt_cv_cc_needs_belf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then lt_cv_cc_needs_belf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; esac need_locks="$enable_libtool_lock" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6 ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then echo "$as_me:$LINENO: result: $F77" >&5 echo "${ECHO_T}$F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 echo "${ECHO_T}$ac_ct_F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_F77" && break done F77=$ac_ct_F77 fi # Provide some information about the compiler. echo "$as_me:5390:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 if test "${ac_cv_f77_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_f77_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 echo "${ECHO_T}$ac_cv_prog_f77_g" >&6 if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi G77=`test $ac_compiler_gnu = yes && echo yes` ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 if test "${lt_cv_sys_max_cmd_len+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for *BSD fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 else echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 fi # Check for command to grab the raw symbol name followed by C symbol from nm. echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux*) if test "$host_cpu" = ia64; then symcode='[ABCDGIRSTW]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris* | sysv5*) symcode='[BDRT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then echo "$as_me:$LINENO: result: failed" >&5 echo "${ECHO_T}failed" >&6 else echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 fi echo "$as_me:$LINENO: checking for objdir" >&5 echo $ECHO_N "checking for objdir... $ECHO_C" >&6 if test "${lt_cv_objdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 echo "${ECHO_T}$lt_cv_objdir" >&6 objdir=$lt_cv_objdir case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi AR=$ac_ct_AR else AR="$ac_cv_prog_AR" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo "$as_me:$LINENO: checking for file" >&5 echo $ECHO_N "checking for file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 echo "${ECHO_T}$MAGIC_CMD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi else MAGIC_CMD=: fi fi fi ;; esac enable_dlopen=no enable_win32_dll=no # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Check whether --with-pic or --without-pic was given. if test "${with_pic+set}" = set; then withval="$with_pic" pic_mode="$withval" else pic_mode=default fi; test -z "$pic_mode" && pic_mode=default # Check if we have a version mismatch between libtool.m4 and ltmain.sh. # # Note: This should be in AC_LIBTOOL_SETUP, _after_ $ltmain have been defined. # We also should do it _before_ AC_LIBTOOL_LANG_C_CONFIG that actually # calls AC_LIBTOOL_CONFIG and creates libtool. # echo "$as_me:$LINENO: checking for correct ltmain.sh version" >&5 echo $ECHO_N "checking for correct ltmain.sh version... $ECHO_C" >&6 if test -z "$ltmain"; then echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 echo echo "*** Gentoo sanity check failed! ***" echo "*** \$ltmain is not defined, please check the patch for consistency! ***" echo exit 1 fi gentoo_lt_version="1.5.18" gentoo_ltmain_version=`grep '^[:space:]*VERSION=' $ltmain | sed -e 's|^[:space:]*VERSION=||'` if test "$gentoo_lt_version" != "$gentoo_ltmain_version"; then echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 echo echo "*** Gentoo sanity check failed! ***" echo "*** libtool.m4 and ltmain.sh have a version mismatch! ***" echo "*** (libtool.m4 = $gentoo_lt_version, ltmain.sh = $gentoo_ltmain_version) ***" echo echo "Please run:" echo echo " libtoolize --copy --force" echo echo "if appropriate, please contact the maintainer of this" echo "package (or your distribution) for help." echo exit 1 else echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 fi # Use C for the default configuration in the libtool script tagname= lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # # Check for any special shared library compilation flags. # lt_prog_cc_shlib= if test "$GCC" = no; then case $host_os in sco3.2v5*) lt_prog_cc_shlib='-belf' ;; esac fi if test -n "$lt_prog_cc_shlib"; then { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5 echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;} if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then : else { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} lt_cv_prog_cc_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6 if test "${lt_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_prog_compiler_static" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works=yes fi else lt_prog_compiler_static_works=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 echo "${ECHO_T}$lt_prog_compiler_static_works" >&6 if test x"$lt_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6529: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:6533: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic='-qnocommon' lt_prog_compiler_wl='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-static' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic='-Kpic' lt_prog_compiler_static='-dn' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 echo "${ECHO_T}$lt_prog_compiler_pic" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6791: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:6795: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6 if test x"$lt_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6853: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:6857: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp $SED '/^$/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag= enable_shared_with_static_runtimes=no archive_cmds= archive_expsym_cmds= old_archive_From_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported link_all_deplibs=unknown hardcode_automatic=no module_cmds= module_expsym_cmds= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* ) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_libdir_separator=':' link_all_deplibs=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec=' ' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs=no ;; esac fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=no hardcode_shlibpath_var=no ;; ia64*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=no hardcode_shlibpath_var=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; *) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld='-rpath $libdir' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4.2uw2*) archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv5*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6 test "$ld_shlibs" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 echo "${ECHO_T}$archive_cmds_need_lc" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; linux*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else $archive_expsym_cmds="$archive_cmds" fi else ld_shlibs=no fi ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi case $host_cpu:$lt_cv_cc_64bit_output in powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes) sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /usr/X11R6/lib64" sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64 /usr/X11R6/lib64" ;; esac # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' # Find out which ABI we are using (multilib Linux x86_64 hack). libsuff= case "$host_cpu" in x86_64*) echo '#line 8284 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 ;; esac fi rm -rf conftest* ;; *) ;; esac sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}" sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var" || \ test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action" >&5 echo "${ECHO_T}$hardcode_action" >&6 if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Report which librarie types wil actually be built echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler \ CC \ LD \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_prog_compiler_no_builtin_flag \ export_dynamic_flag_spec \ thread_safe_flag_spec \ whole_archive_flag_spec \ enable_shared_with_static_runtimes \ old_archive_cmds \ old_archive_from_new_cmds \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ archive_cmds \ archive_expsym_cmds \ postinstall_cmds \ postuninstall_cmds \ old_archive_from_expsyms_cmds \ allow_undefined_flag \ no_undefined_flag \ export_symbols_cmds \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ hardcode_automatic \ module_cmds \ module_expsym_cmds \ lt_cv_prog_compiler_c_o \ exclude_expsyms \ include_expsyms; do case $var in old_archive_cmds | \ old_archive_from_new_cmds | \ archive_cmds | \ archive_expsym_cmds | \ module_cmds | \ module_expsym_cmds | \ old_archive_from_expsyms_cmds | \ export_symbols_cmds | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" { echo "$as_me:$LINENO: creating $ofile" >&5 echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CC="$lt_save_CC" # Check whether --with-tags or --without-tags was given. if test "${with_tags+set}" = set; then withval="$with_tags" tagnames="$withval" fi; if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 echo "$as_me: error: invalid tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} { (exit 1); exit 1; }; } fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= # Source file extension for C++ test sources. ac_ext=cc # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo "$as_me:$LINENO: checking for ld used by $CC" >&5 echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_CXX=yes else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_CXX=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX=' ' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_CXX=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_CXX='+b $libdir' hardcode_libdir_separator_CXX=: ;; ia64*) hardcode_libdir_flag_spec_CXX='-L$libdir' ;; *) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case "$host_cpu" in hppa*64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; *) hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case "$host_cpu" in hppa*64*|ia64*) archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case "$host_cpu" in ia64*|hppa*64*) archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; linux*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sco*) archive_cmds_need_lc_CXX=no case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. We must also pass each convience library through # to the system linker between allextract/defaultextract. # The C++ compiler will combine linker options so we # cannot just pass the convience library names through # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac link_all_deplibs_CXX=yes # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' fi ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) archive_cmds_need_lc_CXX=no ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`" for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $rm -f confest.$objext case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_CXX='-qnocommon' lt_prog_compiler_wl_CXX='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; icpc* | ecpc*) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC*) # Portland Group C++ compiler. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-static' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; sco*) case $cc_basename in CC*) lt_prog_compiler_pic_CXX='-fPIC' ;; *) ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; unixware*) ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:11494: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:11498: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6 if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_CXX=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:11556: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:11560: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp $SED '/^$/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6 test "$ld_shlibs_CXX" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; linux*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else $archive_expsym_cmds="$archive_cmds" fi else ld_shlibs=no fi ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi case $host_cpu:$lt_cv_cc_64bit_output in powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes) sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /usr/X11R6/lib64" sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64 /usr/X11R6/lib64" ;; esac # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' # Find out which ABI we are using (multilib Linux x86_64 hack). libsuff= case "$host_cpu" in x86_64*) echo '#line 12116 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 ;; esac fi rm -rf conftest* ;; *) ;; esac sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}" sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var_CXX" || \ test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 echo "${ECHO_T}$hardcode_action_CXX" >&6 if test "$hardcode_action_CXX" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_CXX \ CC_CXX \ LD_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ export_dynamic_flag_spec_CXX \ thread_safe_flag_spec_CXX \ whole_archive_flag_spec_CXX \ enable_shared_with_static_runtimes_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ postuninstall_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ export_symbols_cmds_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ hardcode_automatic_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do case $var in old_archive_cmds_CXX | \ old_archive_from_new_cmds_CXX | \ archive_cmds_CXX | \ archive_expsym_cmds_CXX | \ module_cmds_CXX | \ module_expsym_cmds_CXX | \ old_archive_from_expsyms_cmds_CXX | \ export_symbols_cmds_CXX | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_CXX # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_CXX old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_CXX # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_CXX # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_CXX # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_CXX # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_CXX" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # Code to be used in simple compile tests lt_simple_compile_test_code=" subroutine t\n return\n end\n" # Code to be used in simple link tests lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $can_build_shared" >&5 echo "${ECHO_T}$can_build_shared" >&6 echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac echo "$as_me:$LINENO: result: $enable_shared" >&5 echo "${ECHO_T}$enable_shared" >&6 echo "$as_me:$LINENO: checking whether to build static libraries" >&5 echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$as_me:$LINENO: result: $enable_static" >&5 echo "${ECHO_T}$enable_static" >&6 test "$ld_shlibs_F77" = no && can_build_shared=no GCC_F77="$G77" LD_F77="$LD" lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_F77=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_F77='-qnocommon' lt_prog_compiler_wl_F77='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; pgcc* | pgf77* | pgf90*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fpic' lt_prog_compiler_static_F77='-static' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic_F77='-Kpic' lt_prog_compiler_static_F77='-dn' ;; solaris*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_F77='-Qoption ld ';; *) lt_prog_compiler_wl_F77='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; unicos*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_can_build_shared_F77=no ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13963: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:13967: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6 if test x"$lt_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_F77=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:14025: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:14029: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp $SED '/^$/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_F77= enable_shared_with_static_runtimes_F77=no archive_cmds_F77= archive_expsym_cmds_F77= old_archive_From_new_cmds_F77= old_archive_from_expsyms_cmds_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= thread_safe_flag_spec_F77= hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_direct_F77=no hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported link_all_deplibs_F77=unknown hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= always_export_symbols_F77=no export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_F77=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_F77=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs_F77=no fi ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_F77='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* ) # Portland Group f77 and f90 compilers whole_archive_flag_spec_F77='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs_F77=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = no; then runpath_var= hardcode_libdir_flag_spec_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_F77='' hardcode_direct_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_F77=yes else # We have old collect2 hardcode_direct_F77=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_F77=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_f77_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_F77=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77=' ' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section ld_shlibs_F77=no ;; bsdi[45]*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_F77='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_F77=no hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='' link_all_deplibs_F77=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_F77=no ;; esac fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; ia64*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; *) hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: link_all_deplibs_F77=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; openbsd*) hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi hardcode_libdir_separator_F77=: ;; sco3.2v5*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4.2uw2*) archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag_F77='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv5*) no_undefined_flag_F77=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec_F77= hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 echo "${ECHO_T}$ld_shlibs_F77" >&6 test "$ld_shlibs_F77" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; linux*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else $archive_expsym_cmds="$archive_cmds" fi else ld_shlibs=no fi ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi case $host_cpu:$lt_cv_cc_64bit_output in powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes) sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /usr/X11R6/lib64" sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64 /usr/X11R6/lib64" ;; esac # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' # Find out which ABI we are using (multilib Linux x86_64 hack). libsuff= case "$host_cpu" in x86_64*) echo '#line 15436 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 ;; esac fi rm -rf conftest* ;; *) ;; esac sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}" sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var_F77" || \ test "X$hardcode_automatic_F77" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_F77" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 echo "${ECHO_T}$hardcode_action_F77" >&6 if test "$hardcode_action_F77" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_F77 \ CC_F77 \ LD_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ export_dynamic_flag_spec_F77 \ thread_safe_flag_spec_F77 \ whole_archive_flag_spec_F77 \ enable_shared_with_static_runtimes_F77 \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ predep_objects_F77 \ postdep_objects_F77 \ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ postuninstall_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ export_symbols_cmds_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ hardcode_automatic_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do case $var in old_archive_cmds_F77 | \ old_archive_from_new_cmds_F77 | \ archive_cmds_F77 | \ archive_expsym_cmds_F77 | \ module_cmds_F77 | \ module_expsym_cmds_F77 | \ old_archive_from_expsyms_cmds_F77 | \ export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_F77 # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_F77 old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_F77 # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_F77 # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_F77 # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_F77 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_F77" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o objext_GCJ=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no old_archive_cmds_GCJ=$old_archive_cmds lt_prog_compiler_no_builtin_flag_GCJ= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:16202: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:16206: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_static_GCJ='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_GCJ='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_GCJ=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_GCJ=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_GCJ='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' else lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_GCJ='-qnocommon' lt_prog_compiler_wl_GCJ='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_GCJ='-non_shared' ;; newsos6) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; pgcc* | pgf77* | pgf90*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-fpic' lt_prog_compiler_static_GCJ='-static' ;; ccc*) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_GCJ='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic_GCJ='-Kpic' lt_prog_compiler_static_GCJ='-dn' ;; solaris*) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_GCJ='-Qoption ld ';; *) lt_prog_compiler_wl_GCJ='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_GCJ='-Qoption ld ' lt_prog_compiler_pic_GCJ='-PIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_GCJ='-Kconform_pic' lt_prog_compiler_static_GCJ='-Bstatic' fi ;; unicos*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_can_build_shared_GCJ=no ;; uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6 if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:16464: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:16468: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6 if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; esac else lt_prog_compiler_pic_GCJ= lt_prog_compiler_can_build_shared_GCJ=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= ;; *) lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" ;; esac echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o_GCJ=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:16526: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:16530: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp $SED '/^$/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_GCJ=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no echo "$as_me:$LINENO: result: $hard_links" >&5 echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag_GCJ= enable_shared_with_static_runtimes_GCJ=no archive_cmds_GCJ= archive_expsym_cmds_GCJ= old_archive_From_new_cmds_GCJ= old_archive_from_expsyms_cmds_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= thread_safe_flag_spec_GCJ= hardcode_libdir_flag_spec_GCJ= hardcode_libdir_flag_spec_ld_GCJ= hardcode_libdir_separator_GCJ= hardcode_direct_GCJ=no hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=unsupported link_all_deplibs_GCJ=unknown hardcode_automatic_GCJ=no module_cmds_GCJ= module_expsym_cmds_GCJ= always_export_symbols_GCJ=no export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_GCJ= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_GCJ=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_GCJ= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_GCJ=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_GCJ=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_GCJ=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_GCJ=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_GCJ='-L$libdir' allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs_GCJ=no fi ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_GCJ='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* ) # Portland Group f77 and f90 compilers whole_archive_flag_spec_GCJ='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs_GCJ=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_GCJ=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac if test "$ld_shlibs_GCJ" = no; then runpath_var= hardcode_libdir_flag_spec_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_GCJ=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_GCJ=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_GCJ='' hardcode_direct_GCJ=yes hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_GCJ=yes else # We have old collect2 hardcode_direct_GCJ=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_GCJ=yes hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_GCJ=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_GCJ='-berok' # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_GCJ=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_GCJ=' ' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section ld_shlibs_GCJ=no ;; bsdi[45]*) export_dynamic_flag_spec_GCJ=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_GCJ=' ' allow_undefined_flag_GCJ=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_GCJ=no hardcode_direct_GCJ=no hardcode_automatic_GCJ=yes hardcode_shlibpath_var_GCJ=unsupported whole_archive_flag_spec_GCJ='' link_all_deplibs_GCJ=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_GCJ=no ;; esac fi ;; dgux*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; freebsd1*) ld_shlibs_GCJ=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no ;; ia64*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; *) hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: link_all_deplibs_GCJ=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; newsos6) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_shlibpath_var_GCJ=no ;; openbsd*) hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' ;; *) archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_GCJ='-rpath $libdir' fi hardcode_libdir_separator_GCJ=: ;; sco3.2v5*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs_GCJ=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; sysv4) case $host_vendor in sni) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_GCJ='$CC -r -o $output$reload_objs' hardcode_direct_GCJ=no ;; motorola) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv4.3*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_GCJ=yes fi ;; sysv4.2uw2*) archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag_GCJ='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv5*) no_undefined_flag_GCJ=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec_GCJ= hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; *) ld_shlibs_GCJ=no ;; esac fi echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 echo "${ECHO_T}$ld_shlibs_GCJ" >&6 test "$ld_shlibs_GCJ" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_GCJ" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_GCJ=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_GCJ in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_GCJ compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ allow_undefined_flag_GCJ= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_GCJ=no else archive_cmds_need_lc_GCJ=yes fi allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6 ;; esac fi ;; esac echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; linux*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ 01.* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else $archive_expsym_cmds="$archive_cmds" fi else ld_shlibs=no fi ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi case $host_cpu:$lt_cv_cc_64bit_output in powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes) sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /usr/X11R6/lib64" sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64 /usr/X11R6/lib64" ;; esac # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' # Find out which ABI we are using (multilib Linux x86_64 hack). libsuff= case "$host_cpu" in x86_64*) echo '#line 17957 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 ;; esac fi rm -rf conftest* ;; *) ;; esac sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}" sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac echo "$as_me:$LINENO: result: $dynamic_linker" >&5 echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var_GCJ" || \ test "X$hardcode_automatic_GCJ" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_GCJ" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && test "$hardcode_minus_L_GCJ" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_GCJ=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_GCJ=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_GCJ=unsupported fi echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 echo "${ECHO_T}$hardcode_action_GCJ" >&6 if test "$hardcode_action_GCJ" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) echo "$as_me:$LINENO: checking for shl_load" >&5 echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shl_load) || defined (__stub___shl_load) choke me #else char (*f) () = shl_load; #endif #ifdef __cplusplus } #endif int main () { return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 echo "${ECHO_T}$ac_cv_func_shl_load" >&6 if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_dlopen) || defined (__stub___dlopen) choke me #else char (*f) () = dlopen; #endif #ifdef __cplusplus } #endif int main () { return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 echo "${ECHO_T}$ac_cv_func_dlopen" >&6 if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dld_link (); int main () { dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_GCJ \ CC_GCJ \ LD_GCJ \ lt_prog_compiler_wl_GCJ \ lt_prog_compiler_pic_GCJ \ lt_prog_compiler_static_GCJ \ lt_prog_compiler_no_builtin_flag_GCJ \ export_dynamic_flag_spec_GCJ \ thread_safe_flag_spec_GCJ \ whole_archive_flag_spec_GCJ \ enable_shared_with_static_runtimes_GCJ \ old_archive_cmds_GCJ \ old_archive_from_new_cmds_GCJ \ predep_objects_GCJ \ postdep_objects_GCJ \ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ postuninstall_cmds_GCJ \ old_archive_from_expsyms_cmds_GCJ \ allow_undefined_flag_GCJ \ no_undefined_flag_GCJ \ export_symbols_cmds_GCJ \ hardcode_libdir_flag_spec_GCJ \ hardcode_libdir_flag_spec_ld_GCJ \ hardcode_libdir_separator_GCJ \ hardcode_automatic_GCJ \ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do case $var in old_archive_cmds_GCJ | \ old_archive_from_new_cmds_GCJ | \ archive_cmds_GCJ | \ archive_expsym_cmds_GCJ | \ module_cmds_GCJ | \ module_expsym_cmds_GCJ | \ old_archive_from_expsyms_cmds_GCJ | \ export_symbols_cmds_GCJ | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_GCJ # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_GCJ # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_GCJ # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_GCJ pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_GCJ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_GCJ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_GCJ archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_GCJ module_expsym_cmds=$lt_module_expsym_cmds_GCJ # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_GCJ # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_GCJ # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_GCJ # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_GCJ # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_GCJ # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_GCJ # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_GCJ # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_GCJ # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_GCJ # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_GCJ" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_GCJ # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_GCJ # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_GCJ # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; RC) # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_RC \ CC_RC \ LD_RC \ lt_prog_compiler_wl_RC \ lt_prog_compiler_pic_RC \ lt_prog_compiler_static_RC \ lt_prog_compiler_no_builtin_flag_RC \ export_dynamic_flag_spec_RC \ thread_safe_flag_spec_RC \ whole_archive_flag_spec_RC \ enable_shared_with_static_runtimes_RC \ old_archive_cmds_RC \ old_archive_from_new_cmds_RC \ predep_objects_RC \ postdep_objects_RC \ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ postuninstall_cmds_RC \ old_archive_from_expsyms_cmds_RC \ allow_undefined_flag_RC \ no_undefined_flag_RC \ export_symbols_cmds_RC \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_separator_RC \ hardcode_automatic_RC \ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ exclude_expsyms_RC \ include_expsyms_RC; do case $var in old_archive_cmds_RC | \ old_archive_from_new_cmds_RC | \ archive_cmds_RC | \ archive_expsym_cmds_RC | \ module_cmds_RC | \ module_expsym_cmds_RC | \ old_archive_from_expsyms_cmds_RC | \ export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_RC # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_RC # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_RC pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_RC old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_RC # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_RC # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_RC # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_RC # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_RC # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_RC # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_RC # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_RC" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu CC="$lt_save_CC" ;; *) { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 echo "$as_me: error: Unsupported tag name: $tagname" >&2;} { (exit 1); exit 1; }; } ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 echo "$as_me: error: unable to update list of available tagged configurations." >&2;} { (exit 1); exit 1; }; } fi fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion echo "$as_me:$LINENO: checking for va_copy" >&5 echo $ECHO_N "checking for va_copy... $ECHO_C" >&6 if test "${ac_func_va_copy+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include void x(va_list args) { va_list copy; va_copy(copy,args); } int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_func_va_copy=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_func_va_copy=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_func_va_copy" >&5 echo "${ECHO_T}$ac_func_va_copy" >&6 if test $ac_func_va_copy = no; then echo "$as_me:$LINENO: checking for __va_copy" >&5 echo $ECHO_N "checking for __va_copy... $ECHO_C" >&6 if test "${ac_func___va_copy+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include void x(va_list args) { va_list copy; __va_copy(copy,args); } int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_func___va_copy=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_func___va_copy=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_func___va_copy" >&5 echo "${ECHO_T}$ac_func___va_copy" >&6 if test $ac_func___va_copy = no; then cat >>confdefs.h <<\_ACEOF #define va_copy(d,s) (d)=(s) _ACEOF else cat >>confdefs.h <<\_ACEOF #define va_copy(d,s) __va_copy(d,s) _ACEOF fi fi # Check whether --with-hylafax-spooldir or --without-hylafax-spooldir was given. if test "${with_hylafax_spooldir+set}" = set; then withval="$with_hylafax_spooldir" hylafaxspooldir="$withval" else hylafaxspooldir="/var/spool/hylafax" fi; # Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then enableval="$enable_debug" case "$enableval" in yes | true) debugflags=-g ;; no | false) debugflags=-DNDEBUG ;; *) { { echo "$as_me:$LINENO: error: bad value $enableval for --enable-debug" >&5 echo "$as_me: error: bad value $enableval for --enable-debug" >&2;} { (exit 1); exit 1; }; } ;; esac else debugflags=-DNDEBUG fi; CXXFLAGS="$CXXFLAGS $debugflags" echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi for ac_header in string.h memory.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in capi20.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------ ## ## Report this to the AC_PACKAGE_NAME lists. ## ## ------------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for capi20_register in -lcapi20" >&5 echo $ECHO_N "checking for capi20_register in -lcapi20... $ECHO_C" >&6 if test "${ac_cv_lib_capi20_capi20_register+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcapi20 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char capi20_register (); int main () { capi20_register (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_capi20_capi20_register=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_capi20_capi20_register=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_capi20_capi20_register" >&5 echo "${ECHO_T}$ac_cv_lib_capi20_capi20_register" >&6 if test $ac_cv_lib_capi20_capi20_register = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBCAPI20 1 _ACEOF LIBS="-lcapi20 $LIBS" else { { echo "$as_me:$LINENO: error: libcapi20 not found" >&5 echo "$as_me: error: libcapi20 not found" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: checking for TIFFGetVersion in -ltiff" >&5 echo $ECHO_N "checking for TIFFGetVersion in -ltiff... $ECHO_C" >&6 if test "${ac_cv_lib_tiff_TIFFGetVersion+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ltiff $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char TIFFGetVersion (); int main () { TIFFGetVersion (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_tiff_TIFFGetVersion=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_tiff_TIFFGetVersion=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_tiff_TIFFGetVersion" >&5 echo "${ECHO_T}$ac_cv_lib_tiff_TIFFGetVersion" >&6 if test $ac_cv_lib_tiff_TIFFGetVersion = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBTIFF 1 _ACEOF LIBS="-ltiff $LIBS" else { { echo "$as_me:$LINENO: error: libtiff not found" >&5 echo "$as_me: error: libtiff not found" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6 if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_create (); int main () { pthread_create (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pthread_pthread_create=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_create=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6 if test $ac_cv_lib_pthread_pthread_create = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF LIBS="-lpthread $LIBS" else { { echo "$as_me:$LINENO: error: libpthread not found" >&5 echo "$as_me: error: libpthread not found" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: checking for void *" >&5 echo $ECHO_N "checking for void *... $ECHO_C" >&6 if test "${ac_cv_type_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((void * *) 0) return 0; if (sizeof (void *)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_void_p=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_void_p=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 echo "${ECHO_T}$ac_cv_type_void_p" >&6 echo "$as_me:$LINENO: checking size of void *" >&5 echo $ECHO_N "checking size of void *... $ECHO_C" >&6 if test "${ac_cv_sizeof_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_void_p" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (void *))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (void *), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (void *)); } unsigned long ulongval () { return (long) (sizeof (void *)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (void *))) < 0) { long i = longval (); if (i != ((long) (sizeof (void *)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (void *)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_void_p=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (void *), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_void_p=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF CFLAGS=$CXXFLAGS ac_config_files="$ac_config_files Makefile src/Makefile src/defaults.h src/standard/Makefile src/capi/Makefile src/convert/Makefile src/linuxdep/Makefile src/faxrecv/Makefile src/faxsend/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/defaults.h" ) CONFIG_FILES="$CONFIG_FILES src/defaults.h" ;; "src/standard/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/standard/Makefile" ;; "src/capi/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/capi/Makefile" ;; "src/convert/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/convert/Makefile" ;; "src/linuxdep/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/linuxdep/Makefile" ;; "src/faxrecv/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/faxrecv/Makefile" ;; "src/faxsend/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/faxsend/Makefile" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@CYGPATH_W@,$CYGPATH_W,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@mkdir_p@,$mkdir_p,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@am__leading_dot@,$am__leading_dot,;t t s,@AMTAR@,$AMTAR,;t t s,@am__tar@,$am__tar,;t t s,@am__untar@,$am__untar,;t t s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t s,@MAINT@,$MAINT,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CXXDEPMODE@,$CXXDEPMODE,;t t s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t s,@EGREP@,$EGREP,;t t s,@LN_S@,$LN_S,;t t s,@ECHO@,$ECHO,;t t s,@AR@,$AR,;t t s,@ac_ct_AR@,$ac_ct_AR,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@CPP@,$CPP,;t t s,@CXXCPP@,$CXXCPP,;t t s,@F77@,$F77,;t t s,@FFLAGS@,$FFLAGS,;t t s,@ac_ct_F77@,$ac_ct_F77,;t t s,@LIBTOOL@,$LIBTOOL,;t t s,@LIBTOOL_DEPS@,$LIBTOOL_DEPS,;t t s,@INSTALL@,$INSTALL,;t t s,@hylafaxbindir@,$hylafaxbindir,;t t s,@hylafaxspooldir@,$hylafaxspooldir,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p $dirpart/$fdir else as_dir=$dirpart/$fdir as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi capi4hylafax-svn/Makefile.in0000644000175000017500000004613210470310065015656 0ustar mastermaster# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \ ChangeLog src/scripts/config.guess src/scripts/config.sub \ src/scripts/depcomp src/scripts/install-sh \ src/scripts/ltmain.sh src/scripts/missing subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print INSTALL = @INSTALL@ ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ hylafaxbindir = @hylafaxbindir@ hylafaxspooldir = @hylafaxspooldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign CLEANFILES = *~ comperr config.cache config.log MAINTAINERCLEANFILES = configure aclocal.m4 Makefile.in EXTRA_DIST = ChangeLog \ GenerateFileMail.pl \ LIESMICH.html \ README.html \ Readme_src \ install \ config.faxCAPI \ fritz_pic.tif \ sample_AVMC4_config.faxCAPI \ sample_faxrcvd \ setupconffile \ bin/c2faxsend \ bin/c2faxrecv SUBDIRS = src all: all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ cd $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkdir_p) $(distdir)/bin $(distdir)/src $(distdir)/src/scripts @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ check-am clean clean-generic clean-libtool clean-recursive \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-generic distclean-libtool distclean-recursive \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \ mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: capi4hylafax-svn/AUTHORS0000644000175000017500000000014010470310065014646 0ustar mastermastercapi4hylafax - faxing with CAPI ------------------------------- AVM capi4hylafax-svn/configure.in0000644000175000017500000000516510470310065016123 0ustar mastermasterdnl Process this file with autoconf to produce a configure script. AC_INIT AC_CONFIG_SRCDIR([src/defaults.h.in]) AC_CONFIG_AUX_DIR(src/scripts) AM_INIT_AUTOMAKE(capi4hylafax,01.03.01svn) AM_MAINTAINER_MODE CXXFLAGS="-Wall -W -O2 $CXXFLAGS -D_GNU_SOURCE -DDONT_USE_PROTECT_FEATURE" AC_LANG([C++]) dnl Checks for programs. AC_PROG_CXX AC_PROG_MAKE_SET AC_PROG_INSTALL AC_PROG_LIBTOOL dnl Check for va_copy in stdarg.h AC_CACHE_CHECK([for va_copy],ac_func_va_copy,[ AC_LINK_IFELSE([AC_LANG_PROGRAM([ #include void x(va_list args) { va_list copy; va_copy(copy,args); } ], []) ], [ac_func_va_copy=yes], [ac_func_va_copy=no]) ]) if test $ac_func_va_copy = no; then AC_CACHE_CHECK([for __va_copy],ac_func___va_copy,[ AC_LINK_IFELSE([AC_LANG_PROGRAM([ #include void x(va_list args) { va_list copy; __va_copy(copy,args); } ], [])], [ac_func___va_copy=yes], [ac_func___va_copy=no]) ]) if test $ac_func___va_copy = no; then AC_DEFINE(va_copy(d,s),(d)=(s)) else AC_DEFINE(va_copy(d,s),__va_copy(d,s)) fi fi AC_SUBST(LIBTOOL_DEPS) dnl Optional hylafax spool directory AC_ARG_WITH(hylafax-spooldir, AC_HELP_STRING([--with-hylafax-spooldir=DIR], [Set dir where hylafax spool is installed. (/var/spool/hylafax)]), hylafaxspooldir="$withval", hylafaxspooldir="/var/spool/hylafax" ) dnl Optional debug AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],[Turn debugging on (default=no)]), [case "$enableval" in yes | true) debugflags=-g ;; no | false) debugflags=-DNDEBUG ;; *) AC_MSG_ERROR(bad value $enableval for --enable-debug) ;; esac], [debugflags=-DNDEBUG] ) CXXFLAGS="$CXXFLAGS $debugflags" dnl AM_CONDITIONAL(NDEBUG, test x$debug = xfalse) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(string.h memory.h) AC_CHECK_HEADERS(capi20.h) AC_CHECK_LIB(capi20, capi20_register, , AC_MSG_ERROR(libcapi20 not found)) AC_CHECK_LIB(tiff, TIFFGetVersion, , AC_MSG_ERROR(libtiff not found)) AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(libpthread not found)) AC_CHECK_SIZEOF(void *) dnl Read the libtool configuration dnl rm -f conftest dnl ./libtool --config > conftest dnl . ./conftest dnl rm -f conftest CFLAGS=$CXXFLAGS AC_SUBST(INSTALL) AC_SUBST(hylafaxbindir) AC_SUBST(hylafaxspooldir) AC_SUBST(CFLAGS) AC_SUBST(CXXFLAGS) AC_CONFIG_FILES([Makefile src/Makefile src/defaults.h src/standard/Makefile src/capi/Makefile src/convert/Makefile src/linuxdep/Makefile src/faxrecv/Makefile src/faxsend/Makefile]) AC_OUTPUT capi4hylafax-svn/ChangeLog0000644000175000017500000001134110470310065015355 0ustar mastermaster2005-08-18 Michael Rolf * C4H now use a fixed named config file: /etc/config.faxCAPI * This fixes a sending problem with the Hylafax workaround for multiple devices 2005-08-11 Michael Rolf * c2faxsend now supports multiple comma seperated q-files * sff2huf filter now use the pageheaderlen from the sff and not a static value anymore * switched from cvs to subversion / fix tiff which had text-attribute after the switch 2005-08-04 Michael Rolf * Now detect 64Bit and set needed defines for it * Send correct feature list to Hylafax (Fix problem with Hylafax 4.2.1) * c2faxrecv terminates more cleanly (incl. down info to Hylafax) * New switch -L to activate logging a little easier * Better checking (Correct TIFF and count of illegal lines in sff) * c2faxrecv can now be terminated with faxquit * fax option JBIG is now active * tries counter in qfile now incremented by 1 * some more little fixes 2005-04-01 Michael Rolf * Fix for handling an empty DDIOffset 2004-05-20 Michael Rolf * 2.6er Fix: sem_wait is restarted after a timer signal 2003-08-13 Michael Rolf * MSNList is fixed for IncomingDDIs/MSNs. * Partially Output of used configuration 2003-07-14 Michael Rolf * Simple support for Hylafax's tagline added 2003-07-10 Michael Rolf * Some fixes in and for the config file parser 2003-07-09 Michael Rolf * Fix: MaxConcurrentRecvs=0 works now * Fix: High CPU usage with C2/C4 and DDI 2003-07-08 Michael Rolf * Fix check for illegal digits in telnumber. *, # and R are allowed again. * qfile status changed during fax transfer (thanks to T.Jarosch) * New config.faxCAPI options: FaxReceiveGroup (thanks to T.Jarosch), NumberPlusReplacer * Update of the CAPI State Machine 2003-03-10 Michael Rolf * install doesn't change the faxrcvd file attributes anymore * xferfaxlog fixes * TelNumber in Hylafax mode can include word separator now 2003-01-08 Michael Rolf * Workaround for the AVM C4 that it does not cut off the end of faxes anymore. 2002-12-10 Michael Rolf * The ConnectResp-ConnectedPartyNumber is filled with the CalledPartyNumber digits. Important for some TelCos. 2002-12-02 Michael Rolf * c2faxsend filters the telephone number to remove invalid characters 2002-11-28 Michael Rolf * File Descriptor was not resetet after use so some threads could write in the same file * c2faxsend forgot to call DisconnectB3Req in SFF Mode * Changes to support 64Bit architectures (thanks to K.Keil) * Some more va_list fixes (thanks to K.Keil) 2002-11-01 Michael Rolf * Changed to HTML Readmes 2002-10-17 Michael Rolf * "Global Call" incoming calls can now be accepted or rejected (thanks to K.Keil) 2002-10-09 Michael Rolf * va_list * and va_list in va_list are removed, because they work only on i386's * all outputs in the DebugClasses are changed because of the va_list problem * little updates of some classes in the standard directory 2002-10-01 Michael Rolf * faxrcvd is always called with 7 Parameters (6 Parameter from Hylafax >= 4.1.2 and the MSN/destination) * install patches faxrcvd that it ignores to many parameters 2002-08-28 Michael Rolf * c2faxsend: DisconnectB3Req is called directly after the last DataB3Req * c2faxrecv detects if a device is not configured for receiving faxes 2002-08-23 Michael Rolf * xferfaxlog support now included in C4H * the hylafax sources are no longer needed to compile C4H 2002-08-21 Michael Rolf * Fix: Timer-Notification leads to segmentation fault * ReceiveID is cleared if CallingPartyNumber is empty * Every new entry in the logfile is fflushed 2002-07-19 Michael Rolf * changed filenames from absolute to relative ones, so hylafax returns the correct place in the fax receive mail 2002-05-22 Michael Rolf * scripts update for automake 1.5 * setting NDEBUG define moved from Makefile.am to configure.in 2002-04-09 Michael Rolf * recvmain: changing of gid fixed * changed va_arg calls to support gcc 3.0 * sample_faxrcvd: ps2pdf can't handle filenames with spaces 2002-03-25 Michael Rolf * c2faxsend: fixed calculation of xferfaxlog's duration and conntime * c2faxrecv: xferfaxlog's duration and conntime can be differ now 2002-03-12 Michael Rolf * detection improved: fax file missing, not all pages transmitted * state machine fixes in c2faxrecv 2002-03-06 Michael Rolf * both numbers in a DDI ranges must have the same amount of digits * some fixes for CAPI not active or removed 2002-02-21 Michael Rolf * new config-switch IncomingDDIs (like IncomingMSNs for DDI). * IncomingDDIs support ranges (e.g. 100-300) * moved Linux specific files to linuxdep 2002-01-09 Michael Rolf * removed unused readme's * ChangeLog added to cvs * binaries for install now under ./bin/ 2001-12-20 Michael Rolf * ChangeLog generated * update of capi state machine * fax polling client capi4hylafax-svn/sample_faxrcvd0000755000175000017500000000613510470310065016534 0ustar mastermaster#!/bin/sh # # This is a sample of a receive script for c2faxrecv if runing in # stand alone mode. # For scripts for the hylafax mode take a look at # /var/spool/fax/bin/faxrcvd or www.hylafax.org. # # This script converts a TIFF-File to a PDF and sends a mail to different # mail addresses (depending on the MSN) with the PDF file attached. # This sample needs GenerateFileMail.pl to send mails with attachement and # GenerateFileMail.pl needs perl and mimencode from the metamail packet. # # # "stand alone" calling parameters are: # [Result Code] [CAPI Disconnect Reason] [Sender ID or Number] # [Called Number (MSN) or DDI] [Num of Pages] [Filename(s) without path] # # For your information: "hylafax" calling parameters are: # [TIFF-File] [ModemDeviceID] [CommID] [Reason Text] [Calling Number] [ReceiveID] [MSN] # # # Check command line # if [ $# -lt 6 ] ; then echo "ERROR - Missing parameters!" echo "" echo "Call: $0 ResultCode CAPIReason SenderID MSN NumPages Filename [Filename2 [...]]" fi # # Get current time and set sender mail address # CurrentDate="`date`" SenderAddr="uucp" # # Remember Filename # [ Normally there is only one file specified (Exception: The "G3" format) # and this sample handles mostly only one file. ] # SendFile="$6" # If someone needs an absolute path uncomment the following line: #SendFile=`pwd`"/$SendFile" # # Transform "Result Code" to text. # ResultString="Okay" case "$1" in 6) ResultString="Can't build up B-Channel for incoming call." ;; 7) ResultString="Connection established, but no fax transfer occured." ;; 12) ResultString="Error during fax receiving. Fax was only be received partially." ;; esac # # Convert TIFF File to PDF # #FileMimeType="image/tiff" FileMimeType="application/octet-stream" if [ -n "`echo "$SendFile" | grep "\.tif$"`" ] ; then OrgSendFile=$SendFile SendFile="`echo "$OrgSendFile" | sed -e 's/\.tif//'`.pdf" FileMimeType="application/pdf" tiff2ps -a "$OrgSendFile" | ps2pdf13 - - > "$SendFile" # ps2pdf-workaround, because ps2pdf can't handle file names with spaces fi # # Get a mail address from the MSN # MailAddr=unresolvedfax@test.de case "$4" in 123400) MailAddr=mueller@test.de ;; 123401) MailAddr=meier@test.de ;; esac # # Generates mail text # SubjectText="Fax from \"$3\"" MailText="Received a new fax with result: $ResultString (CAPI: $2) from: $3 to: $4 pages: $5 at: $CurrentDate file: $SendFile" # if c2faxrecv was started with -f G3 then you can get more than one file shift 6 while [ -n "$1" ] ; do MailText="$MailText $1" shift done # # Send Mail # if [ "$MailAddr" = "root" ] ; then # # only a notification for root # echo "$MailText" | mail -s "$SubjectText" "$MailAddr" else # # attach fax file # perl GenerateFileMail.pl "$SenderAddr" "$MailAddr" "$SubjectText" "$MailText" "Fax Information" \ "$SendFile" "$FileMimeType" "`basename \"$SendFile\"`" "$SubjectText" | \ /usr/sbin/sendmail "$MailAddr" fi capi4hylafax-svn/LIESMICH.html0000644000175000017500000010607610470310065015700 0ustar mastermaster CAPI4HylaFAX

Produkt: CAPI4Linux, Modul: CAPI4HylaFAX
Betriebssystem: Linux
Version: 01.03.00
Build: 05.08.12

Willkommen zu CAPI4HylaFAX

Dieses Dokument enthält Informationen und Hinweise

  • zur Anbindung von HylaFAX an AVM ISDN-Controller über die Anwendungsschnittstelle CAPI 2.0
  • zur Handhabung von HylaFAX
  • zum Konvertieren von vorhandenen Dokumenten

Inhalt

1 Allgemeines zu Fax G3 über die Anwendungsschnittstelle CAPI 2.0 mit AVM ISDN-Controllern

1.1 HylaFAX und die ISDN-Anbindung über CAPI 2.0

1.2 Wichtige Hinweise für die Installation der HylaFAX-Schnittstelle für CAPI 2.0

2 Installation der HylaFAX-Schnittstelle für CAPI 2.0 in SUSE-Distributionen

2.1 Installationsvoraussetzungen

2.2 Installation

2.3 Handhabung in HylaFAX

2.4 Faxe versenden mit HylaFAX

2.5 Faxempfang mit HylaFAX

2.6 Weitere Hinweise

3 Installation der HylaFAX-Schnittstelle für CAPI 2.0 in anderen Distributionen

4 Hinweise zum Dateiformat und zur Konvertierung bestehender Dateien

5 Hinweise zum Betrieb mit mehreren AVM ISDN-Controllern

6 Hinweise für den Betrieb mit Faxabruf-Funktion (Faxpolling)

7 Weitere Informationsquellen

8 Supportleistungen

1 Allgemeines zu Fax G3 über die Anwendungsschnittstelle CAPI 2.0 mit AVM ISDN-Controllern

Die Nutzung des analogen Fax G3-Dienstes über das digitale ISDN-Netz setzt eine Analog/Digital- bzw. Digital/Analog-Wandlung (A/D- bzw. D/A-Wandlung) der zu übertragenden Daten und eine dem Fax G3-Standard (unter anderem ITU-T.30) entsprechende Signalisierung voraus.

Im Rahmen des CAPI 2.0-Standards ist dieser Protokollmechanismus verbindlich standardisiert (T.30 modem for Group 3 fax). Die Einbindung dieses Protokolls durch den Hersteller des ISDN-Controllers ist optional. Wenn Fax G3 im CAPI 2.0-Treiber eingebunden ist, so kann eine für die Anwendungsschnittstelle CAPI 2.0 entwickelte Software direkt und damit sehr komfortabel auf den ISDN-Controller zugreifen. Alle derzeit von CAPI4Linux unterstützten AVM ISDN-Controller für den ISDN-Basisanschluss bieten eine Fax G3-Unterstützung über die Anwendungsschnittstelle CAPI 2.0 an.

Beachten Sie, dass bei Verwendung von passiven ISDN-Controllern, wie zum Beispiel der AVM FRITZ!Card, der gesamte Rechenaufwand für die A/D- bzw. D/A-Wandlung auf der CPU Ihres Rechnersystems abgewickelt werden muss. Dies führt gerade beim Empfang von Fax G3-Dokumenten zu einer relativ hohen Systembelastung. Aktive ISDN-Controller, wie zum Beispiel die ISDN-Controller der AVM ISDN-Controller-Familie B1, vermeiden dies durch einen eigenen Chip auf dem ISDN-Controller.

Zurück zum Anfang

1.1 HylaFAX und die ISDN-Anbindung über CAPI 2.0

Die momentan vorliegende Version von HylaFAX bietet leider keine direkte Anbindung an CAPI 2.0, sondern nur eine Anbindung für analoge Modems. Bisher konnten nur aktive ISDN-Controller wie der AVM ISDN-Controller B1 nachträglich per Patch an HylaFAX angebunden werden.

Im Rahmen des vorliegenden Paketes "CAPI4Linux" können nun prinzipiell alle ISDN-Controller verwendet werden, die über einen faxfähigen CAPI 2.0-Treiber gemäß Linux CAPI 2.0-Spezifikation verfügen. Lesen Sie dazu auch die CAPI 2.0-Spezifikation unter:
http://www.capi.org

Es wird damit unter anderem möglich, auch mit den weit verbreiteten passiven ISDN-Controllern unter Linux zu faxen. Dank CAPI 2.0 können auch mehrere ISDN-Dienste parallel genutzt werden, wie zum Beispiel Fax G3-Empfang und eine Verbindung zum Internet via pppd. Die Zuordnung der ISDN B-Kanäle erfolgt dabei automatisch durch den CAPI 2.0-Treiber.

Es können bis zu vier aktive AVM ISDN-Controller pro System mit CAPI4Linux-Treibern installiert werden. Auch beliebige Mischkonfigurationen, z.B. ein AVM ISDN-Controller B1 PCI, ein Controller B1 ISA plus zwei ISDN-Controller C2 sind möglich. Das CAPI4HylaFAX-Modul muss dann entsprechend für den Betrieb mit mehreren ISDN-Controllern konfiguriert werden. Beachten Sie auch die Hinweise in Abschnitt 3.

In einem System kann immer nur ein passiver ISDN-Controller, wie beispielweise die FRITZ!Card PCI, mit Hilfe der CAPI4Linux-Treiber installiert werden.

Die jeweils neueste Version von HylaFAX und weitere Informationen finden Sie unter:
http://www.hylafax.org

Zurück zum Anfang

1.2 Hinweise für die Installation der HylaFAX-Schnittstelle für CAPI 2.0

Ab der aktuellen HylaFAX-Version (Stand der SUSE 8.1 CDs) übergibt CAPI4HylaFAX immer sieben Parameter an das HylaFAX faxrcvd. Alle älteren SUSE Linux-Versionen oder Original-HylaFAX-Versionen erwarten weniger Parameter. Der Unterschied zum Orginal-HylaFAX besteht in dessen eingeschränktem Analog-Modell, das die wichtige Auswertung des ISDN-Merkmals MSN beziehungsweise DDI zur E-Mail-Weiterleitung nicht erlaubt.

Das hier vorliegende CAPI4HylaFAX-Installationsskript passt automatisch ein vorhandenes faxrcvd-Skript so an, dass ältere faxrcvd-Skripte trotzdem weiterhin mit der aktuellen CAPI4HylaFAX-Version arbeiten können.

Etwa in Zeile 33 geht damit folgende Änderung einher:

# faxrcvd file devID commID error-msg CIDNumber CIDName destination
#
if [ $# -lt 7 ]; then
echo "Usage: $0 file devID commID error-msg CIDNumber CIDName destination"
fi

Die folgende Tabelle nennt die Parameter des faxrcvd in einer Kurzbeschreibung:

Parameter Bedeutung
qfile Steht für die empfangene TIFF-, beziehungsweise SFF-Fax-Datei.
devid Bezieht sich auf das virtuelle Modem Device, das CAPI zum Faxen benötigt (z.B. faxCAPI).
commid Durchlaufende Identifikationsnummer für eingehende Anrufe (Faxe).
error-msg Enthält einen Eintrag, wenn während des Faxempfangs Probleme aufgetreten sind.
cidnumber Fax-Nummer des Senders. Wird keine Faxnummer beim Versand übermittelt, wird diese durch die Nummer der Rufnummernübermittlung ersetzt.
cidname Fax-Name des Senders.
destination Durchwahl des Empfängers (MSN bzw. DDI)*.

*Benutzer; die die CAPI4HylaFAX-Version unter SUSE Linux 7.2 bis SUSE Linux 8.0 einsetzen möchten und die eine Faxweiterleitung von einer bestimmten MSN bzw. DDI wünschen, müssen ihr faxrcvd-Skript manuell anpassen, da sich die Reihenfolge der Parameter je nach HylaFAX- und SUSE-Version gändert hat!

Weitergehende Informationen zum faxrcvd finden Sie in der entsprechenden manual page, die Sie mit dem Kommando "man faxrcvd" auf einer Konsole aufrufen können.

HINWEIS Sollten Sie "GlobalCall" nutzen, beachten Sie bitte den folgenden Hinweis: Bei dem in Österreich verbreiteten "GlobalCall" wird Ihre Hauptrufnummer nicht übermittelt, wodurch der Parameter "IncomingMSN" in der Datei "config.faxCAPI" wirkungslos wird. Daher werden alle auf der Hauptrufnummer eingehenden Sprach- und Faxanrufe angenommen. Wollen Sie die automatische Rufannahme durch CAPI4HylaFAX für die Hauptrufnummer unterbinden, müssen Sie den Parameter "AcceptGlobalCalls" auf "0" stellen. In allen anderen Fällen ist der voreingestellte Wert "1" der richtige.

Mehr Infos zu HylaFAX und zur Verwendung des faxrcvd-Skriptes erhalten Sie unter:
http://www.hylafax.org

Zurück zum Anfang

2 Installation der HylaFAX-Schnittstelle für CAPI 2.0 in SUSE-Distributionen

Beachten Sie vor der Installation die folgenden Vorausetzungen.

2.1 Installationsvoraussetzungen

  • SUSE Linux 9.1/9.2/9.3
  • Ein installiertes HylaFAX-Paket inklusive der TIFFLIB. Die aktuellste Version finden Sie unter: http://www.hylafax.org
  • Die Installation muss als "root" durchgeführt werden. Das heißt, Sie müssen als "Superuser" im System angemeldet sein.
  • Es müssen Lese- und Schreibrechte (rw) auf "dev/capi20" für den Faxuser eingerichtet sein. Siehe Abschnitt "Handhabung in HylaFAX".
  • Ein bis maximal vier beliebige aktive AVM ISDN-Controller oder ein beliebiger passiver AVM ISDN-Controller mit korrekt installiertem CAPI 2.0-Treiber aus dem CAPI4Linux-Paket muss installiert sein. Die Nutzung der HylaFAX-Schnittstelle "CAPI4HylaFAX" mit dem Paket ISDN4Linux ist nicht möglich (keine CAPI 2.0-Schnittstelle).
  • Achten Sie bei der 64-Bit-Version von SUSE Linux 9.x drarauf, dass die Pakete "zlib-devel", "libjpeg" und "libtiff" installiert sind. Es gibt außerdem einen fehlerhaften Eintrag in der Datei "/usr/lib64/libcapi20.la". Damit CAPI4HylaFAX übersetzt werden kann, muss der Eintrag am Ende der Datei wie folgt aussehen:
    #Directory that this library needs to be installed in:
    libdir='/usr/lib64'
HINWEIS AVM liefert für SUSE Linux vorkompilierte Objekte mit, die eine besonders einfache Installation in diesen Distributionen erlauben. Wenn Sie eine andere Distribution benutzen, finden Sie entsprechende Informationen im Abschnitt "Installation der HylaFAX-Schnittstelle für CAPI 2.0 in anderen Distributionen".

Zurück zum Anfang

2.2 Installation

HINWEIS Deinstallieren Sie bitte die ältere Version von CAPI4HylaFAX, bevor Sie eine neue Version installieren!
  1. Kopieren Sie das Archiv "CAPI4HylaFAX-VersionsNr.tar.gz" aus dem CAPI4Linux-Archiv auf Ihren Computer (zum Beispiel von einer Diskette durch den auf einer Konsole eingegebenen Befehl "mcopy").
  2. Starten Sie eine Konsole (Eingabeaufforderung).
  3. Extrahieren Sie das Archiv mit folgendem Befehl:
    tar -xzvf capi4hylafax-xx.yy.zz.tar.gz
    Ein Verzeichnis mit dem Namen "capi4hylafax-xx.yy.zz" wird erzeugt.
  4. Wechseln Sie in dieses neue Verzeichnis "capi4hylafax-xx.yy.zz".
  5. Rufen Sie "./install" auf.
    Es erfolgt eine automatische Überprüfung auf ein installiertes HylaFAX. Wird das HylaFAX-Paket nicht gefunden, erfolgt eine entsprechende Meldung. In diesem Fall müssen Sie das "HylaFAX spool directory" manuell per Parameter angeben.
    HINWEIS Wenn Sie ein Fax ohne HylaFAX-Unterstützung senden bzw. empfangen wollen, installieren Sie einfach den Stand-Alone-Betrieb ohne automatische HylaFAX-Konfiguration mit "./install -s".
    Mit "./install -h" erhalten Sie eine Parameterübersicht mit erweiterten Installationsoptionen.

    Sie können nun mit Hilfe eines grafischen Menüsystems die Erstkonfiguration der wichtigsten Parameter für den Faxbetrieb für einen installierten AVM ISDN-Controller vornehmen. Weitere Parameter wie z. B. Faxpolling können direkt in der Datei "config.faxCAPI" konfiguriert werden. Diese Parameter sind direkt in dieser Datei dokumentiert. Bei der Konfiguration über das Menüsystem stehen folgende Einstellungen zur Verfügung:
    Parameter Bedeutung
    OutgoingMSN Festlegung der abgehenden MSN am ISDN-Basisanschluss. Hiermit kann eine vorher festgelegte MSN aus dem Rufnummernvorrat für abgehende Verbindungen zum Zwecke einer separaten Gebührenabrechnung benutzt werden. Einige TK-Anlagen mit internem S0-Bus verlangen zwingend die Angabe der MSN der benutzten Nebenstelle.
    IncomingMSNs Festlegung der eingehenden MSN am ISDN-Basisanschluss. Werden mehrere ISDN-Geräte mit der gleichen ISDN-Dienstekennung am Basisanschluss betrieben, so müssen diese Geräte eindeutig über eine festgelegte MSN angesprochen werden. Wird dieser Parameter NICHT festgelegt, so werden alle eingehenden Rufe mit der Dienstekennung "Group 2/3 Fax" und "Telephony (analog)" angenommen. Sollen mehrere MSNs verwendet werden, so müssen diese mit einem Komma voneinander getrennt werden.
    DDIParams Festlegung von Parametern für den Betrieb an einem ISDN-Anlagenanschluss mit Durchwahlmöglichkeit (DDI). "DDIOffset": gibt die Stammnummer an.
    Beispiel: 39976-0 => DDIOffset=39976 (Stammnummer)
    "DDILength": Länge der Durchwahlziffern.
    Beispiel: 4711 => DDILength=4
    "IncomingDDIs": Liste von Durchwahlziffern, die angenommen werden sollen.
    FaxNumber Festlegung der Faxnummer, die beim Empfänger im Fax-Header angezeigt wird.
    ACHTUNG: HylaFAX kann keine Leerzeichen verarbeiten. Nutzen Sie stattdessen folgenden Eintrag: ".". Dieser wird dann automatisch in ein Leerzeichen ungewandelt.
    FaxIdentifier Festlegung für den lokalen Namen (Station ID), der beim Empfänger im Fax-Header angezeigt wird.
    NumberPrefix Festlegung der für die Angabe einer Amtsholung notwendigen Ziffer beim Betrieb an TK-Anlagen. Das ist zumeist die "0".

    ACHTUNG Wenn Sie nach erfolgter Installation des CAPI4HylaFAX-Moduls Änderungen vornehmen wollen oder mehr als einen aktiven AVM ISDN-Controller für den Faxbetrieb mit HylaFAX konfigurieren möchten, dann MÜSSEN Sie die entsprechenden Einstellungen manuell mit Hilfe eines Editors direkt in der config.faxCAPI vornehmen. Diese Datei wird sowohl von HylaFAX als auch von den beiden Anwendungen "c2faxsend" und "c2faxrecv" benutzt:
    /etc/config.faxCAPI (in SUSE-Linux)

  6. Die Konfigurationsdatei "config.faxCAPI" wird nun automatisch erzeugt. Die Anwendungen "c2faxsend" und "c2faxrecv" suchen die Konfigurationsdatei "config.faxCAPI" unter "var/spool/fax/etc/". Ist diese Datei nicht oder nicht mehr vorhanden, dann werden automatisch die Standardeinstellungen benutzt. Um diese Konfigurationsdatei an anderer Stelle im System zu platzieren, muss der Ort über "-C FILE" beim Aufruf der Anwendung mit angegeben werden.
    An dieser Stelle kann ein schneller Funktionstest im Stand-Alone-Betrieb durchgeführt werden, da hierfür noch keinerlei Komponenten von HylaFAX benötigt werden. Versenden oder empfangen Sie ein Fax von der Kommandozeile mit Hilfe der beiden folgenden Anwendungen:
    Senden c2faxsend -f TIFF -d [TelNum] [TIFF-Datei]
    c2faxsend -f SFF -d [TelNum] [SFF-Datei]
    Empfangen c2faxrecv -f TIFF
    c2faxrecv -f SFF

    Der Parameter -h gibt bei beiden Anwendungen eine vollständige Übersicht der implementierten Optionen.
    Im Stand-Alone-Betrieb ohne HylaFAX muss "c2faxrecv" nicht laufen, wenn ein Fax gesendet werden soll. "c2faxsend" kann nur die Dateiformate "TIFF" (class F, FAX G3, 1 Dim-Huffmann-Kodierung) und "SFF" verwenden. Um ein Dokument versenden zu können, muss es vorher mit einen entsprechenden Programm, beispielsweise mit Ghostscript, konvertiert werden. AVM liefert dazu die Beispieldatei "fritz_pic.tif" im passenden TIFF-Format mit. Der Befehl zum Senden des AVM-Testfaxes an eine beliebige Fax G3-Gegenstelle lautet somit
    c2faxsend -vf TIFF -d [TelNum] fritz_pic.tif
    Im Abschnitt "Hinweise zum Dateiformat und zur Konvertierung bestehender Dateien" finden Sie weitere Hinweise zum verwendeten TIFF-Format.

Zurück zum Anfang

2.3 Handhabung in HylaFAX

Für die Benutzung von HylaFAX wurden bereits während der Installation (siehe Abschnitt "Installation" Schritt 5) einige vorbereitende Schritte automatisch durch das Installationskript durchgeführt.

Wenn HylaFAX benutzt werden soll, dann beachten Sie folgende Punkte:

  • Das in der Installation ausgeführte Script "./install" kopiert die Fax-Dateien nach "/usr/local/bin".
  • Es wird automatisch nach HylaFAX gesucht. Dabei werden sowohl im HylaFAX "config file" als auch in der Datei "/etc/inittab" die notwendigen Modifikationen vorgenommen, um Faxe über CAPI 2.0 senden und empfangen zu können.
  • Es können nur dann Faxe mit HylaFAX gesendet und empfangen werden, wenn "c2faxrecv" aktiv ist. Deshalb wurde dieses Programm automatisch in die Datei "/etc/inittab" eingetragen.
  • Für den Fax-User müssen Lese- und Schreibrechte (rw) auf "dev/capi20" und "/var/spool/hylafax" bzw. "/var/spool/fax" eingerichtet werden, was nicht standardmäßig der Fall ist. Wenn "c2faxrecv" von "root" aufgerufen wird, ändert "c2faxrecv" den Benutzer "root" in den Benutzer "fax" der Gruppe "dialout". Für den allgemeinen "Anwenderzugriff" auf CAPI 2.0 müssen die Rechte von "/dev/capi20" und "/var/spool/hylafax" bzw. "/var/spool/fax" auf "0666" geändert werden.
  • Wenn ein Neustart vermieden werden soll, kann nach der Installation einfach "c2faxrecv &" aufgerufen werden. Eventuell muss dann zuvor das HylaFAX-Programm "faxq" beendet und neu gestartet werden, damit die veränderten Einstellungen in der Konfigurationsdatei (config file) dieses Programms aktiv werden

Zurück zum Anfang

2.4 Faxe versenden mit HylaFAX

Zum Senden rufen Sie einfach "sendfax -d [TelNum] Datei" auf. Die Datei kann ein fast beliebiges Format haben. Die Programme "file" oder "a2ps" müssen das Format lesen können, damit die Datei richtig in das PS-Format und anschließend in das TIFF-Format konvertiert werden kann. Es gibt grafische Frontends, die die Arbeit mit HylaFAX etwas erleichtern. Weitere Informationen hierzu finden Sie in der Dokumentation unter:

http://www.hylafax.org

Wenn aus einer Anwendung heraus gefaxt werden soll, muss die Druckerkonfiguration in der entsprechenden Anwendung angepasst werden. Normalerweise kann dort eine Kommandozeile eingegeben werden, die zum Drucken ausgeführt wird. Meist steht dort nur "lpr". Das muss dann durch "sendfax -d [TelNum]" ersetzt werden. Diese Funktionen sind programmabhängig und sollten in den jeweiligen Hilfen dokumentiert sein.

Zurück zum Anfang

2.5 Faxempfang mit HylaFAX

Nach einem Faxempfang via HylaFAX wird dem User "root" durch das Skript "faxrcvd" eine Empfangsmail geschickt.
Bei Benutzung des Faxmoduls "c2faxrecv" im Stand-Alone-Betrieb kann durch das mitgelieferte Beispielskript "sample_faxrcvd" eine analoge Funktionalität erreicht werden.
Nach Empfang eines Faxes wird das in der Konfigurationsdatei angegebene Script (bei HylaFAX "faxrcvd") mit folgenden Parametern wie folgt aufgerufen:

Stand-Alone-Betrieb [Result Code] [CAPI Disconnect Reason] [Sender ID] [Called Number or DDI] [Num of Pages] [File(s)]
HylaFAX-Modus [faxrcvd file] [devID] [commID] [error-msg] [CIDNumber] [CIDName] [destination]

Weitere Details zum Faxempfang mit HylaFAX finden Sie in der HylaFAX-Dokumentation.

Zurück zum Anfang

2.6 Weitere Hinweise

  • Die Konfigurationsdatei (config file) muss unbedingt im "etc"-Verzeichnis von HylaFAX liegen.
  • Auch, wenn nur Faxe versendet werden sollen, muss "c2faxrecv" laufen.
  • Zum Faxempfang führen Sie einfach "c2faxrecv &", zum Beispiel in einem Startskript, aus, wenn es nicht bereits in "etc/inittab" erfolgt ist.
  • "Device"-Namen: Da die Anwendungen als CAPI 2.0-Anwendungen auf CAPI 2.0 direkt aufsetzen, ist diese Angabe eigentlich nicht nötig. In der Kommandozeile kann der Name des Gerätes (device) angegeben werden, HylaFAX trägt diesen Eintrag aber automatisch ein. Dieser Name wird nur zur Signalisierung an HylaFAX und zur Bestimmung des Namens der Konfigurationsdatei benutzt: "config.[Device Name]". Auf diesem Wege können also auch mehrere "c2faxrecv"-Dämons inklusive ihrer Konfigurationsdateien verwaltet werden. Eine alternative Möglichkeit ist der "-C"-Schalter.
  • Sollten nach der Installation unerwartete Probleme beim Faxversand auftreten, so wurde die Konfigurationsveränderung durch HylaFAX eventuell noch nicht korrekt verarbeitet. In diesem Fall ist ein manueller Aufruf von "faxsetup" oder alternativ "faxmodem faxCAPI" als "root" mit den Rechten eines Superusers hilfreich, um HylaFAX die Änderung mitzuteilen.
  • Für ein ausführliches Logging muss im config.faxCAPI das "#" vor dem Eintrag "LogTraceLevel:4" entfernt werden. Das Logfile wird standardmäßig unter "/tmp/capifax.log" abgelegt.

Zurück zum Anfang

3 Installation der HylaFAX-Schnittstelle für CAPI 2.0 in anderen Distributionen

Wenn Sie andere Distributionen oder Kernelversionen als SUSE verwenden, können Sie CAPI4HylaFAX normalerweise problemlos verwenden. Nur wenn die CAPI4HylaFAX-Installationsroutine fehlende Programmbibliotheks-Dateien (libraries) feststellt, sollten die mitgelieferten Source-Dateien im Verzeichnis "/src" übersetzt werden. Um diesen Vorgang zu vereinfachen, liefert AVM "makefiles" mit. Weitere Details zum Übersetzen der Source-Dateien finden Sie in der Datei "README.src".

Zurück zum Anfang

Hinweise zum Dateiformat und zur Konvertierung bestehender Dateien

TIFF (Tagged Image File Format)-Dateien müssen der Spezifikation "Class F for facsimile (TIFF Class F)", basierend auf der TIFF 6.0-Spezifikation, entsprechen. Zusätzlich muss die Datei eine eindimensionale Huffmann-Kodierung aufweisen. Dieses Format ist von der CCITT (The International Telegraph and Telephone Consultative Committee) unter "Group 3" spezifiziert worden. Weitere Informationen zum TIFF-Format finden Sie im "Developer"-Bereich von Adobe Systems Incorporated im Internet unter:
http://www.adobe.com

Konvertieren bestehender Dateien mit Ghostscript

Um aus einer Postscript-Datei eine für die Faxanwendung konforme TIFF-Datei zu machen, kann folgender Aufruf von Ghostscript verwendet werden:

gs -dBATCH -dNOPAUSE -sDEVICE=tiffg3 -sOutputFile=[Name der Tiff-Datei] [Name der Postscript-Datei]

Informationen zum SFF-Format sind in der CAPI 2.0-Spezifikation unter http://www.capi.org dokumentiert.

Zurück zum Anfang

5 Hinweise zum Betrieb mit mehreren AVM ISDN-Controllern

Über die CAPI 2.0-Schnittstelle können bis zu vier beliebige aktive AVM ISDN-Controller angesprochen werden. Auch eine Mischkonfiguration über Bussysteme wie PCI, ISA und PCMCIA ist problemlos möglich. Details zur Installation der ISDN-Controller finden Sie in der Dokumentation zum Linux CAPI 2.0-Treiber-Modul.

Das CAPI4HylaFAX-Modul unterstützt den Betrieb mit mehreren aktiven AVM ISDN-Controllern im Sende- und Empfangsbetrieb in HylaFAX simultan. Hierzu sind lediglich nach der Installation des CAPI4HylaFAX-Moduls einige manuelle Modifikationen in der Konfigurationsdatei "/etc/config.faxCAPI" notwendig, da die oben beschriebene grafisch unterstützte Installationsroutine nur für Controller 1 ausgelegt ist. Die weiteren in der Konfigurationsdatei "config.faxCAPI" befindlichen Parameter zum Betrieb mit mehreren AVM ISDN-Controllern sind dort dokumentiert. Nachdem die Konfigurationsdatei geändert wurde, muss zur Übernahme der Änderung das Modul "c2faxrecv" gestoppt und wieder gestartet werden.

Für den Betrieb mit dem AVM ISDN-Controller C4 oder ISDN-Controller C2 wird ein bereits vorkonfiguriertes Beispiel-Skript mitgeliefert. Dieses Skript heißt "sample_AVMC4_config.faxCAPI". Durch die Anpassungen dieses Skriptes an die jeweiligen individuellen Gegebenheiten, zum Beispiel MSNs, wird die Konfiguration von Mehrkanal-Controllern für CAPI4HylaFAX erleichtert.

Zurück zum Anfang

6 Hinweise für den Betrieb mit Faxabruf-Funktion (Faxpolling)

Faxabruf (auch Faxpolling genannt) wird mit dieser Version erstmalig unterstützt. Ein Betrieb im Client-Modus ist möglich, das heißt CAPI4HylaFAX kann zum Abholen (polling) von Faxdokumenten eingesetzt werden. Die Bereitstellung von Faxdokumenten für den Abruf durch Anrufer im Servermodus ist nicht möglich.

Aufruf von Faxpolling im Stand-Alone-Modus:

c2faxsend -vf TIFF -d [TEL-Nummer] -P [E-Mail-Adresse]

Aufruf von Faxpolling im HylaFAX-Modus

sendfax -d [TEL-Nummer] -p

In beiden Fällen wird nach Empfang ein Skript aufgerufen und unter anderem die E-Mail-Adresse und das zugehörige Faxdokument übergeben. Dieses Skript ist in der Konfigurationsdatei "config.faxCAPI" unter folgendem Parameter definiert:

PollRcvdCmd

Zurück zum Anfang

7 Weitere Informationsquellen

Informationen zur Anwendungsschnittstelle CAPI 2.0

Die Anwendungsschnittstelle CAPI 2.0 kann gebührenfrei unter der folgenden Adresse aus dem Internet geladen werden:

http://www.capi.org

Weitere Fragen zur CAPI 2.0-Spezifikation können am besten im Usenet unter der folgenden URL gestellt werden:

news:comp.dcom.isdn.capi

Newsgroup

Fragen zu ISDN und Linux werden unter folgender Adresse diskutiert:

news:de.comp.os.unix.linux.isdn

Faxen mit capircvd

Informationen zu einem bereits auf CAPI 2.0 basierenden Programm zum Empfang von Faxen (G3) und Voice-Anrufen finden Sie unter der Adresse:

http://capircvd.de

Weitere Informationen zur Verwendung von AVM-Produkten mit Linux finden Sie auf dem AVM-Linux-Portal unter:

http://www.avm.de/linux

Zurück zum Anfang

8 Supportleistungen

Aufgrund der Vielzahl an erstellbaren Kernel- und Distributionsvarianten ist der E-Mail-Support auf die im Abschnitt "Installationsvoraussetzungen" genannten Betriebssystemversionen beschränkt. Der Support ist hierbei auf die reine Installation bis zum erfolgreichen Ausführen der Testverbindung bzw. des Testfaxes der CAPI-Treiber und des CAPI4HylaFAX-Moduls in Verbindung mit AVM DSL/ISDN-Controllern bei Nutzung der bereitgestellten Installationsroutinen beschränkt. Bei Fragen zur Netzwerkkonfiguration, zu integrierten Funktionen des Betriebssystems Linux und zu Anwendungen von Drittherstellern wenden Sie sich bitte an den jeweiligen Hersteller bzw. den Support-Service Ihrer verwendeten Distribution. Bei Fragen zur Konfiguration und zum Betrieb von HylaFAX wenden Sie sich bitte an:
www.hylafax.org

Über das Internet bietet AVM ausführliche Informationen und kostenlose Updates. Alle Informationen zum Thema Linux bei AVM finden Sie unter:
www.avm.de/linux

  • Über den Button "zur AVM-Hompage" gelangen Sie zur AVM-Startseite. Hier finden Sie detaillierte Informationen zu allen AVM-Produkten sowie Ankündigungen neuer Produkte und Produktversionen.
  • Über die Rubrik "Fragen an die Hotline (FAQs)" gelangen Sie zu einer Sammlung von Antworten zu häufig gestellten Fragen. Darüber hinaus bietet der Bereich "Praxis, Tipps & Hintergründe" Hilfestellungen.
  • Im Bereich "Aktuelle Downloads" können Sie aktuelle Linux-Treiber für alle AVM DSL/ISDN-Controller herunterladen.

Auf dem AVM Data Call Center (ADC) befinden sich alle Programme und Treiber, die auch über die Internetseiten von AVM heruntergeladen werden können.
Bitte nutzen Sie zunächst die oben beschriebenen Informationsquellen, bevor Sie den Support kontaktieren!

Haben Sie mit den bisherigen Hinweisen und mit Hilfe der verschiedenen Informationsquellen das Problem nicht lösen können, wenden Sie sich für weitere technische Unterstützung an den AVM-Support. Sie können eine Support-Anfrage per E-Mail an die AVM versenden. Nutzen Sie dazu bitte unser E-Mail-Formular. Das Formular finden Sie im Internet unter der Adresse:
ww.avm.de/linux

Füllen Sie das Formular aus und schicken Sie es per Mausklick auf die Schaltfläche "Senden" zum AVM-Support.

Zurück zum Anfang

EOF

SAS, FS 08/2005

capi4hylafax-svn/README.html0000644000175000017500000007613210470310065015437 0ustar mastermaster CAPI4HylaFAX

Product: CAPI4Linux, module: CAPI4HylaFAX
Operating System: Linux
Version: 01.03.00
Build: 05.08.12

Welcome to CAPI4HylaFAX!

This document contains information and instructions on:

  • the CAPI 2.0 binding of HylaFAX to AVM ISDN-Controllers
  • working with HylaFAX
  • converting existing documents

Contents

1 General Information about Fax G3 over the CAPI 2.0 Interface with AVM ISDN-Controllers

1.1 HylaFAX and Connecting to ISDN Using CAPI 2.0

1.2 Important Information for the Installation of the HylaFAX Interface for CAPI 2.0

2 Installing the HylaFAX Interface for CAPI 2.0 in SUSE

2.1 Installation Requirements

2.2 Installation

2.3 Working in HylaFAX

2.4 Sending Faxes with HylaFAX

2.5 Receiving Faxes with HylaFAX

2.6 Additional Instructions

3 Installing the HylaFAX Interface for CAPI 2.0 in Other Distributions

4 Instructions about the File Format and on Converting Existing Files

5 Instructions for Operation with Multiple AVM ISDN-Controllers

6 Instructions for Fax Polling

7 Additional Information Sources

8 Support

1 General Information about Fax G3 over the CAPI 2.0 Interface with AVM ISDN-Controllers

Analog Fax G3 service over the digital ISDN network requires that the data transmitted be transformed from analog to digital or from digital to analog (A/D or D/A transformation), as well as signaling conform to the Fax G3 standard (such as ITU-T.30).

As part of the CAPI 2.0 standard, this protocol mechanism is subject to compulsory standardization (TB.30 modem for Group 3 fax). The implementation of this protocol by the manufacturer of the ISDN-Controller is optional. If Fax G3 is implemented in CAPI 2.0 drivers, software developed for the CAPI 2.0 interface can access the ISDN-Controller directly and thus quite easily. All AVM ISDN-Controllers for ISDN basic access currently supported by CAPI4Linux offer Fax G3 support over the CAPI 2.0 interface.

Note that when passive ISDN-Controllers like the AVM FRITZ!Card are used, all calculations for A/D or D/A transformation must be carried by the CPU of your computer system. This can result in a relatively high system load, especially when Fax G3 documents are received. Active controllers such as those from the AVM ISDN-Controller Family B1 all include their own chip, thus reducing the system's load.

Back to top

1.1 HylaFAX and Connecting to ISDN Using CAPI 2.0

The current version of HylaFAX unfortunately does not offer direct CAPI 2.0 binding; only a binding for analog modems. Until now only active ISDN-Controllers like the AVM ISDN-Controller B1 could be connected to HylaFAX by patch.

This "CAPI4Linux" package allows the use of practically any ISDN-Controller equipped with a fax-capable CAPI 2.0 driver compliant with the LINUX CAPI 2.0 specification. See also the CAPI 2.0 Specification at:
http://www.capi.org

Thus it is possible to fax with the popular passive ISDN-Controllers even in Linux. Thanks to CAPI 2.0, multiple ISDN services can be used at the same time, such as Fax G3 reception and a connection to the Internet via pppd. The ISDN B channels are assigned automatically by the CAPI 2.0 driver.

Up to four active AVM ISDN-Controllers with CAPI4Linux drivers can be installed on each system. Even mixed configurations are possible (for instance, one AVM ISDN-Controller B1 ISA plus two ISDN-Controllers C2). The CAPI4HylaFAX module then has to be modified for operation with multiple ISDN-Controllers. Please see the additional information in section 3.

In any system, only one passive ISDN-Controller (e.g. FRITZ!Card PCI) can be installed using a CAPI4Linux driver.

The latest version of HylaFAX and more information are available at
http://www.hylafax.org.

Back to top

1.2 Important Information for the Installation of the HylaFAX Interface for CAPI 2.0

From the current HylaFAX version on (included on the SUSE 8.1 CDs), HylaFAX always transfers seven parameters to HylaFAX faxrcvd. SUSE Linux versions 8.0 or below or original HylaFAX versions expect fewer parameters. The difference from the original HylaFAX lies in the restricted analog model of the former, which does not include the important interpretation of the ISDN feature MSN or DDI for e-mail forwarding.

The new CAPI4HylaFAX installation script automatically changes an existing faxrcvd script so that older faxrcvd scripts can continue working with the current CAPI4HylaFAX version.

In line 33, for example, the script looks like this:

# faxrcvd file devID commID error-msg CIDNumber CIDName destination
#
if [ $# -lt 7 ]; then
echo "Usage: $0 file devID commID error-msg CIDNumber CIDName destination"
fi

The following table specifies the faxrcvd parameters in brief:

Parameter Event Type
file indicates the received TIFF or SFF fax file
devid relates to the virtual modem device needed by CAPI to send a fax (faxCAPI, for example)
commid continuous identification number for incoming calls (faxes)
error-msg includes an entry indicating that problems occurred during fax reception
cidnumber fax number of the sender; if no number is transferred, the caller ID is shown here
cidname name of the sender's fax device.
destination extension number of the recipient (MSN or DDI)*.

*If you want to use the current CAPI4HylaFAX version in one of the SUSE versions between 7.2 and 8.0, and if you would like to forward faxes from a certain MSN or DDI, you have to adapt the the faxrcvd script manually, since the order of parameters varies depending on the HylaFAX and SUSE versions used.

Further information about faxrcvd can be found in the corresponding manual page, displayed by entering the command "man faxrcvd" at a console.

NOTE If you are using "GlobalCall", please note the following: "GlobalCall", especially popular in Austria, does not transmit your main number, thus deactivating the parameter "IncomingMSN" in the "config.faxCAPI" file. Therefore all voice and fax calls coming in at the main number are accepted. If you want to deactivate the automatic call acceptance, you have to set the parameter "AcceptGlobalCalls" to "0". In all other cases the pre-set value "1" is correct.

More information about HylaFAX and how to use of the "faxrcvd" script is available at
www.hylafax.org.

Back to top

2 Installing the HylaFAX Interface for CAPI 2.0 in SUSE

Please note that the following prerequisites have to be met before starting installation:

2.1 Installation Requirements

  • SUSE Linux 9.1/9.2/9.3
  • An installed HylaFAX packet including the program library TIFFLIB. The latest version can be obtained from: http://www.hylafax.org.
  • You have to perform a "root" installation, i.e. you have to log in on the system as "super user".
  • Read and write rights (rw) to "dev/capi20" have to be configured for the fax user(s). See the section "2.3 Working in HylaFAX".
  • At least one, and no more than four active AVM ISDN-Controller(s), or any passive AVM ISDN-Controller with a correctly installed CAPI 2.0 driver from the CAPI4Linux package must be installed. It is not possible to use the HylaFAX interface "CAPI4HylaFAX" with the ISDN4Linux package (it is not a CAPI 2.0 interface).
  • To use CAPI4HylaFAX in a 64-bit SUSE Linux 9.x, please make sure that the packets "zlib-devel", "libjpeg" and "libtiff" are installed. The file "/usr/lib64/libcapi20.la" contains an incorrect entry. Change the entry as follows to ensure a correct compilation of CAPI4HylaFAX:
    #Directory that this library needs to be installed in:
    libdir='/usr/lib64'
NOTE AVM supplies pre-compiled patches for SUSE which permit an especially simple installation for these distributions. If you use a different distribution, see the corresponding information in the section "Installing the HylaFAX Interface for CAPI 2.0 in Other Distributions".

Back to top

2.2 Installation

NOTE Please remove any old version of CAPI4HylaFAX before installing a new version!
  1. Copy the archive "CAPI4HylaFAX-versionNo.tar.gz" from the CAPI4Linux archive to your computer (for instance, from a diskette by entering the "mcopy" command on a console).
  2. Start a console (command prompt).
  3. Extract the archive with the command:
    tar -xzvf capi4hylafax-xx.yy.zz.tar.gz
    A directory called "capi4hylafax-xx.yy.zz" is created.
  4. Switch to this new directory "capi4hylafax-xx.yy.zz".
  5. Run "./install".
    Next the system automatically checks for an installed HylaFAX. If the HylaFAX package is not found, a corresponding message is returned. If the HylaFAX package is not found, you have to enter the "HylaFAX spool directory" manually as a parameter.
    NOTE If you would like to send or receive a fax without HylaFAX support, simply install stand-alone operation without automatic HylaFAX configuration by entering "./install -s".
    With "./install -h" you get an overview of parameters with extended installation options.

    By means of a graphic menu system, you can now perform the initial configuration of the most important parameters for the fax operation of a previously installed AVM ISDN-Controller. Further parameters for fax polling, for example, can be configured directly in the file "config.faxCAPI". These parameters are documented in the file itself. For configuration using the menu system, the following parameters are available:
    Parameter Effect
    OutgoingMSN Defines the outgoing MSN to be used at the ISDN basic rate interface. In this way you can indicate a specific MSN from the block of numbers for outgoing connections to perform MSN-specific accounting. For some PBXs with internal S0 bus you must indicate the MSN of the extension used.
    IncomingMSNs Defines the outgoing MSN to be used at the ISDN basic rate interface. If several ISDN devices with the same ISDN service indicator are used at the basic rate interface, each of these devices must be unambiguously addressed via a specific MSN. If this parameter is NOT defined, all incoming calls with the service indicator "Group 2/3 Fax" and "Telephony (analog)" will be accepted. If several MSNs are to be used, they must be separated by commas.
    DDIParams Defines parameters for operation at a PBX ISDN point-to-point line with direct dial-in (DDI). "DDIOffset": indicates the number of digits which precede the extension number.
    Example: 39976-0 => DDIOffset=39976 (base number)
    "DDILength": indicates the number of digits of the extension number.
    Example: 4711 => DDILength=4
    "IncomingDDIs": List of extension numbers that should be accepted.
    FaxNumber Defines the fax number which appears in the fax header at the recipient.
    ATTENTION: HylaFAX cannot process empty spaces. Use the entry "." instead. This entry is automatically converted into a blank.
    FaxIdentifier Defines the local name (station ID) shown in the fax header at the recipient.
    NumberPrefix Defines the digit required to get an outside line when operating at a PBX (generally "0").

    ATTENTION To change the settings of the CAPI4HylaFAX module after installation, or to configure more than one active AVM ISDN-Controller for fax operation with HylaFAX, you MUST perform the respective settings manually in the config.faxCAPI file. This file is used by HylaFAX as well as by the applications "c2faxsend" and "c2faxrecv": /etc/config.faxCAPI (in SUSE Linux)
    /var/spool/HylaFAX/etc/config.faxCAPI (HylaFAX 4.1.x)

  6. Then the configuration file "config.faxCAPI" is generated automatically. The applications "c2faxsend" and "c2faxrecv" search for the configuration file "config.faxCAPI" in the directory "/var/spool/fax/etc". If for some reason the file does not exist (any more), the default settings will be used automatically. In order to move this configuration file to another position in the system, the location must be entered using the command to open the application, "-C FILE". At this junction a quick test in stand-alone operation can be performed, since no other components are required by HylaFAX. Send or receive a fax from the command line using the two applications below:
    Sending c2faxsend -f TIFF -d [TelNo] [TIFF file]
    c2faxsend -f SFF -d [TelNo] [SFF file]
    Receiving c2faxrecv -f TIFF
    c2faxrecv -f SFF

    The parameter -h provides a complete survey of the implemented options in both applications.
    In stand-alone operation without HylaFAX "c2faxrecv" cannot be running when a fax is to be sent. "c2faxsend" can use only the "TIFF" (class F, FAX G3, 1 dim. Huffmann coding) and "SFF" file formats. In order to send a document, it should be converted with a corresponding program first (e.g. with Ghostscript). AVM supplies the demonstration file "fritz_pic.tif" in a suitable TIFF format. The command for sending the AVM test fax to any Fax G3 remote site, specified with [TelNo], is thus
    c2faxsend -vf TIFF -d [TelNo] fritz_pic.tif
    The section "Instructions about the File Format and on Converting Existing Files" presents more information about the TIFF format used.

Back to top

2.3 Working in HylaFAX

To work with HylaFAX, a number of preparatory steps are performed automatically by the installation script during installation (see the section "Installation", step 5).

If HylaFAX is to be used, note the following:

  • The "./install" script executed during installation copies the fax files to "/usr/local/bin".
  • The system searches for HylaFAX automatically. The HylaFAX "config file" and the "/etc/inittab" file are modified as necessary so that faxes can be sent and received over CAPI 2.0.
  • Faxes can only be sent and received with HylaFAX when "c2faxrecv" is active. Therefore this program was registered automatically in the "/etc/inittab" file.
  • Read and write rights (rw) to "/dev/capi20" must be configured for the fax user(s) in "dev/capi20" and "/var/spool/hylafax" or "/var/spool/fax", which is generally not the case. When "root" runs "c2faxrecv", "c2faxrecv" changes the user "root" to "fax" which is member of the group "dialout". To grant "user access" to CAPI 2.0, the rights in "/dev/capi20" and "/var/spool/hylafax" or "/var/spool/fax" must be changed to "0666".
  • To avoid rebooting, simply activate "c2faxrecv &" after installation. In some cases it is necessary to end the HylaFAX program "faxq" and to restart it in order to implement the changes to the settings in its configuration file.

Back to top

2.4 Sending Faxes with HylaFAX

To send, just enter "sendfax -d [TelNo] file". The file can have almost any format. The programs "file" or "a2ps" must be able to read the format so that the file can be converted correctly first into PS format and then into TIFF format. Graphic frontends are also available to make working with HylaFAX somewhat easier. For more information, see the documentation at:

http://www.hylafax.org

If faxes are to be sent directly from an application, the printer configuration must be adapted in the application. Usually a command for printing can be entered in the application, usually just "lpr". Replace this with "sendfax -d [TelNo]". These functions are program-dependent and should be documented in the application Help file.

Back to top

2.5 Receiving Faxes with HylaFAX

Once a fax is received via HylaFAX, "root" receives a mail sent by the script "faxrcvd" reporting that a fax has been received.
When using the fax module "c2faxrecv" in stand-alone operation, you can achieve analog fax reception by using the supplied script "sample_faxrcvd".
Once a fax has been received, the script specified in the configuration file ("faxrcvd" in HylaFAX) can be run with the following parameters:

Stand-alone operation [Result Code] [CAPI Disconnect Reason] [Sender ID] [Called Number or DDI] [No of Pages] [File(s)]
HylaFAX mode [faxrcvd file] [devID] [commID] [error-msg] [CIDNumber] [CIDName] [destination]

More details about fax reception with HylaFAX are provided in the HylaFAX documentation.

Back to top

2.6 Additional Instructions

  • The "config file" must be located in the "etc" directory of HylaFAX.
  • Even if faxes are only to be sent, "c2faxrecv" must be active!
  • For fax reception, simply run "c2faxrecv &", for instance in a start scrpt, if it has not already been run in "etc/inittab".
  • "Device" Name: Because the applications are CAPI 2.0 applications based directly on CAPI, this entry is not actually necessary. However, the name of the device can be entered in the commando line, or is entered automatically by HylaFAX. This name is used only for signaling to HylaFAX and to determine the name of the configuration file: "config.[Device Name]". Thus it is also possible to manage multiple "c2faxrecv" demons along with their configuration files. Another option is the "-C" switch.
  • If problems occur after installation during fax transmission, HylaFAX probably did not yet process the modifications in the configuration file correctly. In this case, entering "faxsetup" or "faxmodem faxCAPI" manually with "root" or superuser rights can be used to implement the changes in HylaFAX.
  • For comprehensive logging, delete in canfig.faxCAPI the "#" preceding the "LogTraceLevel:4" entry. The log file is saved by default to "/tmp/capifax.log".

Back to top

3 Installing the HylaFAX Interface for CAPI 2.0 in Other Distributions

Even if you use any distributions or kernel versions other then SUSE, it is usually no problem to use CAPI4HylaFAX. Only if the installation routine of CAPI4HylaFAX reports missing (program) libraries is it necessary to compile the sources supplied in the directory "/src". To simplify this process, AVM supplies complete "makefiles". For more details about compiling sources, see the file "README.src".

Back to top

Instructions about the File Format and on Converting Existing Files

TIFF (Tagged Image File Format) files must correspond to the specification "Class F for facsimile (TIFF Class F)", based on the TIFF 6.0 specification. In addition, the file must contain one-dimensional Huffmann coding. This format was specified in "Group 3" by the CCITT (International Telegraph and Telephone Consultative Committee). For more information about TIFF format, see the "Developer" division of Adobe Systems Incorporated at: http://www.adobe.com

Converting Existing Files with Ghostscript

To convert a postscript file into a TIFF file conform to the fax application, the following command can be used to activate Ghostscript:

gs -dBATCH -dNOPAUSE -sDEVICE=tiffg3 -sOutputFile=[Name of tiff file] [Name of postscript file]

More information about the SSF format is documented in the CAPI 2.0 specification at http://www.capi.org.

Back to top

5 Instructions for Operation with Multiple AVM ISDN-Controllers

Up to four active AVM ISDN-Controllers can be addressed via the CAPI 2.0 interface. It is also possible to install controllers for different bus systems such as PCI, ISA and PCMCIA. For details about the controller installation, please refer to the documentation of the driver module Linux CAPI 2.0.

The module CAPI4HylaFAX simultaneously supports the operation of multiple active AVM ISDN-Controllers sending and receiving in HylaFAX. After installing the module CAPI4HylaFAX, some modifications are necessary in the configuration file "/etc/config.faxCAPI". This is necessary because the graphic installation routine described above is designed for one controller only. Other parameters for the operation of several AVM ISDN-Controllers in the configuration file "config.faxCAPI" are documented in the file itself. After modifying the configuration file the module "c2faxrecv" must be stopped and restarted in order to activate the modification.

A pre-configured sample script is enclosed for the operation with the AVM ISDN-Controller C4 or the AVM ISDN-Controller C2. The script is called "sample_AVMC4_config.faxCAPI". This script simplifies the configuration of multiple-channel controllers for CAPI4HylaFAX: just modify the script according to your individual technical surroundings (MSNs etc.).

Back to top

6 Instructions for Fax Polling

Fax polling is now supported with this version of HylaFAX. Operation in client mode is possible, i.e., CAPI4HylaFAX can be used to poll fax documents. It is not yet possible to provide callers with fax documents to poll (Server Mode).

Execute the following file to start fax polling in stand-alone mode:

c2faxsend -vf TIFF -d [TELNo] -P [e-mail address]

Execute the following file to start fax polling in HylaFAX mode:

sendfax -d [TELNo] -p

In either case, a script is started after the fax is received and the e-mail address and the corresponding fax document is provided. The script is defined in the configuration file "config.faxCAPI" under the following parameter:

PollRcvdCmd

Back to top

7 Additional Information Sources

Information about the Applications Interface CAPI 2.0

The applications interface CAPI 2.0 can be downloaded free of charge from the following Internet site:

http://www.capi.org

Additional questions about the CAPI 2.0 Specification should be asked in the Usenet at the following URL:

news:comp.dcom.isdn.capi

Newsgroup

Discussions of ISDN and Linux issues can be found at:

news:de.comp.os.unix.linux.isdn

Faxing with capicvd

Information about an already existing CAPI 2.0-based program for receiving faxes (G3) and voice calls is provided at the URL:

http://capircvd.berlios.de/index_eng.php3

For more information on using AVM products with Linux, see the AVM web site at:

www.avm.de/en

Back to top

8 Support

Because there are so many different kernels and distributions, e-mail support is limited to the operating systems and kernel versions described in the section "Installation Requirements". This support is limited to the actual installation up to the successful completion of the test connection or the test fax over CAPI drivers and the CAPI4HylaFAX module in combination with AVM DSL/ISDN-Controllers using the provided installation programs. For questions about network configuration, integrated functions of the operating system Linux and applications from other manufacturers, please contact the relevant manufacturer or the support service of the distribution used. Please address your questions concerning configuration and operation of HylaFAX to:
www.hylafax.org

The AVM web site offers detailed information and updates free of charge. Visit the site at:
www.avm.de/en

  • The "Products" category provides detailed information about all AVM products as well as announcements of new products and product versions.

All programs and drivers available on AVM's Internet site can also be downloaded from the AVM Data Call Center (ADC).
Please try all of the information sources described above before contacting AVM support.

If these instructions and the various information sources have not helped to resolve your problem, contact AVM Support for additional technical assistance. You may send your support requests to AVM by e-mail. Support inquiries can be sent to AVM using the e-mail form provided at the Internet address:
www.avm.de/en

Fill out the form and mail it to AVM Support by clicking the "Send" button.

Back to top

EOF

SAS; SR; 08/2005

capi4hylafax-svn/Readme_src0000644000175000017500000000172410470310065015576 0ustar mastermaster To get the latest sources from the official subversion server please enter: svn co svn://capi4hylafax.in-berlin.de/capi4hylafax/trunk/capi4hylafax More information about subversion and the usage of the svn program can be found under subversion.tigris.org. To compile and install the sources, enter the following commands: ./configure make ./install If the Hylafax spool directory is located in another place than /var/spool/hylafax, you must specify the path as follows in order to compile and install the sources: ./configure --with-hylafax-spooldir=DIR make ./install -h DIR More information about installation and configuration is located in the files README.html (English) or LIESMICH.html (German). For a debian distribution in src/defaults.h[.in] some of the defines must change to: #define WRITE_FIFO_FILE "dev/FIFO" #define READ_FIFO_PREFIX "dev/FIFO." #define DEFAULT_FAX_USER "root" capi4hylafax-svn/setupconffile0000644000175000017500000001765310470310065016410 0ustar mastermaster#!/bin/sh # # default values # BT="Configuration of the CAPI 4 Hylafax config file" OutMSN="" InMSNs="" UseDDI=0 DDILen=0 DDIOffset="" InDDIs="" FaxNumber="+49.00.00000" Identifier="AVM CAPI4HylaFAX" NumberPrefix="" DDISamples=" DDI Params\n" DDISamples="$DDISamples\nSample for DDI Offset : 11223344" DDISamples="$DDISamples\nSample for DDI Length : 3" DDISamples="$DDISamples\nSample for Incoming DDIs: 10, 100-300" ConfigFileName="/etc/config.faxCAPI" if [ ! -e $ConfigFileName ] ; then echo "setupconffile: Can't find CAPI4HylaFax config file ($ConfigFileName) !" return 1 fi # # functions # function test_for_number { numlen=`expr "$1" : "[0-9]\+"` strlen=`expr length "$1"` if [ 0$numlen -ne 0$strlen ]; then return 1 fi return 0 } function WriteToConfigFile { sed " /^ *FAXNumber *:/c\\ FAXNumber: $FaxNumber /^ *LocalIdentifier *:/c\\ LocalIdentifier: \"$Identifier\" /^ *OutgoingMSN *:/c\\ OutgoingMSN: $OutMSN /^ *NumberPrefix *:/c\\ NumberPrefix: $NumberPrefix /^ *UseDDI *:/c\\ UseDDI: $UseDDI /^ *DDIOffset *:/c\\ DDIOffset: $DDIOffset /^ *DDILength *:/c\\ DDILength: $DDILen /^ *IncomingDDIs *:/c\\ IncomingDDIs: $InDDIs /^ *IncomingMSNs *:/c\\ IncomingMSNs: $InMSNs" "$ConfigFileName" > "$ConfigFileName.c2fax" mv -f "$ConfigFileName.c2fax" "$ConfigFileName" } function rem_res { rm -f res } function main_config_dialog { # # test for dialog # if [ -z "`which dialog`" ] ; then echo "Can't find dialog. Please install dialog or setup the config file with an editor." rem_res return 1 fi # # ask for config file if necessary # if [ -z $1 ] ; then dialog --backtitle "$BT" --clear \ --inputbox "Specify the location of the config file" 9 70 "$ConfigFileName" 2> res if [ $? -eq 0 ] ; then ConfigFileName="`cat res`" else rem_res return 1 fi else ConfigFileName="$1" fi # # test for file # if [ ! -e "$ConfigFileName" ] ; then echo "Can't find config file $ConfigFileName" rem_res return 1 fi # # show info dialog # dialog --backtitle "$BT" --clear --yesno \ "This program can only configure the parameters for controller 1. If you will use more than controller 1 feel free to adjust the config file \"config.faxCAPI\" with an editor to your own demands.\n\n Configure parameters for controller 1 now?" 10 72 if [ $? -ne 0 ] ; then rem_res return 1 fi # # dialog loop # terminate=0 while [ $terminate -eq 0 ] ; do dialogInMSN="-- empty ----" dialogDDI="-- no ddi ---" dialogOutMSN=$OutMSN dialogFaxNum=$FaxNumber dialogId=$Identifier dialogNumPre=$NumberPrefix if [ -n "$InMSNs" ] ; then dialogInMSN="-- is set ---" fi if [ $UseDDI -ne 0 ] ; then dialogDDI="-- use ddi --" dialogInMSN="-- disabled -" fi if [ -z "$dialogOutMSN" ] ; then dialogOutMSN="[unspecified]" fi if [ -z "$dialogFaxNum" ] ; then dialogFaxNum="[unspecified]" fi if [ -z "$dialogId" ] ; then dialogId="[unspecified]" fi if [ -z "$dialogNumPre" ] ; then dialogNumPre="[ empty ]" fi dialog --backtitle "$BT" --clear \ --menu "Main menu" 15 50 7 \ "Outgoing MSN " "$dialogOutMSN" \ "Incoming MSNs " "$dialogInMSN" \ "DDI Params " "$dialogDDI" \ "Fax Number " "$dialogFaxNum" \ "Fax Identifier" "$dialogId" \ "Number Prefix " "$dialogNumPre" \ "Save & Exit " "" 2> res if [ $? -eq 0 ] ; then case "`cat res`" in "Outgoing MSN ") dialog --backtitle "$BT" --clear \ --inputbox "Outgoing MSN" 9 50 "$OutMSN" 2> res if [ $? -eq 0 ] ; then OutMSN="`cat res`" fi ;; "Incoming MSNs ") dialog --backtitle "$BT" --clear \ --inputbox "List of Incomming MSNs (comma seperated)" 9 70 "$InMSNs" 2> res if [ $? -eq 0 ] ; then InMSNs="`cat res`" fi ;; "DDI Params ") tmpDDIOffset=$DDIOffset tmpDDILen=$DDILen tmpInDDIs=$InDDIs while [ $terminate -eq 0 ] ; do dialogInDDIs="-- empty ----" if [ -n "$tmpInDDIs" ] ; then dialogInDDIs="-- is set ---" fi dialog --backtitle "$BT" --clear \ --menu "$DDISamples" 15 43 4 \ "DDI Offset" "$tmpDDIOffset" \ "DDI Length" "$tmpDDILen" \ "Incoming DDIs" "$dialogInDDIs" \ "Accept" "" 2> res if [ $? -eq 0 ] ; then case "`cat res`" in "DDI Offset") dialog --backtitle "$BT" --clear \ --inputbox "DDI Offset" 9 30 "$tmpDDIOffset" 2> res if [ $? -eq 0 ] ; then isval="`cat res`" test_for_number "$isval" if [ $? -eq 0 ] ; then tmpDDIOffset="$isval" fi fi ;; "DDI Length") dialog --backtitle "$BT" --clear \ --inputbox "DDI Length" 9 30 "$tmpDDILen" 2> res if [ $? -eq 0 ] ; then isval="`cat res`" if [ -n "$isval" ] ; then test_for_number "$isval" if [ $? -eq 0 -a 0$isval -lt 100 ] ; then tmpDDILen=$isval fi fi fi ;; "Incoming DDIs") dialog --backtitle "$BT" --clear \ --inputbox "Incoming DDIs" 9 70 "$tmpInDDIs" 2> res if [ $? -eq 0 ] ; then tmpInDDIs="`cat res`" fi ;; "Accept") DDIOffset=$tmpDDIOffset DDILen=$tmpDDILen InDDIs=$tmpInDDIs if [ -n "$DDIOffset" ] && [ -n "$InDDIs" -o 0$DDILen -gt 0 ] ; then UseDDI=1 else UseDDI=0 fi terminate=1 ;; esac else terminate=1 fi done terminate=0 ;; "Fax Number ") dialog --backtitle "$BT" --clear \ --inputbox "Fax Number (use dots instead of spaces)" 9 50 "$FaxNumber" 2> res if [ $? -eq 0 ] ; then FaxNumber="`cat res`" fi ;; "Fax Identifier") dialog --backtitle "$BT" --clear \ --inputbox "Fax Identifier" 9 50 "$Identifier" 2> res if [ $? -eq 0 ] ; then Identifier="`cat res`" fi ;; "Number Prefix ") dialog --backtitle "$BT" --clear \ --inputbox "Number Prefix" 9 50 "$NumberPrefix" 2> res if [ $? -eq 0 ] ; then NumberPrefix="`cat res`" fi ;; "Save & Exit ") WriteToConfigFile terminate=1 ;; esac else terminate=1 fi done rem_res return 0 } capi4hylafax-svn/install0000755000175000017500000002115310470310065015201 0ustar mastermaster#!/bin/sh # # installations script # # global variables SuSEbinpath=/usr/bin localbinpath=/usr/local/bin SourceDirectory= DestDirectory=/usr/local/bin HylafaxSpoolDir=/var/spool/hylafax StandAloneInst=0 Update=0 Uninstall=0 CopyFiles=1 ImpConf=1 ChangeDevCapi=0 ConfigFileName=config.faxCAPI #functions function SearchForLib { if [ -e /lib/$1 ] || [ -e /usr/lib/$1 ] || [ -e /usr/local/lib/$1 ] ; then return 0 fi echo "Can't find library $1!" return 1 } function TestAndCopyFile { sourcefile=$2 if [ -n "$5" ] && [ -e $5/$sourcefile ] ; then sourcefile=$5/$sourcefile elif [ -e $sourcefile ] ; then : elif [ -e src/$3/$sourcefile ] ; then sourcefile=src/$3/$sourcefile elif [ -e bin/$sourcefile ] ; then sourcefile=bin/$sourcefile elif [ -e $localbinpath/$sourcefile ] ; then sourcefile=$localbinpath/$sourcefile elif [ -e $SuSEbinpath/$sourcefile ] ; then sourcefile=$SuSEbinpath/$sourcefile else echo "Can't find $2." if [ $1 -ep 1 ] ; then exit 1 fi fi if [ ! -d $4 ] ; then mkdir -p $4 if [ $? -gt 0 ] ; then if [ $1 -eq 1 ] ; then exit 1 else return $? fi fi fi echo "Copying $sourcefile to $4/$2." cp -f $sourcefile $4/$2 if [ $? -gt 0 ] && [ $1 -eq 1 ] ; then exit 1 fi } function SetConfigLine { if [ -z "$3" ] ; then grep -v "$2.*:.*/c2fax" $1 > $1.new else gawk 'BEGIN {repl = 0} END {if (repl == 0) {print SEARCHIT":"REPLACEIT}} {if ($1 != SEARCHIT) {print $0} else {repl = 1; print $1":"REPLACEIT}} ' FS=':' IGNORECASE=1 SEARCHIT="$2" REPLACEIT="$3" $1 > $1.new fi if [ "$4" != "no" ] ; then mv $1 $1.c2fax fi mv $1.new $1 } # test command line while [ $# -gt 0 ] ; do case $1 in -s) StandAloneInst=1 ImpConf=0 ;; -p) if [ -n "$2" ] ; then HylafaxSpoolDir=$2 shift fi ;; -b) if [ -n "$2" ] ; then SourceDirectory=$2 shift fi ;; -d) if [ -n "$2" ] ; then DestDirectory=$2 shift fi ;; -c) if [ -e /dev/capi20 ] ; then chmod 0666 /dev/capi20 if [ $? -eq 0 ] ; then ChangeDevCapi=1 fi else echo "Can't find /dev/capi20." exit 1 fi ;; -U) Update=1 ;; -u) Uninstall=1 ;; -n) CopyFiles=0 ;; *) echo "usage: `basename $0` [-n] [-s] [-c] [-u] [-p PATH] [-b PATH] [-d PATH]" echo -e "\t-n\tNot copying files only changing configs and inittab" echo -e "\t-s\tInstall stand alone, without checking for Hylafax" echo -e "\t-c\tChange mode of /dev/capi20 to 0666 during installation" echo -e "\t-U\tUpdate. Copy Files but don't change the config files" echo -e "\t-u\tUninstall. Remove files and changed lines from the config files" echo -e "\t-p\tSpecify path to Hylafax spool directory (default: /var/spool/fax)" echo -e "\t-b\tSpecify source path for the fax binaries" echo -e "\t-d\tSpecify destination path for the fax binaries" exit 1 ;; esac shift done # Uninstallation if [ $Uninstall -gt 0 ] ; then if [ $CopyFiles -gt 0 ] ; then rm $DestDirectory/c2faxsend rm $DestDirectory/c2faxrecv fi rm $HylafaxSpoolDir/etc/$ConfigFileName if [ $StandAloneInst -eq 0 ] && [ -e $HylafaxSpoolDir/etc/config ] ; then SetConfigLine $HylafaxSpoolDir/etc/config SendFaxCmd SetConfigLine /etc/inittab fr fi exit 0 fi # search for c2faxsend c2faxsendfile=c2faxsend if [ -n "$SourceDirectory" ] && [ -e $SourceDirectory/$c2faxsendfile ] ; then c2faxsendfile=$SourceDirectory/$c2faxsendfile elif [ -e $c2faxsendfile ] ; then : elif [ -e src/faxsend/$c2faxsendfile ] ; then c2faxsendfile=src/faxsend/$c2faxsendfile elif [ -e bin/$c2faxsendfile ] ; then c2faxsendfile=bin/$c2faxsendfile elif [ -e $localbinpath/$c2faxsendfile ] ; then c2faxsendfile=$localbinpath/$c2faxsendfile elif [ -e $SuSEbinpath/$c2faxsendfile ] ; then c2faxsendfile=$SuSEbinpath/$c2faxsendfile else echo "Can't find $c2faxsendfile." exit 1 fi # test the existing of the needed librarys foundError=0 libsnotfound=`ldd $c2faxsendfile | grep "not found" | cut -f2 | cut -d " " -f1` if [ -n "$libsnotfound" ] ; then for name in $libsnotfound do echo "Can't find library $name!" done foundError=1 fi # search for hylafax config file if [ $StandAloneInst -eq 0 ] && [ ! -e $HylafaxSpoolDir/etc/config ] ; then if [ -e /var/spool/hylafax/etc/config ] ; then HylafaxSpoolDir=/var/spool/hylafax elif [ -e /var/spool/fax/etc/config ] ; then HylafaxSpoolDir=/var/spool/fax else echo "" echo "Can't find Hylafax's config file: $HylafaxSpoolDir/etc/config." echo "Please adjust the Hylafax spool directory with -p [dir]" echo "or install CAPI4Hylafax stand alone with -s." foundError=1 fi fi if [ $foundError -gt 0 ] ; then exit 2 fi # copy files if [ $CopyFiles -gt 0 ] ; then TestAndCopyFile 1 c2faxrecv faxrecv "$DestDirectory" "$SourceDirectory" TestAndCopyFile 1 c2faxsend faxsend "$DestDirectory" "$SourceDirectory" if [ $Update -eq 0 ] ; then if [ -e "/etc/$ConfigFileName" ] ; then echo "Backup /etc/$ConfigFileName to /etc/$ConfigFileName.c2fax" cp "/etc/$ConfigFileName" "/etc/$ConfigFileName.c2fax" fi TestAndCopyFile $ImpConf $ConfigFileName scripts "/etc" "$SourceDirectory" if [ $? -gt 0 ] ; then echo "Can't copy config file to /etc. This file isn't mandatory if you are working stand alone." else ConfigFileName="/etc/$ConfigFileName" SetConfigLine "$ConfigFileName" SpoolDir "\t\t$HylafaxSpoolDir" no SetConfigLine "$ConfigFileName" FaxRcvdCmd "\t\t$HylafaxSpoolDir/bin/faxrcvd" no fi else TestAndCopyFile $ImpConf "${ConfigFileName}.update" scripts "/etc" "$SourceDirectory" fi else ConfigFileName="/etc/$ConfigFileName" if [ -e "$ConfigFileName" ] ; then SetConfigLine "$ConfigFileName" SpoolDir "\t\t$HylafaxSpoolDir" no SetConfigLine "$ConfigFileName" FaxRcvdCmd "\t\t$HylafaxSpoolDir/bin/faxrcvd" no else echo "Can't find config file \"$ConfigFileName\"! => Nothing to do." exit 1 fi fi # adjust hylafax config file and inittab if [ $StandAloneInst -eq 0 -a $Update -eq 0 ] ; then echo "Change $HylafaxSpoolDir/etc/config and /etc/inittab." SetConfigLine $HylafaxSpoolDir/etc/config SendFaxCmd "\t\t$DestDirectory/c2faxsend" SetConfigLine /etc/inittab fr "2345:once:$DestDirectory/c2faxrecv -q \"$HylafaxSpoolDir\"" # patch faxrcvd if [ -e "$HylafaxSpoolDir/bin/faxrcvd" ] ; then cp "$HylafaxSpoolDir/bin/faxrcvd" "$HylafaxSpoolDir/bin/faxrcvd.c2fax" sed "/\[ *\$# *!= *[1-9] *\]/s/!=/-lt/" "$HylafaxSpoolDir/bin/faxrcvd.c2fax" > "$HylafaxSpoolDir/bin/faxrcvd" echo -e "\nfaxrcvd patched for the use of newer C4H or HylaFAX versions." echo "!- NOTE -!: Please take a look in your faxrcvd script if it handles" echo " the MSN (destination) as Parameter \"\$7\" correctly!" fi # change names of old Hylafax C4H config files for i in ${HylafaxSpoolDir}/etc/config.faxCAPI* ; do mv "$i" "$HylafaxSpoolDir/etc/old_`basename \"$i\"`" done fi # start dialog script to configure config.faxCAPI . ./setupconffile "$HylafaxSpoolDir" main_config_dialog "$ConfigFileName" # that was it echo -e "\nInstall was successfully!\n\n" echo -e "!! Attention !! - The path of the config file has changed to /etc/config.faxCAPI !!\n\n" if [ -n "`file \`which file\` | grep 64-bit`" -a -f "${DestDirectory}/c2faxrecv" -a \ -n "`file \"${DestDirectory}/c2faxrecv\" | grep 32-bit`" ] ; then echo "The installed CAPI4Hylafax binaries are 32bit." echo -e "For 64bit binaries you have to compile the C4H sources.\n" fi if [ $StandAloneInst -eq 0 ] ; then echo "The Fax Receive Daemon c2faxrecv was added to /etc/inittab and will be started" echo -e "automatically. You could start it manually now to provide a restart.\n" fi if [ $ChangeDevCapi -eq 0 ] ; then echo "Don't forget to change mode of /dev/capi20 so that the binaries which are" echo -e "normally running from user \"fax\" have access rights to it.\n" fi echo "" exit 0 capi4hylafax-svn/GenerateFileMail.pl0000755000175000017500000000221210470310065017275 0ustar mastermaster#! /usr/bin/perl -w # # This Script is called by sample_faxrcvd to generate # a mail with an attached file. # # It's based on the hylafax-sample from # Noel Burton-Krahn # (see www.hylafax.org / howto) # use strict; my($fromaddr, $toaddr, $subject, $text, $textdesc, $file, $filemime, $virtfilename, $filedesc) = @ARGV; my($boundary); $boundary=join('---', "=Boundary=", $$, sprintf('%x', rand(0xffffffff))); print <); close(IN) || die("mimencode: $?"); print < Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. capi4hylafax-svn/Makefile.am0000644000175000017500000000146710470310065015647 0ustar mastermaster## Process this file with automake to produce Makefile.in AUTOMAKE_OPTIONS = foreign CLEANFILES = *~ comperr config.cache config.log MAINTAINERCLEANFILES = configure aclocal.m4 Makefile.in EXTRA_DIST = ChangeLog \ GenerateFileMail.pl \ LIESMICH.html \ README.html \ Readme_src \ install \ config.faxCAPI \ fritz_pic.tif \ sample_AVMC4_config.faxCAPI \ sample_faxrcvd \ setupconffile \ bin/c2faxsend \ bin/c2faxrecv SUBDIRS = src capi4hylafax-svn/sample_AVMC4_config.faxCAPI0000755000175000017500000001271410470310065020450 0ustar mastermaster# # sample of a config file for a AVM C4 or C2 ISDN controller # SpoolDir: /var/spool/fax FaxRcvdCmd: /var/spool/fax/bin/faxrcvd FaxReceiveUser: uucp LogFile: LogTraceLevel: 0 LogFileMode: 0600 { # Controller 1, B-Channel 1 HylafaxDeviceName: faxCAPI11 RecvFileMode: 0600 FAXNumber: +49.00.00000 LocalIdentifier: "AVM CAPI4HylaFAX" MaxConcurrentRecvs: 1 OutgoingController: 1 OutgoingMSN: SuppressMSN: 0 NumberPrefix: UseISDNFaxService: 0 RingingDuration: 0 { Controller: 1 AcceptSpeech: 0 UseDDI: 0 DDIOffset: "39976" DDILength: 3 IncomingMSNs: AcceptGlobalCall: 1 } } { # Controller 1, B-Channel 2 HylafaxDeviceName: faxCAPI12 RecvFileMode: 0600 FAXNumber: +49.00.00000 LocalIdentifier: "AVM CAPI4HylaFAX" MaxConcurrentRecvs: 1 OutgoingController: 1 OutgoingMSN: SuppressMSN: 0 NumberPrefix: UseISDNFaxService: 0 RingingDuration: 0 { Controller: 1 AcceptSpeech: 0 UseDDI: 0 DDIOffset: "39976" DDILength: 3 IncomingMSNs: AcceptGlobalCall: 1 } } { # Controller 2, B-Channel 1 HylafaxDeviceName: faxCAPI21 RecvFileMode: 0600 FAXNumber: +49.00.00000 LocalIdentifier: "AVM CAPI4HylaFAX" MaxConcurrentRecvs: 1 OutgoingController: 2 OutgoingMSN: SuppressMSN: 0 NumberPrefix: UseISDNFaxService: 0 RingingDuration: 0 { Controller: 2 AcceptSpeech: 0 UseDDI: 0 DDIOffset: "39976" DDILength: 3 IncomingMSNs: AcceptGlobalCall: 1 } } { # Controller 2, B-Channel 2 HylafaxDeviceName: faxCAPI22 RecvFileMode: 0600 FAXNumber: +49.00.00000 LocalIdentifier: "AVM CAPI4HylaFAX" MaxConcurrentRecvs: 1 OutgoingController: 2 OutgoingMSN: SuppressMSN: 0 NumberPrefix: UseISDNFaxService: 0 RingingDuration: 0 { Controller: 2 AcceptSpeech: 0 UseDDI: 0 DDIOffset: "39976" DDILength: 3 IncomingMSNs: AcceptGlobalCall: 1 } } # # C2 User should delete the following part # { # Controller 3, B-Channel 1 HylafaxDeviceName: faxCAPI31 RecvFileMode: 0600 FAXNumber: +49.00.00000 LocalIdentifier: "AVM CAPI4HylaFAX" MaxConcurrentRecvs: 1 OutgoingController: 3 OutgoingMSN: SuppressMSN: 0 NumberPrefix: UseISDNFaxService: 0 RingingDuration: 0 { Controller: 3 AcceptSpeech: 0 UseDDI: 0 DDIOffset: "39976" DDILength: 3 IncomingMSNs: AcceptGlobalCall: 1 } } { # Controller 3, B-Channel 2 HylafaxDeviceName: faxCAPI32 RecvFileMode: 0600 FAXNumber: +49.00.00000 LocalIdentifier: "AVM CAPI4HylaFAX" MaxConcurrentRecvs: 1 OutgoingController: 3 OutgoingMSN: SuppressMSN: 0 NumberPrefix: UseISDNFaxService: 0 RingingDuration: 0 { Controller: 3 AcceptSpeech: 0 UseDDI: 0 DDIOffset: "39976" DDILength: 3 IncomingMSNs: AcceptGlobalCall: 1 } } { # Controller 4, B-Channel 1 HylafaxDeviceName: faxCAPI41 RecvFileMode: 0600 FAXNumber: +49.00.00000 LocalIdentifier: "AVM CAPI4HylaFAX" MaxConcurrentRecvs: 1 OutgoingController: 4 OutgoingMSN: SuppressMSN: 0 NumberPrefix: UseISDNFaxService: 0 RingingDuration: 0 { Controller: 4 AcceptSpeech: 0 UseDDI: 0 DDIOffset: "39976" DDILength: 3 IncomingMSNs: AcceptGlobalCall: 1 } } { # Controller 4, B-Channel 2 HylafaxDeviceName: faxCAPI42 RecvFileMode: 0600 FAXNumber: +49.00.00000 LocalIdentifier: "AVM CAPI4HylaFAX" MaxConcurrentRecvs: 1 OutgoingController: 4 OutgoingMSN: SuppressMSN: 0 NumberPrefix: UseISDNFaxService: 0 RingingDuration: 0 { Controller: 4 AcceptSpeech: 0 UseDDI: 0 DDIOffset: "39976" DDILength: 3 IncomingMSNs: AcceptGlobalCall: 1 } } capi4hylafax-svn/fritz_pic.tif0000644000175000017500000005772410470310065016317 0ustar mastermasterII*"^²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€&T0­3Cæ ê0·£µå±a€&T0­3Cæ ê0·£µå±a€lj˜Ù4 º›ÓfÀ°´+0Ë„ƒå>Èζ€lj˜Ù4 º›ÓfÀ°´+0Ë„ƒå>Èζ€ltPÞà‚o,B^`g^`ß4 ®²„­€lt Þ´”ÁØXP,à%sà%ó @HÎV€lt Þ´”ÁØXP,à%sà%ó @HÎV€ltàagž©Á¾@gŸx¢>5ðx«Áœ6ª°a«€ltàYx àS¥>2ðÐ>d`@­€ltàYx àS¥>2ðÐ>d`@­€ltàQ%àaåf|jàÁQO <軞°`†¦Ø*€ltàQ%àaåf|jàÁQO <軞°`†¦Ø*€ltàá´À¡€¥MËøÔÀƒŽ |jàa³ àQÌRÂ,Û€ltàA(:V6–ð©‡9ð©ûæÀC` –l €ltàA(:V6–ð©‡9ð©ûæÀC` –l €ltàa ÓrX£bjXÀ§6@À§ûÃ26X³-€ltàa ÓrX£bjXÀ§6@À§ûÃ26X³-€ltàÁÀ,å°B©`EŸx°3€O 2ð°aŸx˜Ý<èrX'Àltà¬ä°BRŠ>2ð°aŸx˜Ý<èrX'ÀltàaAVä°‚ E‡%øÈÀƒ‚ |jàÁj³‚Õƒ­l!°ÎF€ltàaÖkXA…¢Â |dàAA>5ð°Ä VÖWPA€-€ltàaÖkXA…¢Â |dàAA>5ð°Ä VÖWPA€-€ltàae’ –‘a ÃÒ |dXqPRŸxXb+VVP‘ƒ ›€ltàae’ –‘a ÃÒ |dXqPRŸxXb+VVP‘ƒ ›€ltX>PC€Jj¬`K+¬á;l€ÀZ€ŠÖðq°3€‡e&°ZaiµTÙ€ltXæ°%‡m0¨.°‚,W°$Ö+بaIV̤Àj…L¨³ €ltXæ°%‡m0¨.°‚,W°$Ö+بaIV̤Àj…L¨³ €lt°^a]¶dØ®` 6@°\Á’XW°®†%mX^€D ¬jX"ÀT€)[€lt°^a]¶dØ®` 6@°\Á’XW°®†%mX^€D ¬jX"ÀT€)[€ltX^Àf[,°]a‰ XËaI ¬å°%mXF€º6XÕ°D€Re¶€ltX®` [l°­a‰ 2,ÉaI ¬1°¢†%mXR€Š6XÕ`µ€RS6€ltX®` [l°­a‰ 2,ÉaI ¬1°¢†%mXR€Š6XÕ`µ€RS6€ltX–à 먰^Ã’fÔ`…€%)°ÆÀŠ–´aY[š`Uƒ•LTÙ*€ltX–à 먰^Ã’fÔ`…€%)°ÆÀŠ–´aY[š`Uƒ•LTÙ*€ltX–à «”°^µ, `…€%)°ÆÀŠ–´a™¶š`µÂ¶¶Ø0€ltX–Ê€uJX¯`™–tXBÀ’Xc`E KÚ° ëš`µ‚5llÙÀ€ltX–Ê€uJX¯`™–tXBÀ’Xc`E KÚ° ëš`µ‚5llÙÀ€ltX–Ê€5jX«`K°¦Ã’XÓaI KÚ° ëš`Ã2ð0ØÔ€ltX–à ‡UZX“ƒ5Vä`M‡%)°ÆÀ2–´aV5Á kdàQ6 €ltX–à ‡UZX“ƒ5Vä`M‡%)°ÆÀ2–´aV5Á kdàQ6 €ltX–ë´°^ÃR «XC`I ¬1°L†%mXƆUM°"À xf€ltX–ë´°^ÃR «XC`I ¬1°L†%mXƆUM°"À xf€ltX–ë´°.ël°†À˜±ÁÖ X–‘`¬8,S/6l€ltX–ÇUhX•ƒõ [0X)@ ¬å°ÄlXF‚5R°zX¢s6$€ltX–ÇUhX•ƒõ [0X)@ ¬å°ÄlXF‚5R°zX¢s6$€ltX–ÇUhX•ò5Ö 0Ãë –À –‘`–V €š €ltX–ÇUhX•ò5Ö 0Ãë –À –‘`–V €š €ltX®`‰€UhXE€µ5–d0Ãë ¬±À –‘`Ex“9€ltX®`‰€UhXE€5Ó –d0Ãë–°À –‘`EøHƒ €ltX®`‰€UhXE€5Ó –d0Ãë–°À –‘`EøHƒ €ltX^`…€UhXƒÕÉ€%̰À†%$0†e$XÑ> Pf£€ltX^`…€UhXƒÕÉ€%̰À†%$0†e$XÑ> Pf£€ltX†aEÀ:4¬‚ÁêdÀ’fX`-`Ì€a V47)(³Q€lt°†a†5%XƒÕE€˜a5‡%T0†e$XÑQu6j€lt°†a†5%XƒÕE€˜a5‡%T0†e$XÑQu6j€ltXæ° Ãš¬BÀr€˜aõÁ :˜Ã26¬jêlÔ€ltX>°Y`M V!`íÀ ´°Áz`‰ Ì€a–µ‡6€ltX>°Y`M V!`íÀ ´°Áz`‰ Ì€a–µ‡6€ltX°­`M VÕÀƒ˜aõÀ˜Ã26,k:(¨°Ñ€ltX°­`M VÕÀƒ˜aõÀ˜Ã26,k:(¨°Ñ€ltàAä°¦«jà ̰Àz`‰ h°aVµlÙ@€ltàáX‡†U5ð@ŽfX`=°DfÀ° +R°ä N ¶l €ltàáX‡†U5ð@ŽfX`=°DfÀ° +R°ä N ¶l €ltà!tX…5ðÀŽfX`}°LfÀ°Ì€5)°"À–ÖÙ €ltà!tX…5ðÀŽfX`}°LfÀ°Ì€5)°"À–ÖÙ €ltàQ¬ƒÂx A3,°Î°„fÀ°,U&°ZaVÙ €ltà1VAa xPF†5ìØ`aÖpØ`òÖ™Àª†UXeƒ€ltà1VAa xPF†5ìØ`aÖpØ`òÖ™Àª†UXeƒ€ltà™« °¨°$ÖVaI–!`à VrX¡U6(€ltà™« °¨°$ÖVaI–!`à VrX¡U6(€ltàÇ‚UXE’TX’k+H°¤ Ë`°e+9¬ÐÀ 4€ltàaG‚uXE’%tX’kkX°¤ ˰ݬ`…€%Xaƒ€ltàaG‚uXE’%tX’kkX°¤ ˰ݬ`…€%Xaƒ€ltÐB‡U*XGå¦è°$Ö0¬Á’6,ËÁv;X!`‰VØ €ltФ‚u XCu&°$Ö+¬2`I–WPÙVX¡‚6h€ltФ‚u XCu&°$Ö+¬2`I–WPÙVX¡‚6h€lt`…u4°AuÔ(`I ¬WX'Ã’6,Á ¶¬°D ËlЀlt`…u4°AuÔ(`I ¬WX'Ã’6,Á ¶¬°D ËlЀlt0Q…uX§•¶¨`I ¬+XWÃ’6,qPßVX¢…e6h€ltØÖ[,°¥€m ØRÁ’XËaKÚ°Ü ´¬ä°B ËlЀltØÖ[,°¥€m ØRÁ’XËaKÚ°Ü ´¬ä°B ËlЀltXÙ¬°-[*°¥ƒ 5,IÁr¶tXÒè;ƒ•Vha™ €ltXÙ¬°-[*°¥ƒ 5,IÁr¶tXÒè;ƒ•Vha™ €ltXÞ[jØ¢u¬QÃ3dX®Ák8̨ûæ`µÂ,³A€ltXÞ ªrP¡…U ,ÑÏ XÆ€­x†›-À Xfƒ€ltXÞ ªrP¡…U ,ÑÏ XÆ€­x†›-À Xfƒ€lt°Þì8(CÁ2–hg,c`»ž!Àƒ±W°"` –Ù €lt°Þì8(CÁ2–hg,c`»ž!Àƒ±W°"` –Ù €ltXÞ<¬CÁ2X‚Ï X¦ÃÖ Xaƒ€ltXÞ`àygÐI@Tg,cÁ† Xaƒ€ltXÞd0ÛtUàYËØ@0€gØlMàØVØ €lt°ÞXÀ±å MàS€52XÀ¥Í êËlЀlt°ÞXÀ±å MàS€52XÀ¥Í êËlЀlt°Þ¨ ²!P)Tø` E>ÐS†Õ ËlЀlt°Þ¨ ²!P)Tø` E>ÐS†Õ ËlЀ&Ø`¹± LÞX0³±‘]`&IaÊ €À(K:›%€À(K:›%€ØlM€ØlM€ØlM€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€fÉl €fÕ¨e,€fÕ¨e,€f! –€f! –€fé`X&€f0·¬€f0·¬€få裖!€få裖!€fåhF,Ó€f+D –€f+D –€fWtEØ €fWtEØ €faTa@,Q€f ”€[¢€f ”€[¢€f9ªFä°°„€f3Ê€¬ °„ €f3Ê€¬ °„ €fÅFÌXB€fÅFÌXB€fEE¬-a€f¡@V,€f¡@V,€f¥K €f¥K €fYQPP·$€f˜%P·¤€f˜%P·¤€f˜PU0±€f¤PMP·€f¤PMP·€f¤PmP·„€f¤PmP·„€f´Qi0±$€f4ÑÍ ê–j€f4ÑÍ ê–j€fHÑ`bi€fHÑ`bi€fHÐ} ni€fTÐÍAÝ€fTÐÍAÝ€f”M€‰%€f”M€‰%€f Ñ]º¥€f@ÑuK€f@ÑuK€fh‘­5K€fhÐÍUK €fhÐÍUK €f¨Ðj–€f¨Ðj–€f(Ñ j–X€fÐÑjfY€fÐÑjfY€fP!›ÔÌ2€fP!›ÔÌ2€fPÑMªf¥€fPÐ jfµ€fPÐ jfµ€fЭjf5€fЭjf5€f°­ ªf5€f€Ñ­jfI€f€Ñ­jfI€fè–5³*€fÈ6È®AÕ¬2€fÈ6È®AÕ¬2€fÔ(,öjf¡€fÔ(,öjf¡€f (06 jfA€fÀ(XlÔÌ‚€fÀ(XlÔÌ‚€f(0XîÔÌÒ€f(0XîÔÌÒ€fä(0Xï TÍR€fjVvjf)€fjVvjf)€fVV·ÔÌ¢€fVV·ÔÌ¢€f` V6TÍ¢€f`¦62¨™E€f`¦62¨™E€f›ÔÌ"€f8 %R5³Ø€f8 %R5³Ø€f Š(¸*¨™€f Š(¸*¨™€fÅ‚* f–€fE J fV€fE J fV€fÅB ¦¡@ͬ€fÅB ¦¡@ͬ€fEC¦ AÕ¬€fXdе€jfÁ€fXdе€jfÁ€æ,(* fP@šY€æ,(* fP@šY€æL(:ŒÃB ÔÍÖ€æRŒ}@(‰Ù€æRŒ}@(‰Ù€æÚ(È0T@Ýì€æš(|/0”ÁÄ,€æš(|/0”ÁÄ,€æ%È®AH@Í,€æ%È®AH@Í,€æ(tÓ¡¤ f¶€æ$(tC@HAÍì€æ$(tC@HAÍì€æ*( t«¡š jö€æ*( t«¡š jö€æÊ(-dKà f¶€æÐ((ªF˜ Z fÖ€æÐ((ªF˜ Z fÖ€æ J‡Dˆ¨šÅ€æ („†Ž@¤@Í €æ („†Ž@¤@Í €æ4¨ †¹†a53L€æ4¨ †¹†a53L€æTˆƒ"`B‘53Ò€æ”h‹ ÓA€Ma53Ú€æ”h‹ ÓA€Ma53Ú€æèh tÅ9ºYAÕŒ€æèh tÅ9ºYAÕŒ€æhh3ÅÀtôÝ8¨™Ñ€æ(hŽƒpFÀLt9ÞjfH€æ(hŽƒpFÀLt9ÞjfH€æHh ¡™0³ÀL…÷€ªU€æHh ¡™0³ÀL…÷€ªU€æØh©àX0³ÀŒœ÷še€æØh…"  °„aFÎ;ƒšh€æØh…"  °„aFÎ;ƒšh€æÀhB0¬`Yñæ j €æ DŽ* Ô°ÜØ f€æ DŽ* Ô°ÜØ f€æA àã`¹‘AÍ €æA àã`¹‘AÍ €æjï –ÔÌP€æ„Ž2€G¬7¨™¡€æ„Ž2€G¬7¨™¡€æ`‚ªN€ÐltP5C€æ`‚ªN€ÐltP5C€æTÒAQC47¨%eX˜b€æ”ŒÊaA8, › Ô:¬˜ª€æ”ŒÊaA8, › Ô:¬˜ª€æ¦ÂÁú€Ø4 š@Õ€æ¦ÂÁú€Ø4 š@Õ€æc£t$„9x}Ó‚Z"‰©€æÈ€ŠÂ á oPPK 6]€æÈ€ŠÂ á oPPK 6]€æŽ‚Â% ƒd”ƒ¾¡A5-`±ÂÆ€L@ÐÀ†…A2J€o%PK,è°0€L@ÐÀ†…A2J€o%PK,è°0€š0M (ºÀB€oPKS@@˜r€š0M (ºÀB€oPKS@@˜r€$` C ]à!À·*¨%¨ ›r€ª°ŒB‚.ðƒà›Ô¶4LQ€aš€ª°ŒB‚.ðƒà›Ô¶4LQ€aš€Ê00)ºÀB€oMPÝZÀ Ýô€Ê00)ºÀB€oMPÝZÀ Ýô€Ð ˆD]àá@l PÛ¤ P7}€PP5‘BøA8,¶¨m%°“€›>€PP5‘BøA8,¶¨m%°“€›>€  ˆÊ‚.ðŒrPlRPÝ  Ð€a:€  ˆÊ‚.ðŒrPlRPÝ  Ð€a:€4$tÙ¬èÏ(ÆÖ•M )¦€ÔDÀw 0HF3XlPݰa1€ÔDÀw 0HF3XlPݰa1€Ô(æ ’á{$C–¶*¨lTØlVÓ€Ôè "ЇîŒ ê@<ÈV• ‹= ¦€Ôè "ЇîŒ ê@<ÈV• ‹= ¦€”(ŠŒ|”ÃÈ`ÉA¶2¨n` öƒ˜€”(ŠŒ|”ÃÈ`ÉA¶2¨n` öƒ˜€”(‡©‡Í #ƒ%¾•@m“Abt¦€èH‹b¯,W T7t¦ƒ8¦€èH‹b¯,W T7t¦ƒ8¦€èHFˆcW0Ëa²¡@mÓa0+¦€èHFˆcW0Ëa²¡@mÓa0+¦€èÈ¡ú [³LƒÁ7(¨í\‚ÊÁÆ4€èøÑCŸº0KÀƦÕ½‚!r°5 €èøÑCŸº0KÀƦÕ½‚!r°5 €èø)£Åß`˜†a Ʀµ CÉTL€èø)£Åß`˜†a Ʀµ CÉTL€hèPA¹²0½€ ôMj[@ð TL€hèPA99dK€±€ôMj;Æ©@Ít€hèPA99dK€±€ôMj;Æ©@Ít€hè0G3Ø)ب ¶ÔVP7€hè°Àô9 0ßH ¶xP1€hè°Àô9 0ßH ¶xP1€hèãb#à ®› jÛ‡mÓ€hèãb#à ®› jÛ‡mÓ€h(f6 ¸Ð7Ô¤€uÓ €h(¦6t#ÃÔF€* ð@bš€h(¦6t#ÃÔF€* ð@bš€èXŠMË›¬w5PàÜ”€èXŠMË›¬w5PàÜ”€èì:Xî54àAËT€Ø¢€…NkL J† 6…€Ø¢€…NkL J† 6…€ÀG$0tUXWµ ¬9ð`eº€@h Àˆ.Jè î°^¦€@h Àˆ.Jè î°^¦€t @¨ý@Y< àaÊT€t @¨ý@Y< àaÊT€ô!dÔ¾ÂXÀÃÆ”€j¤@Ôd4A7U€j¤@Ôd4A7U€ TÀé¨ xØÒ5e€ TÀé¨ xØÒ5e€`t‘c»ð¼+ 1E€DDAØ8Øn``7¥€DDAØ8Øn``7¥€–&tt€oª€–&tt€oª€5*Y:j!€ŠS&tÔB€ŠS&tÔB€ Š ›= ìƒ-0€ªÙ¬°`ÔB€ªÙ¬°`ÔB€UÅÌ `l€UÅÌ `l€UE¤`Š=°€ Z0ÃØ€ Z0ÃØ€‡j`-˜aÄ€‡j`-˜aÄ€‡’¢š0ˈ€j¢ª`É>ˆ€j¢ª`É>ˆ€Žh)L±slA€Žh)L±slA€8*E$°a_Q :€¦,(©À¾â-ZЀ¦,(©À¾â-ZЀ¦Ì¨4ª„½F¶6j€¦Ò(3V¾·6j€¦Ò(3V¾·6j€¦ÚèfÅP@Ø-…X@€¦ÚèfÅP@Ø-…X@€¦ZèÆ1¬èZ ›µP€¦èvÖuÄ ±P€¦èvÖuÄ ±P€¦$Èlt(„C,È€¦$Èlt(„C,È€¦ªè”TtJ©!d€¦Êè~”Z¡#AðV±P€¦Êè~”Z¡#AðV±P€¦ÐÈÎ(5œ Ñ@Ô¼•° €¦ÐÈÎ(5œ Ñ@Ô¼•° €¦PèæD Bt5²¡Aa!€¦Pèæ(¢c€@ [ ¦-V€¦Pèæ(¢c€@ [ ¦-V€¦ è&P* Õ è­Ð-`€¦´è†Q*ÕèjȆ†g€¦´è†Q*ÕèjȆ†g€¦Ôè^‰EFõ :Ý* †E€¦Ôè^‰EFõ :Ý* †E€¦”讉†PQý@­ c±8€¦è– ¡¢z€A¶,*¨Å€¦è– ¡¢z€A¶,*¨Å€¦hèF TŒ†ê8 ÝÊ Ã-p€¦hèF TŒ†ê8 ÝÊ Ã-p€¦(Ȧ£TŒ†&f(d+ÁŒjÁ €¦È膠TŒ†&idCÃÄ”€¦È膠TŒ†&idCÃÄ”€¦ØèV¦ $…`A¶‚@L™€¦ØèV¦ $…`A¶‚@L™€¦Xè&£L…&¤zbÀ¨©€¦@èf L…&U6¤â­†é£¦Z€¦@èf L…&U6¤â­†é£¦Z€¦t£L…&e•Ó¦ƒõ€ÐQSM€¦dtc¡T¢A4‚ ‘£[k… ¦¤€¦dtc¡T¢A4‚ ‘£[k… ¦¤€¦ t#¡Œ$ Å »b`>p0bª €¦ t#¡Œ$ Å »b`>p0bª €¦ t#ã F5‚„"Ð }`1Pjª€¦`d£à F%ŠÁà-Àr`Ñpjª€¦`d£à F%ŠÁà-Àr`Ñpjª€¦tt£¡›Ž$t ‚ aå8(1…€¦tt£¡›Ž$t ‚ aå8(1…€¦tSѦ# EBé´TGÔ¨)(€¦5²©iÓ‘„‚"¡t¼Ya3@¢FMi€¦5²©iÓ‘„‚"¡t¼Ya3@¢FMi€¦ºiÑMG6‚‚I ¦ è) €¦ ºAÑMGŠ…B°Ì®0ÓHU£¦T€¦ ºAÑMGŠ…B°Ì®0ÓHU£¦T€¦0º¡ñ¦C’ÁFÀ˜–j˜´F$¨)€¦0º¡ñ¦C’ÁFÀ˜–j˜´F$¨)€¦ÝÊȦ£I"¡BëÀr°´‚±)€¦ݤxÓÑF‘P‹W°Ô B&St€¦ݤxÓÑF‘P‹W°Ô B&St€¦ÝèF b#`¼Â:W°4HH°)*€¦ÝèF b#`¼Â:W°4HH°)*€¦‡n-tÓ!rÐ7(Š„*ð€-®`éQ9Ê`ST€¦litcà›EB!hîÀš“Â`Sd€¦litcà›EB!hîÀš“Â`Sd€¦nftÓA}££H¨dÀª ‹å`I r”A¦H€¦nftÓA}££H¨dÀª ‹å`I r”A¦H€¦8d³ ›¦dÞ8Š„>Ðf`&9X,¨‘`S,€¦8špdÓA †U˜SrB  l €¦8špdÓA †U˜SrB  l €&,HjtC`³‚Š„L0=¬"P“)€&ÌhÊèCÈÀÃŽŠCf@‰ÊB  Ô” €&ÌhÊèCÈÀÃŽŠCf@‰ÊB  Ô” €&Ò8 tKB‡EÚ`ª&:BMÕ€&Ò8 tKB‡EÚ`ª&:BMÕ€&Rh"ÐÍ |jTŠá +Ô˜NÀ¨)€&Rh" ‰:ÌÊQ– Va PÃb: ŒšÒ€&Rh" ‰:ÌÊQ– Va PÃb: ŒšÒ€&Òh‚ÑD s=X–° $6¥€&Òh‚ÑD s=X–° $6¥€&Òð$Ф ö ‡©` ¨ 2c‘)€&,Ä‘$ Sö ¬Š%°†!„…Må€&,Ä‘$ Sö ¬Š%°†!„…M倦8$TÇa°€™A¤X*T !$lZ€¦8$TÇa°€™A¤X*T !$lZ€¦ IÑqÐŽaiâØ©1#‘é €¦II,0ƒµ€GAYÁÈØ€¦II,0ƒµ€GAYÁÈØ€¦I‡$m P‰µ€GAY‘±©€¦’Mª°AgIOJ¬&2倦’Mª°AgIOJ¬&2倦0’’@€†ÉXšaPVf2£²)€¦0’’@€†ÉXšaPVf2£²)€¦š’ÐaÈxW`JÊ ŒÊ¦€¦5$á„ –”,á]©&“•M3€¦5$á„ –”,á]©&“•M3€¦HÂÑ$E£Ì ½‚©35Ó €¦HÂÑ$E£Ì ½‚©35Ó €¦tÈf$0l Q0ïL™b°)€¦`HbEÒ )™Á{S3]¦€¦`HbEÒ )™Á{S3]¦€¦dt³@Rû‚©XÂ{Ǫ́2}€¦dt³@Rû‚©XÂ{Ǫ́2}€¦ÈfFSƒ)0™÷¦;˜Á¨2}€¦@ÍŒ¦†!*fð†Át7E¦€¦@ÍŒ¦†!*fð†Át7E¦€¦XÈfBRÀ˜’¼a0Ý9`2¥€¦Èè–†lˆ©˜á ƒébS*€¦Èè–†lˆ©˜á ƒébS*€¦(È–†l& Ä4L¦M€é& „M)€¦(È–†l& Ä4L¦M€é& „M)€¦h­ ÙR(ƒ©™Á[€é^˜M)€¦È–B·JÆTDæ-ÀtWŒÅ¦è€¦È–B·JÆTDæ-ÀtWŒÅ¦è€¦”­ÙZ¨šhÌàÍÁtcÂbSt€¦”­ÙZ¨šhÌàÍÁtcÂbSt€¦Ô­Ù¨Ú 1x0ÝôØ€¦ èÖ‚lRRM ÞL·:¤LQ€¦ èÖ‚lRRM ÞL·:¤LQ€¦PèÖB7)A053xg0Ý䨀¦ÐM ÙªaZ&óÎ`ºŒmSd€¦ÐM ÙªaZ&óÎ`ºŒmSd€¦ÊMŠl3ˆÉ¼3(mc³)€¦ÊMŠl3ˆÉ¼3(mc³)€¦ªMÙJ4ïå ld6Å€¦$MŠn(LgÐȼ”7¶‘Ù €¦$MŠn(LgÐȼ”7¶‘Ù €¦ZèV…lL”¼3˜nÔP2Å€¦ZèV…lL”¼3˜nÔP2Å€¦Úè&A6-Æ*2ïÓ ›€¦ÒèVE7-–ó¼L7E¨6€¦ÒèVE7-–ó¼L7E¨6€¦ÌÈVA75–eïÓMÅÈlÊ€¦ÌÈVA75–eïÓMÅÈlÊ€¦,­Ù”x÷dÞ¦›6ÔL€8dC#›W+Oæ`ºACÍ”€8dC#›W+Oæ`ºACÍ”€ÙJè¦ÀÕ{i(mèÑ3%€‡n(tSàÏh˜ne£ÚT €‡n(tSàÏh˜ne£ÚT €l(t£¢ŸÑÆÁt«Õ¦j€l(t£¢ŸÑÆÁt«Õ¦j€²AðFE7>™7+˜n£ÚT €Ù´ÈFF7P›L·£fª€Ù´ÈFF7P›L·£fª€dÓâŒ2 [Ì`º¥B—©€dÓâŒ2 [Ì`º¥B—©€ dS£ eÖÓ„–)€²ih#¡I¦‰"S€²ih#¡I¦‰"S€tS¡ Ý’¥Á4y¨lJ€tS¡ Ý’¥Á4y¨lJ€& °ÞdSâ…nÉR`š"4›Ò€ìJP­-A7ºÑ-Y LÓuS€ìJP­-A7ºÑ-Y LÓuS€ìX&U°f“€lt¼9ð`“Ð *¼è(@’àñ>X&U°f“€lt¼9ð`“( J¼¨ ”*àñn°&U°d€lt¼9ð°í0æ}@GåTÏû`›TÁ’ €lt¼9ð°í0æ}@GåTÏû`›TÁ’ €lt¼9ð°ÁË å}0åà0°oJ˜^€o?¬#³*X²€lt¼9ð°ÁË å}0åà0°oJ˜^€o?¬#³*X²€lt¼9Ì:8-ð`º9„–÷*ø4¼`àÛ¶H¤Vl@€lt¼9Ðw4›¥á}0 &+ð°ïƒuR+6 €lt¼9Ðw4›¥á}0 &+ð°ïƒuR+6 €lt¼9Ð7Žw€™&JE{`L(`8(vƒ- ©€€lt¼9Ð7Žw€™&JE{`L(`8(vƒ- ©€€lÞè;xC@I ¡ =°ÀÀá8L@¼Ý6¨¤–lÀ€lt¼9Ð7Ž·2XТè´6:˜÷Ð~XG'°d€lt¼9Ð7Ž·2XТè´6:˜÷Ð~XG'°d€lt¼9Ð7Ž·ÌP¡¨´:„÷аE'°d€lt¼9Ð7Ž·ÌP¡¨´:„÷аE'°d€lt¼9Ð7ŽÓÁ E¡=°ÑÁ¼ïƒuJRK6`€lt¼9Ð7Ž“€2ŠD{`£ƒy;í[JRk6`€lt¼9Ð7Ž“€2ŠD{`£ƒy;í[JRk6`€lt¼9Ð7ŽS ŠE{`£ƒy;í*Rk6`€lt¼9ÐwpÃÀ‚0hlt0oVÚë4¤–lØ€lt¼9ÐwpÃÀ‚0hlt0oVÚë4¤–lØ€lt¼9Ðwp’€CÈ´6:˜™Ñ=`KCJ`Ɇ €lt¼9Ðwp’€CÈ´6:˜™Ñ=`KCJ`Ɇ €lt¼9Ðwp‘@Ô´6:˜™ñ>X±X³a€lt¼9ÐwpB†2 ÚÌL´lhH ¬Ù°€lt¼9ÐwpB†2 ÚÌL´lhH ¬Ù°€lt¼9Ðå°´rBƒ“0íf&Ú¶´¤ÖlØ€lt¼9Ðå°´rBƒ“0íf&Ú¶´¤ÖlØ€lt¼9ðà0'J‚ =°ÑÁ,…÷Á:()56€lt¼9ðà0'j•ÓØè`ÖBvƒ-()€lt¼9ðà0'j•ÓØè`ÖBvƒ-()€lt¼9˜g sAhM{`£ƒY ïƒuhR+6$€lt¼9˜g sAhM{`£ƒY ïƒuhR+6$€lt¼¬ca˜Ê@WÚ v ÚëJ¤VlH€ltœj sRB%L{`£ƒAŠî[%‚k6$€ltœj sRB%L{`£ƒAŠî[%‚k6$€ltœj sRF(A{`£ƒAŠ÷Áº Aƒ5€ltœj sRE(§=°ÑÁ @¡}`«ÂJ`͆€ltœj sRE(§=°ÑÁ @¡}`«ÂJ`͆€ltœj s"Á@H¦=°ÑÁ @¡=`«ÊJ`Ɇ€ltœj s"Á@H¦=°ÑÁ @¡=`«ÊJ`Ɇ€ltœj sÒÀ@èÓØè`P Ñ~X'e(°fC€ltœj sÒ@Ñã=°ÑÁ ÀB÷€-)C5 €ltœj sÒ@Ñã=°ÑÁ ÀB÷€-)C5 €ltœj sÒ",´ilt0(°ð>X×d(°fC€ltœj sÒ",´ilt0(°ð>X×d(°fC€ltœj sÒÆX ï0í[M†k6€ltœj sÒÆHà{`£ƒAÁ@÷€­C%€ltœj sÒÆHà{`£ƒAÁ@÷€­C%€ltœj ó˜oTFÙ ÞëR –lh€ltœj ó˜ÚXº6:dd7Øja(°dC€ltœj ó˜ÚXº6:dd7Øja(°dC€ltœ0 ó°Þ ŒÙ 2ÞëR¬ØÐ€ltœ0 ó°Þ ŒÙ 2ÞëR¬ØÐ€ltœ0XðXÙtŒ†î…šöƒ+64€ltœ0XðXÛtB§=°Ð! € {À–™AÁŠ €ltœ0XðXÛtB§=°Ð! € {À–™AÁŠ €ltœ0¨Cv€í–£¨´6:¼Ö™1(X²¡€ltœ0¨Cv€í–£¨´6:¼Ö™1(X²¡€ltœ0 ØÛ»BPhl`ãà;C訠 ã}`ËŒAÁ’ €ltœ0 Ø*{…"ÑØð¼x°¢ã}°¾Y1-X³¡€ltœ0 Ø*{…"ÑØð¼x°¢ã}°¾Y1-X³¡€ltœ0 Øj{cÑàavð`… ý°¾qL Ölè€ltœ0 Øj{cÑàavð`… ý°¾qL Ölè€ltœ0 Øê¦=ÀÃìàÁJŽîÛcZ°fC€ltœ0 Øê¦=ÀÃìàÁJŽ÷ÁúL –l”€ltœ0 Øê¦=ÀÃìàÁJŽ÷ÁúL –l”€ltœ0 Ø¦[À`Ðàavð`UÓ>°Ý`°d£€ltœ0 Ø¦[€A¦=ÀÃìàÁª¦=`»x Ø(€ltœ0 Ø¦[€A¦=ÀÃìàÁª¦=`»x Ø(€ltœ0ÀØ8(ï s5íf÷V+í‡õ}ÀÁF €ltœ0ÀØ8(ï s5íf÷V+í‡õ}ÀÁF €ltœ0ÀØ8(ï s5íf÷V0Þ¶[ÂF €ltœ0ÀØ8(ï s5íf÷V0Þë 4Ø(€ltœ0ÀØ8(ï s5íf÷V0Þë 4Ø(€ltœ0ÀØ8ì‡ „ö³{€+‚öÍFr6j€ltœ0ÀØ8ì‡ „ö³{€+‚öÍFr6j€ltœ0ÀØ8ì‡ „ö³{€+ŽîÛ ÔlÔ€ltœ0ÀØ8(Vð=@Óàavð`Åñ>XßX@ÃF €ltœ0ÀØ8(Vð=@Óàavð`Åñ>XßX@ÃF €ltœ0ÀØ8( ´è`Ú<Ìî¬2Þ¶ÌØ¨€ltœ0ÀØ8( ´è`Ú<Ìî¬2Þ¶ÌØ¨€lt¼ ˜Þ8( ´è`ÚÖ{€«Œ÷€ÍfÀ†Cl4€lt¼9ð°´qP@hÐÁ´¬È÷VOûa}K ƒ²ƒ€lt¼9ð°´qP@hÐÁ´¬È÷VOûa}K ƒ²ƒ€lt¼9ð°´qP@hLiX>ï¬Ý¶›Œb€lt¼9ð°´qP@hÌ hÌ>hì¬ïƒõM†ÌŽ€lt¼9ð°´qP@hÌ hÌ>hì¬ïƒõM†ÌŽ€lt¼9ð°´qP@xÌ"hÌpPÁ!{`‡á`ÚxØn¤"v €lt¼9ð°´qP@xÌ"hÌpPÁ!{`‡á`ÚxØn¤"v €lt¼9ð°´qP@xÌ"hLà(´ÚðA÷€íCä(gv€lt¼9ð°´qPÐñ˜EРoVÞŠ-h?¬oFeÇ€lt¼9ð°´qPÐñ˜EРoVÞŠ-h?¬oFeÇ€lt¼9ð°´qPÐñÆÁA{@±Yi(vA÷€í¦£dÔ¡ì8€lt¼9ð°´qPÐñÆÁA{@±Yi(vA÷€í¦£dÔ¡ì8€lt¼9ð°´qP hX"h(6+íÅ.x¬o 6€lt¼9ð°´qP hã` = Ø¬´;Ó>°Ýr(ؘ€lt¼9ð°´qP hã` = Ø¬´;Ó>°Ýr(ؘ€lt¼9ð°´qPÈi;Xi(6+íÅ>tØî‚ 6i€lt¼9ð°´qPÈi;Xi(6+íÅ>tØî‚ 6i€lt¼9ð°´qPÈi;Xi(6+íÅ>Ú뻂PÀ†M€lt¼9ð°´qPTxã°¦= Ø¬´»ñ>Xß„6lÚ€lt¼9ð°´qPTxã°¦= Ø¬´»ñ>Xß„6lÚ€lt¼9ð°´qP¬èf…e0íÅf¥= Øîƒõ½B@ÀΦ €lt¼9ð°´qP¬´YaL{@±Yi(vÐ>°%ÃŒ*‚M€lt¼9ð°´qP¬´YaL{@±Yi(vÐ>°%ÃŒ*‚M€lt¼9ð°´qPÀxã° ¦= Ø¬´Çû€Žª‚‚€lt¼9ð°´qPÀxã° ¦= Ø¬´Çû€Žª‚‚€lÞxXÚ8(ÂkÚŠÍJ{@±q¼xPã()lØH€lt¼9ð°´qPpt³Â:„ö€b³ÒP°à}ÀÃR£k€M€lt¼9ð°´qPpt³Â:„ö€b³ÒP°à}ÀÃR£k€M€lt¼9ð°´qPdt³‚-„ö€b³ÒP0£û€p p˜AÅ0i†M€lt¼9ð°´qPdt³‚-„ö€b³ÒP0£û€p p˜AÅ0i†M€lt¼9ð°´qP¶jÚŠÍJ{@ÁL Ã()(Ø €lt¼9Ì:Ø806ŠA7+l©i(6+í…4NÐxAHaà €lt¼9Ì:Ø806ŠA7+l©i(6+í…4NÐxAHaà €lt¼9Ðwàƒ"ÐÍ *jÚŠÍJ{@!4®P ³A€lt¼9Ðwàƒ"ÐÍ *jÚŠÍJ{@!4®P ³A€lt¼9Ðwàƒ5 ¨’i(6+í…6NÊXNJ0Àlt¼9Ðwàƒåf52íÅf¥= ÐB“2Æ`P°d£€lt¼9Ðwàƒåf52íÅf¥= ÐB“2Æ`P°d£€lt¼9ÐwàÃ, ¨3h(6+í…%UŒA(a…€lt¼9Ðwàà 3˜2hÐYh(4p"ÁtVÙ¨€lt¼9Ðwàà 3˜2hÐYh(4p"ÁtVÙ¨€lt¼9ÐwàƒLiÐYh(HÑD‚!„ ¶l”€lt¼9ÐwàƒLiÐYh(HÑD‚!„ ¶l”€lt¼9Ðwàƒb³‚)í: í)% ¬ÀX Æ†€lt¼9ÐwàÆرhÐYh(TѤÁd”&lè€lt¼9ÐwàÆرhÐYh(TѤÁd”&lè€lt¼9Ðwà±Y‰÷…ö€B•’&£jPg£€lt¼9Ðwà±Y‰÷…ö€B•’&£jPg£€lt¼9Ðwàƒ¾Y…÷…ö€B'mÌ@é ÆF€lt¼9Ðwàƒ¾Y…÷…ö€B MÚÆrPg€lt¼9Ðwàƒ¾Y…÷…ö€B MÚÆrPg€lt¼9Ðwàƒ¾LQyÐYh(”(Iƒb¥ÔÙ €lt¼9Ðwà±qPCç}@g¡= €Â‰ +*@M€lt¼9Ðwà±qPCç}@g¡= €Â‰ +*@M€lt¼9ÐwàÃbã°MÁû€ÎB{@…(*äÀ„M€lt¼9ÐwàÃbã°MÁû€ÎB{@…(*äÀ„M€lt¼9ÐwàÃf;¬Sñ> ³ÐP€àÄ 9n0a#€lt¼9ÐwàÃf¬ÐðÎ`g¡=  %VØ4€lt¼9ÐwàÃf¬ÐðÎ`g¡=  %VØ4€lt¼9ÐwàƒbXÓò> ³ÐPÐ’Žƒú€%›6€lt¼9ÐwàƒbXÓò> ³ÐPÐ’Žƒú€%›6€lt¼9ÐwàcÌ‚ò> ³ÐPPcÝAA‡s˜f“€lt¼9Ðwàc7LAó> ³ÐPP"ºƒ‚ÂÀ`c€lt¼9Ðwàc7LAó> ³ÐPP"ºƒ‚ÂÀ`c€lt¼9ÐwàÃÔP(ñ> ³ÐPPb½A¡ö v€lt¼9ÐwàÃÔP(ñ> ³ÐPPb½A¡ö v€lt¼9ÐwàÃÌnX¨ð> ³ÐPP~ ‚Ý€lt¼9ÐwàÃÌ>ÐIxÐYh(ÐPý@ƒ½€lt¼9ÐwàÃÌ>ÐIxÐYh(ÐPý@ƒ½€lt¼9ÐwàÃì~¨&ï: íÖJpö€lt¼9Ðwàƒå>ˆ&ï: í*ª?(”Pö€lt¼9Ðwàƒå>ˆ&ï: í*ª?(”Pö€lt¼9Ðwàƒå>ˆ&ï: í*é*Ì΀lt¼9Ðwàƒå>ˆ&ï: í*é*Ì΀lt¼9Ðwàƒ"ð>)ï: í2é&€lt¼9Ðwàƒbh?BÂû€ÎB{@u&€lt¼9Ðwàƒbh?BÂû€ÎB{@u&€lt¼9Ðwàƒbhg”„÷…ö€Ž#‰ &€lt¼9Ðwàƒbhg”„÷…ö€Ž#‰ &€lt¼9ÐwàƒâðΨ ï: í6ððô 0q€lt¼9ÐwàƒâQ%ÞtÚ d˜U‡fL€lt¼9ÐwàƒâQ%ÞtÚ d˜U‡fL€lt¼9Ðwàƒ"ã]PhÞtÚ T˜„5€lt¼9Ðwàƒ"ã]PhÞtÚ T˜„5€ltÞÐwàƒ‚Óæ((ï vÚ -˜ÃÄ€lÚÐwàƒ‚£» ´¼è,´;`›8€lÚÐwàƒ‚£» ´¼è,´;`›8€lÚÐwàƒB » 40å ‚Ã íÅÆa1q€lÚÐwàƒÆ[ TÀÃ2 í LBM€lÚÐwàƒÆ[ TÀÃ2 í LBM€lts ïÀŒnPË,´,0 5q€lts ïÀŒnPË,´,0 5q€làakÞ8(VÚ0J<,±ÐP0Ã$ÜÄ€làakÞ8(*¼aT xÍJ{@! “p“€làakÞ8(*¼aT xÍJ{@! “p“€làakÞ8(*tè6ðpÚ i˜7q€làakÞ8(*tè6ðpÚ i˜7q€ltàÁvÞ8(äè†QMàá,´Ú0 º‰€l À±q¼qP h¯()ðpÚ m˜ÝÄ€l À±q¼qP h¯()ðpÚ m˜ÝÄ€l À±q¼6t¼”x8 í…L‚aâ€l À±q¼6t¼”x8 í…L‚aâ€l À±q¼qPÐѽ¢*ÀÃYh(4`æ&€l À±q¼qP@hWˆðpÚ ˜„¹‰€l À±q¼qP@hWˆðpÚ ˜„¹‰€l´ÀÃbãxã Pà]¡ÐÀÃYh(4`æ&€l´ÀÃbãxã P »BA‡³ÐPhÁ$&€l´ÀÃbãxã P »BA‡³ÐPhÁ$&€l´ÀÃbãxãÀPà]£ ÀÃYh(¶2Ø:ð jâ€l´ÀÃbãxãÀPà]£ ÀÃYh(¶2Ø:ð jâ€l´ÀÃbãxãÀ Ó–£4ÀÃYh(tØ:bÒ€l´ÀÃbãxãÀ £»‚PÎB{@a†€l´ÀÃbãxãÀ £»‚PÎB{@a†€l´ÀÃbãxãÀà-G)€g¡= 0C€l´ÀÃbãxãÀà-G)€g¡= 0C€l´ÀÃbãxãÀ¢-GÑg¡= 0C€l´ÀÃbãxãÀB·EºYi(Ì€l´ÀÃbãxãÀB·EºYi(Ì€l´ÀÃbãxãÀÀ¢Aí…€l´ÀÃbãxãÀÀ¢Aí…€l´ÀÃbãxãÀÀƃ&PÚ 3€l´ÀÃbãxãÀÀF·M ´f€l´ÀÃbãxãÀÀF·M ´f€l Àƒ¾oÈè^ ”ö€Â €¦8Þ80Pð†! ŠöÂŒ€¦8Þ80Pð†! ŠöÂŒ€¦8Þ80PAí…€¦8Þ80PAí…€¦8Þ80ÐÐ= 'PÚ 3€¦8Þ80(h,-í…€¦8Þ80(h,-í…€¦8Þ80(Pf`$jÚ 3€¦8Þ80(Pf`$jÚ 3€¦8Þ80(m˜IT´f€¦8Þ80¨±X& Ú 3€¦8Þ80¨±X& Ú 3€¦8Þ80¨QXNè´f€¦8Þ80hQ%XMè´f€¦8Þ80hQ%XMè´f€¦8Þ80@0Ø&TÚ 3€¦8Þ80@0Ø&TÚ 3€¦8Þ80 ˆÔ2í…€¦8Þ (”L2ï…€¦8Þ (”L2ï…€¦8Þ %B’„Eû@aF€¦8Þ %B’„Eû@aF€¦8Þ eŒ š ˆöÂŒ€¦8ï…2 Ô ˆöÂŒ€¦8ï…2 Ô ˆöÂŒ€¦8ï…*1@+ygP˜€¦8ï…*1@+ygP˜€¦8ï †€Y¢} 0#€¦8Þ80H h%dÚt3€¦8Þ80H h%dÚt3€¦8ð`­å@“P‡e3€¦8ð`)E0˜%tàaÙŒ€¦8ð`)E0˜%tàaÙŒ€¦8ð`­…r ITÀò€¦8ð`­…r ITÀò€¦Àƒ˜€¦ à!ÒÀ³>Àƒ˜€¦ à!ÌÀKàAÌ€¦ à!,`¦àAÌ€¦ à!,`¦àAÌ€¦ à!,@­Àƒ˜€¦ à!,@­Àƒ˜€¦ à!r}ÄŒ€¦ à!ûÁD_1#€¦ à!ûÁD_1#€¦ à!ûAU—bF€¦ à!»€­ŽÄŒ€¦ à!»€­ŽÄŒ€¦ à![Àªn†€¦ à![Àªn†€¦ à![À’®ÄŒ€¦ à!›K]<ˆ€¦ à!›K]<ˆ€¦`àá{]<¸€¦`àá{]<¸€¦ àÑ]CÇn†€æÊ°±¢€æÊ°±¢€æ*@X‘€æ*@X‘€æ*0¬0€æ$P«¬€æ$P«¬€æ¨U€æd5€æd5€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€²Y€–YB€–YB€f(£efLÍHŒ–d€æT`……¢B¤1%Áƨl®€æT`……¢B¤1%Áƨl®€æT°¢Á‚kCPá@ @•Í5€æT°¢Á‚kCPá@ @•Í5€æT`‹€A†¡‚:5›k€æT ºÀ‚„&ædX@ Xs€æT ºÀ‚„&ædX@ Xs€æT ƒ]sRÐÕ €†˜“€æT ƒ]sRÐÕ €†˜“€æT ƒb… )t`@€.a€˜«€æT`ÇÁaJCt˜Bƒ b® €æT`ÇÁaJCt˜Bƒ b® €æT°xØp˜â0¥ v:ÐÀÃ\€æT°xØp˜â0¥ v:ÐÀÃ\€æT°È°)0ý0£t0Ð+` € a® €æ4@dØ<Ì>Ì@Áè(À0GÀÜ\ €æ4@dØ<Ì>Ì@Áè(À0GÀÜ\ €æT°È°)0`3t`À@G€¢‚¹€æT°È°€a† Xb€ƒ‚Š 6æJ€æT°È°€a† Xb€ƒ‚Š 6æJ€æT°È°¨ÀD¬é €aC‡©èæP€æT°È°¨ÀD¬é €aC‡©èæP€æT°x˜#@…–è à  ÃSæP€æT°X(`MVè à°À ‡s€æT°X(`MVè à°À ‡s€æT°Í€%-X£ƒâaÙ æ €æT°Í€%-X£ƒâaÙ æ €æT` Kš`ƒÅÖVæ´€æT`‹–Ú@ÌÁ°Ø@ÀzÀÊœ€æT`‹–Ú@ÌÁ°Ø@ÀzÀÊœ€æT°3Z@ l ÀA5§€æT°3Z@ l ÀA5§€æT Æ€ X@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default # Check if we have a version mismatch between libtool.m4 and ltmain.sh. # # Note: This should be in AC_LIBTOOL_SETUP, _after_ $ltmain have been defined. # We also should do it _before_ AC_LIBTOOL_LANG_C_CONFIG that actually # calls AC_LIBTOOL_CONFIG and creates libtool. # _LT_VERSION_CHECK # Use C for the default configuration in the libtool script tagname= AC_LIBTOOL_LANG_C_CONFIG _LT_AC_TAGCONFIG ])# AC_LIBTOOL_SETUP # _LT_VERSION_CHECK # ----------------- AC_DEFUN([_LT_VERSION_CHECK], [AC_MSG_CHECKING([for correct ltmain.sh version]) if test -z "$ltmain"; then AC_MSG_RESULT(no) echo echo "*** [Gentoo] sanity check failed! ***" echo "*** \$ltmain is not defined, please check the patch for consistency! ***" echo exit 1 fi gentoo_lt_version="1.5.18" gentoo_ltmain_version=`grep '^[[:space:]]*VERSION=' $ltmain | sed -e 's|^[[:space:]]*VERSION=||'` if test "$gentoo_lt_version" != "$gentoo_ltmain_version"; then AC_MSG_RESULT(no) echo echo "*** [Gentoo] sanity check failed! ***" echo "*** libtool.m4 and ltmain.sh have a version mismatch! ***" echo "*** (libtool.m4 = $gentoo_lt_version, ltmain.sh = $gentoo_ltmain_version) ***" echo echo "Please run:" echo echo " libtoolize --copy --force" echo echo "if appropriate, please contact the maintainer of this" echo "package (or your distribution) for help." echo exit 1 else AC_MSG_RESULT(yes) fi ])# _LT_VERSION_CHECK # _LT_AC_SYS_COMPILER # ------------------- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_AC_SYS_COMPILER # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. AC_DEFUN([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. AC_DEFUN([_LT_COMPILER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. AC_DEFUN([_LT_LINKER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_LINKER_BOILERPLATE # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_LINK_IFELSE(AC_LANG_PROGRAM,[ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX # _LT_AC_SHELL_INIT(ARG) # ---------------------- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_AC_SHELL_INIT # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string="`eval $cmd`") 2>/dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) ])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK # ----------- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case "`/usr/bin/file conftest.o`" in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-linux*) # Test if the compiler is 64bit echo 'int i;' > conftest.$ac_ext lt_cv_cc_64bit_output=no if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *"ELF 64"*) lt_cv_cc_64bit_output=yes ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; ]) esac need_locks="$enable_libtool_lock" ])# _LT_AC_LOCK # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED]) AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $rm conftest* ]) if test x"[$]$2" = xyes; then ifelse([$5], , :, [$5]) else ifelse([$6], , :, [$6]) fi ])# AC_LIBTOOL_COMPILER_OPTION # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then ifelse([$4], , :, [$4]) else ifelse([$5], , :, [$5]) fi ])# AC_LIBTOOL_LINKER_OPTION # AC_LIBTOOL_SYS_MAX_CMD_LEN # -------------------------- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for *BSD fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi ])# AC_LIBTOOL_SYS_MAX_CMD_LEN # _LT_AC_CHECK_DLFCN # -------------------- AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl ])# _LT_AC_CHECK_DLFCN # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ------------------------------------------------------------------ AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_unknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi ])# AC_LIBTOOL_DLOPEN_SELF # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp $SED '/^$/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* ]) ])# AC_LIBTOOL_PROG_CC_C_O # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) # ----------------------------------------- # Check to see if we can do hard links to lock some files if needed AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl hard_links="nottested" if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS # AC_LIBTOOL_OBJDIR # ----------------- AC_DEFUN([AC_LIBTOOL_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir ])# AC_LIBTOOL_OBJDIR # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) # ---------------------------------------------- # Check hardcoding attributes. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH # AC_LIBTOOL_SYS_LIB_STRIP # ------------------------ AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi ])# AC_LIBTOOL_SYS_LIB_STRIP # AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; linux*) if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' else $archive_expsym_cmds="$archive_cmds" fi else ld_shlibs=no fi ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi case $host_cpu:$lt_cv_cc_64bit_output in powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes) sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /usr/X11R6/lib64" sys_lib_search_path_spec="/lib64 /usr/lib64 /usr/local/lib64 /usr/X11R6/lib64" ;; esac # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' # Find out which ABI we are using (multilib Linux x86_64 hack). libsuff= case "$host_cpu" in x86_64*) echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *64-bit*) libsuff=64 ;; esac fi rm -rf conftest* ;; *) ;; esac sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}" sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in "") ;; *) AC_MSG_ERROR([invalid tag name: $tagname]) ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then AC_MSG_ERROR([tag name \"$tagname\" already exists]) fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_LIBTOOL_LANG_CXX_CONFIG else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG else tagname="" fi ;; RC) AC_LIBTOOL_LANG_RC_CONFIG ;; *) AC_MSG_ERROR([Unsupported tag name: $tagname]) ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" AC_MSG_ERROR([unable to update list of available tagged configurations.]) fi fi ])# _LT_AC_TAGCONFIG # AC_LIBTOOL_DLOPEN # ----------------- # enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_DLOPEN # AC_LIBTOOL_WIN32_DLL # -------------------- # declare package support for building win32 dll's AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_WIN32_DLL # AC_ENABLE_SHARED([DEFAULT]) # --------------------------- # implement the --enable-shared flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([shared], [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]AC_ENABLE_SHARED_DEFAULT) ])# AC_ENABLE_SHARED # AC_DISABLE_SHARED # ----------------- #- set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no) ])# AC_DISABLE_SHARED # AC_ENABLE_STATIC([DEFAULT]) # --------------------------- # implement the --enable-static flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([static], [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]AC_ENABLE_STATIC_DEFAULT) ])# AC_ENABLE_STATIC # AC_DISABLE_STATIC # ----------------- # set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no) ])# AC_DISABLE_STATIC # AC_ENABLE_FAST_INSTALL([DEFAULT]) # --------------------------------- # implement the --enable-fast-install flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([fast-install], [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) ])# AC_ENABLE_FAST_INSTALL # AC_DISABLE_FAST_INSTALL # ----------------------- # set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no) ])# AC_DISABLE_FAST_INSTALL # AC_LIBTOOL_PICMODE([MODE]) # -------------------------- # implement the --with-pic flag # MODE is either `yes' or `no'. If omitted, it defaults to `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default) ])# AC_LIBTOOL_PICMODE # AC_PROG_EGREP # ------------- # This is predefined starting with Autoconf 2.54, so this conditional # definition can be removed once we require Autoconf 2.54 or later. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ])]) # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ])# AC_PATH_TOOL_PREFIX # AC_PATH_MAGIC # ------------- # find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# AC_PATH_MAGIC # AC_PROG_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no]) AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case "$host_cpu" in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown ])# AC_DEPLIBS_CHECK_METHOD # AC_PROG_NM # ---------- # find the pathname to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/${ac_tool_prefix}nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac esac fi done IFS="$lt_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" ])# AC_PROG_NM # AC_CHECK_LIBM # ------------- # check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If # DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will # be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and # top_srcdir appropriately in the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl installable library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that LIBLTDL # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If # DIRECTORY is not provided and an installed libltdl is not found, it is # assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' # and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single # quotes!). If your package is not flat and you're not using automake, # define top_builddir and top_srcdir appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, lt_dlinit, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_INSTALLABLE # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX]) ])# AC_LIBTOOL_CXX # _LT_AC_LANG_CXX # --------------- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) ])# _LT_AC_LANG_CXX # _LT_AC_PROG_CXXCPP # --------------- AC_DEFUN([_LT_AC_PROG_CXXCPP], [ AC_REQUIRE([AC_PROG_CXX]) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP fi ])# _LT_AC_PROG_CXXCPP # AC_LIBTOOL_F77 # -------------- # enable support for Fortran 77 libraries AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77]) ])# AC_LIBTOOL_F77 # _LT_AC_LANG_F77 # --------------- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) ])# _LT_AC_LANG_F77 # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ]) ])# AC_LIBTOOL_GCJ # _LT_AC_LANG_GCJ # --------------- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) ])# _LT_AC_LANG_GCJ # AC_LIBTOOL_RC # -------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) ])# AC_LIBTOOL_RC # AC_LIBTOOL_LANG_C_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) AC_DEFUN([_LT_AC_LANG_C_CONFIG], [lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # # Check for any special shared library compilation flags. # _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= if test "$GCC" = no; then case $host_os in sco3.2v5*) _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' ;; esac fi if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then : else AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no fi fi # # Check to make sure the static flag actually works. # AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF($1) # Report which librarie types wil actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_C_CONFIG # AC_LIBTOOL_LANG_CXX_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= # Source file extension for C++ test sources. ac_ext=cc # Object file extension for compiled C++ test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration AC_PROG_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_AC_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) _LT_AC_TAGVAR(always_export_symbols, $1)=yes # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds it's shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) case "$host_os" in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; *) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; ia64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case "$host_cpu" in ia64*|hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; linux*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; sco*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. We must also pass each convience library through # to the system linker between allextract/defaultextract. # The C++ compiler will combine linker options so we # cannot just pass the convience library names through # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' fi ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$GXX" _LT_AC_TAGVAR(LD, $1)="$LD" AC_LIBTOOL_POSTDEP_PREDEP($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld ])# AC_LIBTOOL_LANG_CXX_CONFIG # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) # ------------------------ # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" ifelse([$1], [], [#! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG], [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_[]_LT_AC_TAGVAR(LD, $1) # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) # Commands used to build and install a shared archive. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) # Flag that forces no undefined symbols. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) # The commands to list exported symbols. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) # Symbols that must always be exported. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ifelse([$1],[], [# ### END LIBTOOL CONFIG], [# ### END LIBTOOL TAG CONFIG: $tagname]) __EOF__ ifelse([$1],[], [ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ]) else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ])# AC_LIBTOOL_CONFIG # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux*) if test "$host_cpu" = ia64; then symcode='[[ABCDGIRSTW]]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris* | sysv5*) symcode='[[BDRT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[[]] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) # --------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) ifelse([$1],[CXX],[ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc* | ecpc*) # Intel C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC*) # Portland Group C++ compiler. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; sco*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; *) ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; unixware*) ;; vxworks*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; newsos6) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; ccc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; sco3.2v5*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' ;; solaris*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; unicos*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac ]) # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_AC_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. _LT_CC_BASENAME([$compiler]) case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac _LT_AC_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* ) # Portland Group f77 and f90 compilers _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; sunos4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) _LT_AC_TAGVAR(always_export_symbols, $1)=yes # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds it's shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; bsdi[[45]]*) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) case "$host_os" in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; *) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi ;; os2*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; sco3.2v5*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then wlarc='${wl}' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; *) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_AC_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4.2uw2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv5*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' ;; uts4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_AC_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) _LT_AC_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac ])# AC_LIBTOOL_PROG_LD_SHLIBS # _LT_AC_FILE_LTDLL_C # ------------------- # Be careful that the start marker always follows a newline. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ ])# _LT_AC_FILE_LTDLL_C # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) # --------------------------------- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_MSG_RESULT([$SED]) ]) # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.9.6])]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 7 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.58])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. # # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). # This was a mistake. There are at least two reasons why we must not # use `-m 0755': # - it causes special bits like SGID to be ignored, # - it may be too restrictive (some setups expect 775 directories). # # Do not use -m 0755 and let people choose whatever they expect by # setting umask. # # We cannot accept any implementation of `mkdir' that recognizes `-p'. # Some implementations (such as Solaris 8's) are not thread-safe: if a # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' # concurrently, both version can detect that a/ is missing, but only # one can create it and the other will error out. Consequently we # restrict ourselves to GNU make (using the --version option ensures # this.) AC_DEFUN([AM_PROG_MKDIR_P], [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi AC_SUBST([mkdir_p])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR capi4hylafax-svn/src/0000755000175000017500000000000010470310075014373 5ustar mastermastercapi4hylafax-svn/src/convert/0000755000175000017500000000000010470310066016053 5ustar mastermastercapi4hylafax-svn/src/convert/BasicFax.cpp0000644000175000017500000010004010470310066020232 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "BasicFax.h" #include "capi2def.h" #include "misc.h" #include "aFlags.h" #include "osImport.h" #include #include #include #include #include #include #include #include /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define FAX_FILTER_BUFFER_SIZE 1000 #define CAPI_BUFFER_SIZE CAPI_MAX_DATA_SIZE /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ void fmtTime (CDynamicString *pString, time_t t) { time_t v; char *fmt = "%u:%02u"; if (t < 0) { pString->Append ("0:00", 4); } else if (t > 99*60*60) { pString->Append ("??:??:??", 8); } else { v = t / 3600; if (v > 0) { pString->PrintAppend ("%u:", v); t -= v * 3600; fmt = "%02u:%02u"; } v = t / 60; t -= v * 60; pString->PrintAppend (fmt, v, t); } } /*===========================================================================*\ \*===========================================================================*/ CBasicFaxConversion::CBasicFaxConversion (void) : m_format (FaxFormat_Hylafax), m_pCurSendFile (0), m_pRecvString (0), m_PageCount (0), m_BaudRate (0), m_VResolution (0), m_finishedFaxFile (0), m_recvState (0), m_faxFileNr (0), m_FaxFileD (-1), m_RecvFile (-1), m_StartTime (0), m_ConnectStartTime (0), m_StartPageTime (0), m_StopTime (0) { dhead ("CBasicFaxConversion-Constructor", DCON_CBasicFaxConversion); } /*===========================================================================*\ \*===========================================================================*/ CBasicFaxConversion::~CBasicFaxConversion (void) { dhead ("CBasicFaxConversion-Destructor", DCON_CBasicFaxConversion); m_finishedFaxFile = 0; CloseSend(); CloseRecv(); } /*===========================================================================*\ \*===========================================================================*/ void CBasicFaxConversion::ConnectLog (cp_ncpi_all *pNCPI) { dhead ("CBasicFaxConversion::ConnectLog", DCON_CBasicFaxConversion); WriteLog (LOG_INFO, "Connection established.\n"); m_StartPageTime = m_ConnectStartTime = m_StopTime = time (0); if (pNCPI) { dassert (pNCPI->pReceiveID != 0); if (pNCPI->pReceiveID->GetLen()) { dassert (GetReceiveID() != 0); GetReceiveID()->Set (pNCPI->pReceiveID->GetData(), pNCPI->pReceiveID->GetLen()); WriteLog (LOG_INFO, "\tStationID = %s\n" , GetReceiveID()->GetPointer()); } if (pNCPI->Rate) { m_BaudRate = pNCPI->Rate; WriteLog (LOG_INFO, "\tBaudRate = %u\n", pNCPI->Rate); } // Didn't we request SFF? dassert (pNCPI->Format == 0); CDynamicString dsFlags; if (CheckOneFlag (pNCPI->Options, 0x0)) { dsFlags.Append ("HighRes, "); if (!m_VResolution) { m_VResolution = 196; } } else { if (!m_VResolution) { m_VResolution = 98; } //UseOnlyLowRes = vTrue; } if (CheckOneFlag (pNCPI->Options, 0x1)) { dsFlags.Append ("Polling, "); } if (CheckOneFlag (pNCPI->Options, 0x2)) { dsFlags.Append ("PollAfter, "); } if (CheckOneFlag (pNCPI->Options, 0xA)) { dsFlags.Append ("JPEG, "); } if (CheckOneFlag (pNCPI->Options, 0xB)) { dsFlags.Append ("JBIG, "); } if (CheckOneFlag (pNCPI->Options, 0xC)) { dsFlags.Append ("JBIG_progr, "); } if (CheckOneFlag (pNCPI->Options, 0xD)) { dsFlags.Append ("MR_compr, "); } if (CheckOneFlag (pNCPI->Options, 0xE)) { dsFlags.Append ("MMR_compr, "); } if (CheckOneFlag (pNCPI->Options, 0xF)) { dsFlags.Append ("No_ECM, "); } if (dsFlags.IsEmpty() == vFalse) { dassert (dsFlags.GetLen() > 2); dsFlags.CutLen (2); // delete last ", " WriteLog (LOG_INFO, "\tFlags = %s\n", dsFlags.GetPointer()); } } } /*===========================================================================*\ \*===========================================================================*/ void CBasicFaxConversion::WriteXferLog (const char *cmd, tUInt commid, tUChar *jobtag, tUInt *pJobid, char *devname, CDynamicString *pUser, CDynamicString *pDestination, char *statustext) { dhead ("CBasicFaxConversion::WriteXferLog", DCON_CBasicFaxConversion); dassert (cmd != 0); dassert (devname != 0); dassert (pDestination != 0); dassert (statustext != 0); if (GetFormat() != FaxFormat_Hylafax) { return; } char buf[80]; char *timestrf = "%D %H:%M"; strftime (buf, sizeof (buf), timestrf, localtime (&m_StartTime)); CDynamicString xferline (200); xferline.Print ("%s\t%s\t%09u\t%s", buf, cmd, commid, devname); if (pJobid) { xferline.PrintAppend ("\t%u\t\"", *pJobid); } else { xferline.Append ("\t\t\""); } if (jobtag) { for (; *jobtag != '\0'; jobtag++) { switch (*jobtag) { default: xferline.Append (jobtag, 1); break; case '\t': xferline.Append (" ", 1); break; case '\\': if (jobtag[1] != '"') { xferline.Append (jobtag, 1); break; } jobtag++; // no break case '"': xferline.Append ("\\\"", 2); break; } } } if (pUser) { xferline.PrintAppend ("\"\t%S", pUser); } else { xferline.Append ("\"\tfax", 5); } xferline.PrintAppend ("\t\"%S\"\t\"%S\"\t%u\t%d\t", pDestination, GetReceiveID(), FaxPropEncode (GetResolution(), GetBaudRate()), GetPageCount()); fmtTime (&xferline, GetStopTime() - GetStartTime()); xferline.Append ("\t", 1); fmtTime (&xferline, GetConnectionTime()); xferline.PrintAppend ("\t\"%s\"\n", statustext); if (xferline.ErrorDetected() == vTrue) { dwarning (0); WriteLog (LOG_ERR, "Memory error while generating xferfaxlog accounting record (dest=%s)!", pDestination->GetPointer()); } else { tSInt fd = open (HYLAFAX_XFERLOG, O_RDWR|O_CREAT|O_APPEND, 0644); if (fd < 0) { WriteLog (LOG_ERR, "Can't open xferfaxlog for new accounting record (dest=%s)!", pDestination->GetPointer()); } else { flock (fd, LOCK_EX); if ((tUInt)write (fd, xferline.GetPointer(), xferline.GetLen()) != xferline.GetLen()) { WriteLog (LOG_ERR, "Can't write xferfaxlog accounting record (dest=%s)!", pDestination->GetPointer()); } close (fd); } } } /*===========================================================================*\ \*===========================================================================*/ tSInfo CBasicFaxConversion::OpenSend (CMultiString *pSendFileList, tUInt Resolution) { dhead ("CBasicFaxConversion::OpenSend", DCON_CBasicFaxConversion); CloseSend(); m_pCurSendFile = pSendFileList->GetFirst(); m_VResolution = Resolution; m_finishedFaxFile = 0; m_PageCount = 0; m_StartTime = time (0); m_StartPageTime = m_StartTime; m_StopTime = m_StartTime; m_ConnectStartTime = 0; m_BaudRate = 0; char *ModeText = "SFF"; switch (m_format) { default: dassert (0); return iErr_Filter_OpenFailed; case FaxFormat_Hylafax: case FaxFormat_TIFF: if (m_sTifFilter.Open (m_pCurSendFile->GetPointer()) == vFalse) { WriteLog (LOG_ERR, "Can't open TIF-File %s!\n", m_pCurSendFile->GetPointer()); return iErr_File_NotExist; } if (m_sTifFilter.CheckForCorrectFaxFile() == vFalse) { WriteLog (LOG_ERR, "TIF-File %s doesn't look like a 1d G3 Fax!\n", m_pCurSendFile->GetPointer()); return iErr_File_OpenFailed; } Resolution = (m_VResolution) ? m_VResolution : (m_sTifFilter.GetYRes()) ? m_sTifFilter.GetYRes() : 196; if (m_sSffFilter.Open ((Resolution >= 196) ? 1 : 0, 0) == vFalse) { WriteLog (LOG_ERR, "Can't allocate memory for data conversion to the SFF format!\n"); return iErr_Filter_OpenFailed; } ModeText = "TIFF"; break; case FaxFormat_G3: if (!m_VResolution) { m_VResolution = Resolution = 196; } if (m_sSffFilter.Open ((Resolution >= 196) ? 1 : 0, 0) == vFalse) { WriteLog (LOG_ERR, "Can't allocate memory for data conversion to the SFF format!\n"); return iErr_Filter_OpenFailed; } ModeText = "G3"; // no break! case FaxFormat_SFF: m_FaxFileD = open ((char *)m_pCurSendFile->GetPointer(), O_RDONLY); if (m_FaxFileD < 0) { WriteLog (LOG_ERR, "Can't open File %s!\n", m_pCurSendFile->GetPointer()); m_sSffFilter.Close(); return iErr_File_NotExist; } break; } WriteLog (LOG_INFO, "Dial and starting transfer of %s-File %s with %s resolution.\n", ModeText, m_pCurSendFile->GetPointer(), (Resolution >= 196) ? "fine" : "normal"); m_pCurSendFile = m_pCurSendFile->GetNext(); return i_Okay; } /*===========================================================================*\ \*===========================================================================*/ void CBasicFaxConversion::StopSend (void) { dhead ("CBasicFaxConversion::StopSend", DCON_CBasicFaxConversion); m_finishedFaxFile = 2; } /*===========================================================================*\ \*===========================================================================*/ void CBasicFaxConversion::CloseSend (void) { dhead ("CBasicFaxConversion::CloseSend", DCON_CBasicFaxConversion); StopSend(); m_sTifFilter.Close(); m_sSffFilter.Close(); m_StopTime = time (0); if (m_ConnectStartTime == 0) { m_ConnectStartTime = m_StopTime; } if (m_FaxFileD >= 0) { close (m_FaxFileD); m_FaxFileD = -1; } } /*===========================================================================*\ \*===========================================================================*/ tSInfo CBasicFaxConversion::SendSFF (tUByte *buffer, tUInt maxLen, tUInt *pLen) { dhead ("CBasicFaxConversion::SendSFF", DCON_CBasicFaxConversion); dassert (pLen != 0); tSInfo fret = i_Okay; *pLen = 0; if (m_finishedFaxFile < 2) { if (m_format == FaxFormat_SFF) { *pLen = read (m_FaxFileD, buffer, maxLen); switch (*pLen) { case 0: m_finishedFaxFile = 2; break; case -1: WriteLog (LOG_ERR, "Failed to read data from file!\n"); *pLen = 0; break; } } else { fret = FillSffFilter(); if (m_sSffFilter.CurSize()) { *pLen = m_sSffFilter.Get (buffer, maxLen); } if ((m_finishedFaxFile == 1) && (m_sSffFilter.CurSize() == 0)) { m_finishedFaxFile = 2; } } //if ((UseOnlyLowRes == vTrue) && len) { //TODO: eliminate every second line on fine faxes //SffLowResFilter.Change (buffer, len); //} } RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ tSInfo CBasicFaxConversion::OpenRecv (void) { dhead ("CBasicFaxConversion::OpenRecv", DCON_CBasicFaxConversion); if ((m_format != FaxFormat_SFF) && (m_rSffFilter.Open (1) == vFalse)) { return iErr_Filter_OpenFailed; } m_recvState = (m_format == FaxFormat_G3) ? 2 : 1; m_ConnectStartTime = time (0); m_StartPageTime = m_ConnectStartTime; m_finishedFaxFile = 0; m_PageCount = 0; if (GetRecvFile() < 0) { m_RecvFileList.RemoveAndDeleteAll(); return iErr_Filter_OpenFailed; } if ( (m_format == FaxFormat_Hylafax) || (m_format == FaxFormat_TIFF)) { if (m_rTifFilter.Open (m_RecvFile, m_RecvFileList.GetFirst()->GetPointer()) == vFalse) { close (m_RecvFile); remove ((char *)m_RecvFileList.GetFirst()->GetPointer()); m_RecvFile = -1; m_RecvFileList.RemoveAndDeleteAll(); return iErr_Filter_OpenFailed; } // file descriptor is handled by libtiff now m_RecvFile = -1; } dassert (m_RecvFileList.GetLast() != 0); WriteLog (LOG_INFO, "Write fax in path %s to file %s.\n", GetSpoolDir()->GetPointer(), m_RecvFileList.GetFirst()->GetPointer()); m_recvState = (m_format == FaxFormat_G3) ? 2 : 1; return i_Okay; } /*===========================================================================*\ \*===========================================================================*/ void CBasicFaxConversion::StopRecv (void) { dhead ("CBasicFaxConversion::StopRecv", DCON_CBasicFaxConversion); m_finishedFaxFile = 2; } /*===========================================================================*\ \*===========================================================================*/ void CBasicFaxConversion::CloseRecv (void) { dhead ("CBasicFaxConversion::CloseRecv", DCON_CBasicFaxConversion); StopRecv(); m_rTifFilter.Close(); m_rSffFilter.Close(); if (m_RecvFile >= 0) { close (m_RecvFile); } m_RecvFile = -1; m_StopTime = time (0); if (m_ConnectStartTime == 0) { m_ConnectStartTime = m_StopTime; } } /*===========================================================================*\ \*===========================================================================*/ tSInfo CBasicFaxConversion::RecvSFF (tUByte *buffer, tUInt len) { dhead ("CBasicFaxConversion::RecvSFF", DCON_CBasicFaxConversion); if (m_finishedFaxFile >= 2) { dwarning (0); return i_Okay; } if (m_format == FaxFormat_SFF) { write (m_RecvFile, buffer, len); return i_Okay; } tSInfo fret = i_Okay; do { switch (m_recvState) { default: return i_Okay; case 1: { CSFilter_Sff2Huf::ctPageInfo PageInfo; for (; len > 0; len--, buffer++) { if (m_rSffFilter.PutChar (*buffer) == CSFilter_Sff2Huf::i_QueueFull) { dwarning (0); WriteLog (LOG_WARNING, "CFaxReceive::GetData: Overflow in SffFilter.\n"); break; } } if ((m_recvState == 1) && (m_rSffFilter.GetCurPageInfo (&PageInfo) == vTrue)) { tChar hostname[MAX_STRING_SIZE]; gethostname ((char *)hostname, MAX_STRING_SIZE); m_VResolution = PageInfo.ResolutionVertical ? 196 : 98; m_rTifFilter.PutPageHeader (m_VResolution, 203, PageInfo.PageLength ? PageInfo.PageLength - 1 : 0, PageInfo.LineLength, FaxPropEncode (m_VResolution, m_BaudRate), GetReceiveID()->GetPointer(), (tUChar *)"AVM GmbH", (tUChar *)NAME_OF_MODEL, hostname, (tUChar *)NAME_OF_SOFTWARE); m_recvState = 2; } } case 2: { for (; len > 0; len--, buffer++) { if (m_rSffFilter.PutChar (*buffer) == CSFilter_Sff2Huf::i_QueueFull) { dwarning (0); WriteLog (LOG_WARNING, "CFaxReceive::GetData: Overflow in SffFilter.\n"); break; } } break; } } CSFilter_Sff2Huf::ctInfo info; tUInt tmplen; tUChar tmpbuf[1000]; do { tmplen = m_rSffFilter.GetToPageEnd (tmpbuf, 1000, &info); if (m_format == FaxFormat_G3) { write (m_RecvFile, tmpbuf, tmplen); switch (info) { case CSFilter_Sff2Huf::i_NewPage: m_PageCount++; WriteLog (LOG_INFO, "Page %d was received.\n", m_PageCount); if (GetNextRecvFile() < 0) { WriteLog (LOG_ERR, "Can't create new file for next fax page! Disconnect now.\n"); // TODO: How to handle this? Set quitRecv? m_recvState = 3; tmplen = 0; // stop both loops len = 0; fret = iErr_File_CreateFailed; } break; case CSFilter_Sff2Huf::i_LastPage: m_PageCount++; close (m_RecvFile); WriteLog (LOG_INFO, "Page %d was received. Last Page!\n", m_PageCount); m_RecvFile = -1; m_recvState = 3; tmplen = 0; // stop both loops len = 0; break; default: // nothing to do break; } } else { if (tmplen) { m_rTifFilter.Put (tmpbuf, tmplen); } switch (info) { case CSFilter_Sff2Huf::i_NewPage: { CSFilter_Sff2Huf::ctPageInfo PageInfo; m_rSffFilter.GetLastPageInfo (&PageInfo); time_t t = time (0); m_rTifFilter.PutPageEnd (vFalse, PageInfo.PageLength ? PageInfo.PageLength - 1 : 0, t - m_StartPageTime); m_StartPageTime = t; m_rSffFilter.GetCurPageInfo (&PageInfo); m_PageCount++; WriteLog (LOG_INFO, "Page %d was received.\n", m_PageCount); PageEndReached (vFalse); m_VResolution = PageInfo.ResolutionVertical ? 196 : 98; m_rTifFilter.PutPageHeader (m_VResolution, 203, PageInfo.PageLength ? PageInfo.PageLength - 1 : 0, PageInfo.LineLength, 0, 0, 0, 0, 0, 0); tmplen = 1; // to continue the inner loop break; } case CSFilter_Sff2Huf::i_LastPage: { m_PageCount++; WriteLog (LOG_INFO, "Page %d was received. - Last Page!\n", m_PageCount); PageEndReached (vTrue); CSFilter_Sff2Huf::ctPageInfo PageInfo; m_rSffFilter.GetLastPageInfo (&PageInfo); m_StopTime = time (0); m_rTifFilter.PutPageEnd (vTrue, PageInfo.PageLength ? PageInfo.PageLength - 1 : 0, m_StopTime - m_StartPageTime); m_recvState = 3; tmplen = 0; // stop both loops len = 0; break; } default: // nothing to do break; } } } while (tmplen); } while (len); RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ CMultiString *CBasicFaxConversion::GetRecvFiles (void) { return &m_RecvFileList; } /*===========================================================================*\ \*===========================================================================*/ tSInfo CBasicFaxConversion::FillSffFilter (void) { dhead ("CBasicFaxConversion::FillSffFilter", DCON_CBasicFaxConversion); tSInfo info; tUChar buffer[FAX_FILTER_BUFFER_SIZE]; tUInt len; tSInfo fret = i_Okay; if (m_finishedFaxFile > 0) { return fret; } while (m_sSffFilter.CurSize() < CAPI_BUFFER_SIZE) { if (m_format == FaxFormat_G3) { len = read (m_FaxFileD, buffer, FAX_FILTER_BUFFER_SIZE); switch (len) { case 0: info = iWrn_Filter_LastPageEnd; break; case -1: len = 0; WriteLog (LOG_ERR, "Failed to read data from file!\n"); // TODO: Handle errors // no break! default: info = i_Okay; break; } } else { len = m_sTifFilter.GetToPageEnd (buffer, FAX_FILTER_BUFFER_SIZE, &info); } for (tUInt i = 0; i < len; i++) { m_sSffFilter.PutChar (buffer[i]); } switch (info) { case iWrn_Filter_PageEnd: m_PageCount++; m_sSffFilter.PutPageHeader (vFalse); WriteLog (LOG_INFO, "Page %d was sent.\n", m_PageCount); break; case iWrn_Filter_LastPageEnd: { tBool isFinish = vTrue; m_sTifFilter.Close(); m_PageCount++; if (m_pCurSendFile) { dassert (m_pCurSendFile->IsEmpty() == vFalse); dprint ("FileName=%s ", m_pCurSendFile->GetPointer()); if (m_format == FaxFormat_G3) { close (m_FaxFileD); m_FaxFileD = open ((char *)m_pCurSendFile->GetPointer(), O_RDONLY); if (m_FaxFileD >= 0) { WriteLog (LOG_INFO, "Start transfer of G3-File %s.\n", m_pCurSendFile->GetPointer()); m_pCurSendFile = m_pCurSendFile->GetNext(); isFinish = vFalse; } else { WriteLog (LOG_ERR, "Can't open next G3-File %s!\n", m_pCurSendFile->GetPointer()); fret = iErr_File_NotExist; } } else if (m_sTifFilter.Open (m_pCurSendFile->GetPointer()) == vTrue) { if (m_sTifFilter.CheckForCorrectFaxFile() == vFalse) { WriteLog (LOG_ERR, "TIF-File %s doesn't look like a G3 Fax!\n", m_pCurSendFile->GetPointer()); fret = iErr_File_OpenFailed; } else { WriteLog (LOG_INFO, "Page %d was sent.\n", m_PageCount); tUInt Resolution = (m_VResolution) ? m_VResolution : (m_sTifFilter.GetYRes()) ? m_sTifFilter.GetYRes() : 196; m_sSffFilter.SetVRes ((Resolution >= 196) ? 1 : 0); WriteLog (LOG_INFO, "Start transfer of TIFF-File %s with %s resolution.\n", m_pCurSendFile->GetPointer(), (Resolution >= 196) ? "fine" : "normal"); isFinish = vFalse; } } else { WriteLog (LOG_ERR, "Can't open TIFF-File %s.\n", m_pCurSendFile->GetPointer()); fret = iErr_File_NotExist; } m_pCurSendFile = m_pCurSendFile->GetNext(); } m_sSffFilter.PutPageHeader (isFinish); dprint ("i_LastPageEnd-Recv (isFinish=%x) ", isFinish); if (isFinish == vTrue) { if (m_format != FaxFormat_G3) { WriteLog (LOG_INFO, "Page %d was sent. - Last Page!\n", m_PageCount); } m_finishedFaxFile++; return fret; } break; } case 0: break; default: dassert (0); // TODO: handle errors! break; } } return fret; } /*===========================================================================*\ \*===========================================================================*/ tSInt CBasicFaxConversion::GetRecvFile (void) { dhead ("CBasicFaxConversion::GetRecvFile", DCON_CFaxReceive); dassert (m_RecvFile == -1); tUInt tmpfaxFileNr = 1; tSInt tmpFileD = -1; tSInt SeqFile = -1; CDynamicString NewNameFormat; CDynamicString fline; CDynamicString NewName (MAX_STRING_SIZE); m_RecvFileList.RemoveAndDeleteAll(); m_RecvFile = -1; if (m_format == FaxFormat_Hylafax) { NewNameFormat.Set (HYLAFAX_RECV_DIR); fline.Set (&NewNameFormat); } fline.Append (HYLAFAX_SEQF_FILE); if (NewName.ErrorDetected() || NewNameFormat.ErrorDetected() || fline.ErrorDetected()) { WriteLog (LOG_ERR, "Not enough memory for generating file names\n"); return m_RecvFile; } SeqFile = open ((char *)fline.GetPointer(), O_CREAT | O_RDWR, 0644); if (SeqFile >= 0) { flock (SeqFile, LOCK_EX); char dummybuf [MAX_STRING_SIZE]; tSInt len = read (SeqFile, dummybuf, MAX_STRING_SIZE); dummybuf[(len < 0) ? 0 : len] = '\0'; tmpfaxFileNr = atoi (dummybuf) + 1; } if (m_format == FaxFormat_Hylafax) { NewNameFormat.PrintAppend ("fax%%09u" FILE_EXTENSION_TIFF); } else { NewNameFormat.PrintAppend ("cf%c%%07u", (m_VResolution > 98) ? 'f' : 'n'); if (GetReceiveID()->IsEmpty() == vFalse) { dassert (GetReceiveID()->GetPointer() != 0); NewNameFormat.PrintAppend ("-%S", GetReceiveID()); } switch (m_format) { case FaxFormat_TIFF: NewNameFormat.Append (FILE_EXTENSION_TIFF); break; case FaxFormat_SFF: NewNameFormat.Append (FILE_EXTENSION_SFF); break; case FaxFormat_G3: NewNameFormat.Append (".01" FILE_EXTENSION_G3); break; default: // nothing to do break; } } // One Test to see if we have enough space NewName.Print ((char *)NewNameFormat.GetPointer(), 1234567890); if (NewNameFormat.ErrorDetected() || NewName.ErrorDetected()) { WriteLog (LOG_ERR, "Not enough memory for generating file names\n"); return m_RecvFile; } for (tUInt trys = MAX_TRY_COUNT; trys > 0; trys--, tmpfaxFileNr++) { if (tmpfaxFileNr < 1 || tmpfaxFileNr > MAX_SEQ_NUMBER) { tmpfaxFileNr = 1; } NewName.Print ((char *)NewNameFormat.GetPointer(), tmpfaxFileNr); tmpFileD = open ((char *)NewName.GetPointer(), O_RDWR | O_CREAT | O_EXCL, GetRecvFileMode()); dprint ("try(%s,%u,%d) ", NewName.GetPointer(), NewName.GetLen(), tmpFileD); if (tmpFileD >= 0) { flock (tmpFileD, LOCK_EX | LOCK_NB); COneMultiString *NewLE = new COneMultiString; if (!NewLE || (NewLE->Set (&NewName) == vFalse)) { close (tmpFileD); break; } m_RecvFileList.AddLast (NewLE); m_faxFileNr = tmpfaxFileNr; m_RecvFile = tmpFileD; if (SeqFile >= 0) { fline.Print ("%u", m_faxFileNr); lseek (SeqFile, 0, SEEK_SET); write (SeqFile, fline.GetPointer(), fline.GetLen()); ftruncate (SeqFile, fline.GetLen()); } break; } if (errno != EEXIST) { if (GetSpoolDir() && !GetSpoolDir()->IsEmpty()) { NewName.Set (GetSpoolDir()); } else { NewName.Set ("."); } if (m_format == FaxFormat_Hylafax) { NewName.Append ("/"); NewName.Append (HYLAFAX_RECV_DIR); } WriteLog (LOG_ERR, "It is not possible to create a File in Directiory %s.\n", NewName.GetPointer()); break; } } if (SeqFile >= 0) { close (SeqFile); } return m_RecvFile; } /*===========================================================================*\ \*===========================================================================*/ tSInt CBasicFaxConversion::GetNextRecvFile (void) { dhead ("CBasicFaxConversion::GetNextRecvFile", DCON_CFaxReceive); dassert (m_format == FaxFormat_G3); dassert (m_faxFileNr > 0); dassert (m_RecvFileList.IsEmpty() == vFalse); tSInt tmpFileD = -1; CDynamicString NewNameFormat; CDynamicString NewName (MAX_STRING_SIZE); if (m_RecvFile >= 0) { close (m_RecvFile); m_RecvFile = -1; } if (m_format == FaxFormat_Hylafax) { NewNameFormat.Set (HYLAFAX_RECV_DIR); } //sprintf (NewNameFormat + strlen (NewNameFormat), "cf%c%07u", (VResolution) ? 'f' : 'n', m_faxFileNr); NewNameFormat.PrintAppend ("cf%07u", m_faxFileNr); if (GetReceiveID()->IsEmpty() == vFalse) { dassert (GetReceiveID()->GetPointer() != 0); NewNameFormat.Append ("-"); NewNameFormat.Append (GetReceiveID()); } NewNameFormat.Append (".%02u"); NewNameFormat.Append (FILE_EXTENSION_G3); // TODO?: can we try to open only the first specified file? // One Test to see if we have enough space NewName.Print ((char *)NewNameFormat.GetPointer(), 1234567890); if (NewNameFormat.ErrorDetected() || NewName.ErrorDetected()) { WriteLog (LOG_ERR, "Not enough memory for generating file names\n"); return m_RecvFile; } for (tUInt nr = m_PageCount + 1; nr < m_PageCount + MAX_TRY_COUNT; nr++) { NewName.Print ((char *)NewNameFormat.GetPointer(), nr); tmpFileD = open ((char *)NewName.GetPointer(), O_RDWR | O_CREAT | O_EXCL, GetRecvFileMode()); if (tmpFileD >= 0) { flock (tmpFileD, LOCK_EX | LOCK_NB); COneMultiString *NewLE = new COneMultiString; if (!NewLE || (NewLE->Set (&NewName) == vFalse)) { close (tmpFileD); break; } m_RecvFileList.AddLast (NewLE); m_RecvFile = tmpFileD; WriteLog (LOG_INFO, "File for next fax page is %s.\n", NewName.GetPointer()); break; } if (errno != EEXIST) { if (GetSpoolDir() && !GetSpoolDir()->IsEmpty()) { NewName.Set (GetSpoolDir()); } else { NewName.Set ("."); } if (m_format == FaxFormat_Hylafax) { NewName.Append ("/"); NewName.Append (HYLAFAX_RECV_DIR); } WriteLog (LOG_ERR, "It is not possible to create a File in Directiory %s.\n", NewName.GetPointer()); break; } } return m_RecvFile; } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/convert/Makefile.in0000644000175000017500000003333510470310066020127 0ustar mastermaster# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/convert DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libconvert_a_AR = $(AR) $(ARFLAGS) libconvert_a_LIBADD = am_libconvert_a_OBJECTS = BasicFax.$(OBJEXT) ftif2huf.$(OBJEXT) \ huf2ftif.$(OBJEXT) huf2sff.$(OBJEXT) sff2huf.$(OBJEXT) libconvert_a_OBJECTS = $(am_libconvert_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) depcomp = $(SHELL) $(top_srcdir)/src/scripts/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libconvert_a_SOURCES) DIST_SOURCES = $(libconvert_a_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) INSTALL = @INSTALL@ ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ hylafaxbindir = @hylafaxbindir@ hylafaxspooldir = @hylafaxspooldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign CLEANFILES = *~ comperr MAINTAINERCLEANFILES = Makefile.in INCLUDES = -I$(srcdir)/../standard -I$(srcdir)/../linuxdep -I$(srcdir)/../capi -I$(srcdir)/.. noinst_HEADERS = BasicFax.h ftif2huf.h huf2ftif.h huf2sff.h hufman.h osImport.h revbyte.h sff2huf.h noinst_LIBRARIES = libconvert.a libconvert_a_SOURCES = BasicFax.cpp ftif2huf.cpp huf2ftif.cpp huf2sff.cpp sff2huf.cpp all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/convert/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/convert/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libconvert.a: $(libconvert_a_OBJECTS) $(libconvert_a_DEPENDENCIES) -rm -f libconvert.a $(libconvert_a_AR) libconvert.a $(libconvert_a_OBJECTS) $(libconvert_a_LIBADD) $(RANLIB) libconvert.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BasicFax.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftif2huf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/huf2ftif.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/huf2sff.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sff2huf.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am test: test.cpp libconvert.a $(CXX) $(CXXFLAGS) -O0 -I../standard -o test $< libconvert.a -ltiff # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: capi4hylafax-svn/src/convert/osImport.h0000644000175000017500000000270610470310066020045 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _OSIMPORT_H_ #define _OSIMPORT_H_ #include "DbgInfo.h" /*===========================================================================*\ \*===========================================================================*/ extern tUInt DCON_CFaxSend; extern tUInt DCON_CFaxReceive; extern tUInt DCON_CFaxReceiveDevice; extern tUInt DCON_CFaxReceiveMain; extern tUInt DCON_SffFilter; extern tUInt DCON_TifFilter; extern tUInt DCON_CBasicFaxConversion; /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/convert/ftif2huf.h0000644000175000017500000000530610470310066017745 0ustar mastermaster/*---------------------------------------------------------------------------*\ * Copyright (C) 2000 AVM GmbH. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY, without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT * ANY LIABILITY FOR ANY DAMAGES arising out of or in connection * with the use or performance of this software. See the * GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _FTIF2HUF_H_ #define _FTIF2HUF_H_ #include #include "InfoType.h" /*---------------------------------------------------------------------------*\ tSInfo - Values \*---------------------------------------------------------------------------*/ #define iWrn_Filter_PageEnd CalculateInfoValue (infoType_Filter, infoKind_Warning, 1) #define iWrn_Filter_LastPageEnd CalculateInfoValue (infoType_Filter, infoKind_Warning, 2) #define iErr_Filter_OpenFailed CalculateInfoValue (infoType_Filter, infoKind_Error, 1) /*===========================================================================*\ \*===========================================================================*/ class CSFilter_fTif2Huf { public: CSFilter_fTif2Huf (void); virtual ~CSFilter_fTif2Huf (void); tBool Open (tUChar *TifFileName); void Close (void); tBool CheckForCorrectFaxFile (void); tUInt GetToPageEnd (tUByte *buffer, tUInt maxLen, tSInfo *pInfo); tUInt GetStrip (tUByte *buffer, tUInt maxLen, tSInfo *pInfo); tUInt GetYRes (void); tUInt CurStripSize (void); private: void SetPageInfo (void); TIFF *hTiff; tUInt YResolution; const tUChar *BitRevField; tUInt *StripCountField; tUInt nStrips; tSInt curStrip; tUChar *stripBuf; tUInt stripBufMaxLen; tUInt stripBufLen; tUInt stripBufOff; }; /*===========================================================================*\ \*===========================================================================*/ inline tUInt CSFilter_fTif2Huf::GetYRes (void) { return (hTiff) ? YResolution : 0; } inline tUInt CSFilter_fTif2Huf::CurStripSize (void) { return stripBufLen - stripBufOff; } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/convert/huf2ftif.h0000644000175000017500000000360210470310066017742 0ustar mastermaster/*---------------------------------------------------------------------------*\ * Copyright (C) 2000 AVM GmbH. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY, without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT * ANY LIABILITY FOR ANY DAMAGES arising out of or in connection * with the use or performance of this software. See the * GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _HUF2FTIF_H_ #define _HUF2FTIF_H_ #include #include "aTypes.h" /*===========================================================================*\ \*===========================================================================*/ class CSFilter_Huf2fTif { public: CSFilter_Huf2fTif (void); virtual ~CSFilter_Huf2fTif (void); // info: the class ALWAYS closes the file descriptor fdTifFile tBool Open (int fdTifFile, tUChar *TifFileName); void Close (void); tBool Put (tUChar *buffer, tUInt len); tBool PutPageHeader (tUInt yRes, tUInt xRes, tUInt length, tUInt width, tUInt recvparams, tUChar *description, tUChar *manufact, tUChar *model, tUChar *hostname, tUChar *software); void PutPageEnd (tBool LastPage, tUInt length = 0, tUInt duration = 0); private: TIFF *hTiff; tUShort countPage; }; /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/convert/huf2sff.cpp0000644000175000017500000002747310470310066020137 0ustar mastermaster/*---------------------------------------------------------------------------*\ * Copyright (C) 2000 AVM GmbH. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY, without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT * ANY LIABILITY FOR ANY DAMAGES arising out of or in connection * with the use or performance of this software. See the * GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include #include "huf2sff.h" #include "hufman.h" #include "osImport.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define HUF_END_OF_LINE_CHAR_SIZE 2 #define HUF_END_OF_PAGE_CHAR_SIZE 2 #define HUF_EMPTY_LINE_CHAR_SIZE 4 #define HUFF_SFF_ADD_TO_PUT_IN 4 #define STANDARD_VER_RES 0 /* 98 lpi Standard */ #define FEIN_VER_RES 1 /* 196 lpi Fein */ #define HOCHFEIN_VER_RES 2 /* 392 lpi Hochfein */ #define STANDARD_HOR_RES 0 /* 203 dpi Standard */ #define MH_CODING 0 #define SFF 0x66666653 typedef struct ff { unsigned int Kennung; unsigned char Version; unsigned char reserved; unsigned short userInfo; unsigned short numPages; unsigned short firstPage; unsigned int lastPage; unsigned int fileSize; unsigned char ID[8]; } SFF_HEADER; typedef struct ssf_page { unsigned char vert_res; unsigned char horiz_res; unsigned char coding; unsigned char specials; unsigned short xsize; unsigned short ysize; unsigned int prevPage; unsigned int nextPage; } SFF_PAGE; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define MODULO (QUEUESIZE-1) #define FSIZE (( QUEUESIZE*3) / 4) #define SUCC(x) (((x)+1)& MODULO ) #define LEER(q) ( (q)->Qread == (q)->Qwrite ) #define VOLL(q) (SUCC((q)->Qwrite)==((q)->Qread)) #define FILL(q) (((q)->Qwrite + QUEUESIZE - (q)->Qread ) & MODULO ) #define FREE(q) (MODULO - FILL(q)) /*===========================================================================*\ \*===========================================================================*/ CSFilter_Huf2Sff::CSFilter_Huf2Sff (void) { dhead ("CSFilter_Huf2Sff - Constructor", DCON_SffFilter); } /*===========================================================================*\ \*===========================================================================*/ CSFilter_Huf2Sff::~CSFilter_Huf2Sff (void) { dhead ("CSFilter_Huf2Sff - Destructor", DCON_SffFilter); } /*===========================================================================*\ \*===========================================================================*/ tBool CSFilter_Huf2Sff::Open (tUInt vRes, tUInt /*DataBitOrder*/) { dhead ("CSFilter_Huf2Sff::Open", DCON_SffFilter); SFF_HEADER header; int len; memset (&txHuf, 0, sizeof(TXHUF)); txHuf.lineValid = 0; txHuf.default_v_res = vRes; HUFMANinit(); len = sizeof (SFF_HEADER); memset ((char *) &header, 0, len); header.Kennung = SFF; header.Version = 1; header.numPages = 0; /* Weisnix erst am Ende */ header.firstPage = (unsigned short) len; header.lastPage = 0; /* Weisnix erst am Ende */ header.fileSize = 0; /* Weisnix erst am Ende */ memcpy (header.ID, "(c) AVM ", 8); HUFenq ((unsigned char *)&header, len); return vTrue; } /*===========================================================================*\ \*===========================================================================*/ void CSFilter_Huf2Sff::Close (void) { dhead ("CSFilter_Huf2Sff::Close", DCON_SffFilter); memset (&txHuf, 0, sizeof(TXHUF)); } /*===========================================================================*\ \*===========================================================================*/ void CSFilter_Huf2Sff::PutPageHeader (tBool lastPage) { dhead ("CSFilter_Huf2Sff::PutPageHeader", DCON_SffFilter); SFF_PAGE sp; int len; len = sizeof (SFF_PAGE); HUFenq1 (254); HUFenq1 (lastPage ? 0 : len); if (lastPage) { return; } /*---------------------------------------------------------------------*/ memset ((char *)&sp, 0, len); sp.vert_res = (unsigned char) txHuf.default_v_res; // STANDARD_VER_RES; sp.horiz_res = STANDARD_HOR_RES; sp.coding = MH_CODING; sp.xsize = 1728; HUFenq ((unsigned char *)&sp, len); } /*===========================================================================*\ \*===========================================================================*/ void CSFilter_Huf2Sff::PutChar (tUChar ch) { dhead ("CSFilter_Huf2Sff::PutChar", Dbg_Level_Infos); //DCON_SffFilter); /*---------------------------------------------------------------------*/ //if (txHuf.inESCAPE) { // txHuf.inESCAPE = 0; // switch (ch) { // case 0x10 : /* DLE DLE -> DLE senden */ // break; // case 0x03 : /* DLE 03 -> End of Page */ // txHuf.lineValid = 0; // txHuf.EOP = 1; // return; // case 0x12 : /* DLE DLE -> DLE DLE senden */ // break; // default : // break; // } //} else if (ch == 0x10) { // txHuf.inESCAPE = 1; // return; //} /*---------------------------------------------------------------------*/ HUFtstBit (ch & 0x01); HUFtstBit (ch & 0x02); HUFtstBit (ch & 0x04); HUFtstBit (ch & 0x08); HUFtstBit (ch & 0x10); HUFtstBit (ch & 0x20); HUFtstBit (ch & 0x40); HUFtstBit (ch & 0x80); } /*===========================================================================*\ \*===========================================================================*/ tUInt CSFilter_Huf2Sff::Get (tUChar *buffer, tUInt maxLen) { dhead ("CSFilter_Huf2Sff::Get", DCON_SffFilter); int len1; int len2; DATA_QUEUE *q = &txHuf.dq; int i = FILL (q); if (maxLen > (tUInt)i) { maxLen = i; } if (!maxLen) { return 0; } len1 = q->Qread + maxLen > QUEUESIZE ? QUEUESIZE - q->Qread : maxLen; len2 = maxLen - len1; if (maxLen <= 0 || len1 <= 0 || len2 < 0 || maxLen > QUEUESIZE) { return 0; } memcpy (buffer, q->Qdata + q->Qread, len1); q->Qread = ( q->Qread + len1 ) & MODULO; if (len2) { memcpy (buffer + len1, q->Qdata + q->Qread, len2); q->Qread = (q->Qread + len2) & MODULO; } RETURN ('x', maxLen); } /*===========================================================================*\ \*===========================================================================*/ tUInt CSFilter_Huf2Sff::CurSize (void) { dhead ("CSFilter_Huf2Sff::CurSize", DCON_SffFilter); RETURN ('x', FILL (&txHuf.dq)); } /*===========================================================================*\ \*===========================================================================*/ tBool CSFilter_Huf2Sff::IsEOP (void) { dhead ("CSFilter_Huf2Sff::IsEOP", DCON_SffFilter); if (txHuf.EOP) { txHuf.EOP = 0; RETURN ('x', vTrue); } RETURN ('x', vFalse); } /*===========================================================================*\ \*===========================================================================*/ void CSFilter_Huf2Sff::HUFMANinit (void) { dhead ("CSFilter_Huf2Sff::HUFMANinit", Dbg_Level_Infos); //DCON_SffFilter); txHuf.curInd = txHuf.numBytes = txHuf.run0 = txHuf.run1 = txHuf.EOLfound = txHuf.EOLcount0 = txHuf.outByte = txHuf.outBits = 0; txHuf.curNode = WhiteHUFS; txHuf.white = 1; } /*===========================================================================*\ \*===========================================================================*/ int CSFilter_Huf2Sff::HUFenq (unsigned char *buff, int len) { dhead ("CSFilter_Huf2Sff::HUFenq", Dbg_Level_Infos); //DCON_SffFilter); DATA_QUEUE *q = &txHuf.dq; int free, len1, len2; free = FREE (q); if (len > free) { len = free; } if (!len) { return 0; } len1 = q->Qwrite + len > QUEUESIZE ? QUEUESIZE - q->Qwrite : len; len2 = len - len1; if (len <= 0 || len1 <= 0 || len2 < 0 || len > QUEUESIZE) { return 0; } memcpy (q->Qdata + q->Qwrite, buff, len1); q->Qwrite = (q->Qwrite + len1) & MODULO; if (len2) { memcpy( q->Qdata + q->Qwrite, buff + len1, len2 ); q->Qwrite = (q->Qwrite + len2) & MODULO; } return len ; } /*===========================================================================*\ \*===========================================================================*/ int CSFilter_Huf2Sff::HUFenq1 (int val) { dhead ("CSFilter_Huf2Sff::HUFenq1", Dbg_Level_Infos); //DCON_SffFilter); DATA_QUEUE *q = &txHuf.dq; if (VOLL (q)) { return 0; } q->Qdata [q->Qwrite] = (unsigned char) val; q->Qwrite = SUCC (q->Qwrite); return 1; } /*=====================================================================*\ \*=====================================================================*/ void CSFilter_Huf2Sff::HUFtstBit (int bit) { dhead ("CSFilter_Huf2Sff::HUFtstBit", Dbg_Level_Infos); //DCON_SffFilter); int huf; int len; bit = bit ? 1 : 0; if (!txHuf.EOLfound && txHuf.lineValid) { txHuf.outByte = ( txHuf.outByte >> 1 ); if (bit) { txHuf.outByte |= 0x80; } txHuf.outBits++; if (txHuf.outBits >= 8) { txHuf.AuxBuff[txHuf.numBytes++] = (unsigned char)txHuf.outByte; txHuf.outByte = txHuf.outBits = 0; } txHuf.curInd = txHuf.curNode[txHuf.curInd].next[bit]; if ((huf = txHuf.curNode[txHuf.curInd].token) >= 0) { if (huf == EOL) { txHuf.EOLfound = 1; len = txHuf.numBytes; if (len > 216) { HUFenq1 (0x00); HUFenq1 (len & 0x0ff); HUFenq1 (len >> 8 ); } else { HUFenq1 (len); } HUFenq (txHuf.AuxBuff, len); } else { txHuf.run1 += huf; if (!txHuf.white && huf) { txHuf.EmptyLine = 0; } if (huf < TCLIM) { txHuf.white = !txHuf.white; txHuf.run0 = txHuf.run1; } txHuf.curNode = txHuf.white ? WhiteHUFS : BlackHUFS; txHuf.curInd = 0; } } } /*---------------------------------------------------------------------*/ if (bit) { if (txHuf.EOLcount0 >= 11) { if (!txHuf.lineValid) { txHuf.lineValid = 1; txHuf.EOP = 0; PutPageHeader(0); } HUFMANinit(); } txHuf.EOLcount0 = 0; } else { txHuf.EOLcount0++; } } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/convert/hufman.h0000644000175000017500000003167110470310066017512 0ustar mastermaster/*---------------------------------------------------------------------------*\ * Copyright (C) 2000 AVM GmbH. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY, without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT * ANY LIABILITY FOR ANY DAMAGES arising out of or in connection * with the use or performance of this software. See the * GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _HUFMAN_H_ #define _HUFMAN_H_ /*=====================================================================*\ Hufman tabels according to T30 \*=====================================================================*/ #define EOL 9999 #define TCLIM 64 /*---------------------------------------------------------------------*/ extern INODE WhiteHUFS[]; INODE WhiteHUFS[] = { { -1, { 1, 5 } }, { -1, { 21, 2 } }, { -1, { 25, 3 } }, { -1, { 50, 4 } }, { 2, { 0, 0 } }, { -1, { 6, 11 } }, { -1, { 7, 9 } }, { -1, { 8, 17 } }, { 3, { 0, 0 } }, { -1, { 19, 10 } }, { 4, { 0, 0 } }, { -1, { 12, 14 } }, { -1, { 13, 28 } }, { 5, { 0, 0 } }, { -1, { 15, 16 } }, { 6, { 0, 0 } }, { 7, { 0, 0 } }, { -1, { 30, 18 } }, { 8, { 0, 0 } }, { -1, { 20, 44 } }, { 9, { 0, 0 } }, { -1, { 31, 22 } }, { -1, { 35, 23 } }, { -1, { 78, 24 } }, { 10, { 0, 0 } }, { -1, { 26, 47 } }, { -1, { 27, 53 } }, { 11, { 0, 0 } }, { -1, { 41, 29 } }, { 64, { 0, 0 } }, { 128, { 0, 0 } }, { -1, { 38, 32 } }, { -1, { 58, 33 } }, { -1, { 56, 34 } }, { 1, { 0, 0 } }, { -1, { 36, 61 } }, { -1, { 37, 74 } }, { 12, { 0, 0 } }, { -1, { 64, 39 } }, { -1, { 67, 40 } }, { 13, { 0, 0 } }, { -1, { 42, 43 } }, { 14, { 0, 0 } }, { 15, { 0, 0 } }, { -1, { 45, 46 } }, { 16, { 0, 0 } }, { 17, { 0, 0 } }, { -1, { 69, 48 } }, { -1, { 129, 49 } }, { 192, { 0, 0 } }, { -1, { 51, 81 } }, { -1, { 52, 146 } }, { 1664, { 0, 0 } }, { -1, { 76, 54 } }, { -1, { 175, 55 } }, { 18, { 0, 0 } }, { -1, { 57, 91 } }, { 19, { 0, 0 } }, { -1, { 59, 97 } }, { -1, { 60, 94 } }, { 20, { 0, 0 } }, { -1, { 104, 62 } }, { -1, { 111, 63 } }, { 21, { 0, 0 } }, { -1, { 87, 65 } }, { -1, { 114, 66 } }, { 22, { 0, 0 } }, { -1, { 68, 117 } }, { 23, { 0, 0 } }, { -1, { 70, 72 } }, { -1, { 71, 120 } }, { 24, { 0, 0 } }, { -1, { 123, 73 } }, { 25, { 0, 0 } }, { -1, { 126, 75 } }, { 26, { 0, 0 } }, { -1, { 77, 136 } }, { 27, { 0, 0 } }, { -1, { 79, 84 } }, { -1, { 80, 139 } }, { 28, { 0, 0 } }, { -1, { 150, 82 } }, { -1, { 168, 83 } }, { 256, { 0, 0 } }, { -1, { 85, 143 } }, { -1, { 142, 86 } }, { 0, { 0, 0 } }, { -1, { 182, 88 } }, { -1, { 89, 90 } }, { 29, { 0, 0 } }, { 30, { 0, 0 } }, { -1, { 92, 93 } }, { 31, { 0, 0 } }, { 32, { 0, 0 } }, { -1, { 95, 96 } }, { 33, { 0, 0 } }, { 34, { 0, 0 } }, { -1, { 98, 101 } }, { -1, { 99, 100 } }, { 35, { 0, 0 } }, { 36, { 0, 0 } }, { -1, { 102, 103 } }, { 37, { 0, 0 } }, { 38, { 0, 0 } }, { -1, { 105, 108 } }, { -1, { 106, 107 } }, { 39, { 0, 0 } }, { 40, { 0, 0 } }, { -1, { 109, 110 } }, { 41, { 0, 0 } }, { 42, { 0, 0 } }, { -1, { 112, 113 } }, { 43, { 0, 0 } }, { 44, { 0, 0 } }, { -1, { 115, 116 } }, { 45, { 0, 0 } }, { 46, { 0, 0 } }, { -1, { 118, 119 } }, { 47, { 0, 0 } }, { 48, { 0, 0 } }, { -1, { 121, 122 } }, { 49, { 0, 0 } }, { 50, { 0, 0 } }, { -1, { 124, 125 } }, { 51, { 0, 0 } }, { 52, { 0, 0 } }, { -1, { 127, 128 } }, { 53, { 0, 0 } }, { 54, { 0, 0 } }, { -1, { 130, 133 } }, { -1, { 131, 132 } }, { 55, { 0, 0 } }, { 56, { 0, 0 } }, { -1, { 134, 135 } }, { 57, { 0, 0 } }, { 58, { 0, 0 } }, { -1, { 137, 138 } }, { 59, { 0, 0 } }, { 60, { 0, 0 } }, { -1, { 140, 141 } }, { 61, { 0, 0 } }, { 62, { 0, 0 } }, { 63, { 0, 0 } }, { -1, { 144, 145 } }, { 320, { 0, 0 } }, { 384, { 0, 0 } }, { -1, { 147, 153 } }, { -1, { 148, 149 } }, { 448, { 0, 0 } }, { 512, { 0, 0 } }, { -1, { 151, 161 } }, { -1, { 152, 158 } }, { 576, { 0, 0 } }, { -1, { 155, 154 } }, { 640, { 0, 0 } }, { -1, { 156, 157 } }, { 704, { 0, 0 } }, { 768, { 0, 0 } }, { -1, { 159, 160 } }, { 832, { 0, 0 } }, { 896, { 0, 0 } }, { -1, { 162, 165 } }, { -1, { 163, 164 } }, { 960, { 0, 0 } }, { 1024, { 0, 0 } }, { -1, { 166, 167 } }, { 1088, { 0, 0 } }, { 1152, { 0, 0 } }, { -1, { 169, 172 } }, { -1, { 170, 171 } }, { 1216, { 0, 0 } }, { 1280, { 0, 0 } }, { -1, { 173, 174 } }, { 1344, { 0, 0 } }, { 1408, { 0, 0 } }, { -1, { 176, 179 } }, { -1, { 177, 178 } }, { 1472, { 0, 0 } }, { 1536, { 0, 0 } }, { -1, { 180, 181 } }, { 1600, { 0, 0 } }, { 1728, { 0, 0 } }, { -1, { 191, 183 } }, { -1, { 184, 187 } }, { -1, { 185, 198 } }, { -1, { 186, 195 } }, { 1792, { 0, 0 } }, { -1, { 188, 205 } }, { -1, { 189, 190 } }, { 1856, { 0, 0 } }, { 1920, { 0, 0 } }, { -1, { 192, 0 } }, { -1, { 193, 0 } }, { -1, { 194, 0 } }, { 9999, { 0, 0 } }, { -1, { 196, 197 } }, { 1984, { 0, 0 } }, { 2048, { 0, 0 } }, { -1, { 199, 202 } }, { -1, { 200, 201 } }, { 2112, { 0, 0 } }, { 2176, { 0, 0 } }, { -1, { 203, 204 } }, { 2240, { 0, 0 } }, { 2304, { 0, 0 } }, { -1, { 206, 209 } }, { -1, { 207, 208 } }, { 2368, { 0, 0 } }, { 2432, { 0, 0 } }, { -1, { 210, 211 } }, { 2496, { 0, 0 } }, { 2560, { 0, 0 } }, }; /*---------------------------------------------------------------------*/ extern INODE BlackHUFS[]; INODE BlackHUFS[] = { { -1, { 4, 1 } }, { -1, { 3, 2 } }, { 2, { 0, 0 } }, { 3, { 0, 0 } }, { -1, { 8, 5 } }, { -1, { 7, 6 } }, { 4, { 0, 0 } }, { 1, { 0, 0 } }, { -1, { 12, 9 } }, { -1, { 11, 10 } }, { 5, { 0, 0 } }, { 6, { 0, 0 } }, { -1, { 18, 13 } }, { -1, { 15, 14 } }, { 7, { 0, 0 } }, { -1, { 17, 16 } }, { 8, { 0, 0 } }, { 9, { 0, 0 } }, { -1, { 25, 19 } }, { -1, { 20, 23 } }, { -1, { 21, 22 } }, { 10, { 0, 0 } }, { 11, { 0, 0 } }, { -1, { 31, 24 } }, { 12, { 0, 0 } }, { -1, { 43, 26 } }, { -1, { 27, 29 } }, { -1, { 28, 37 } }, { 13, { 0, 0 } }, { -1, { 40, 30 } }, { 14, { 0, 0 } }, { -1, { 32, 34 } }, { -1, { 33, 51 } }, { 15, { 0, 0 } }, { -1, { 54, 35 } }, { -1, { 57, 36 } }, { 0, { 0, 0 } }, { -1, { 62, 38 } }, { -1, { 142, 39 } }, { 16, { 0, 0 } }, { -1, { 41, 59 } }, { -1, { 42, 121 } }, { 17, { 0, 0 } }, { -1, { 71, 44 } }, { -1, { 45, 48 } }, { -1, { 46, 65 } }, { -1, { 47, 128 } }, { 18, { 0, 0 } }, { -1, { 68, 49 } }, { -1, { 134, 50 } }, { 64, { 0, 0 } }, { -1, { 84, 52 } }, { -1, { 88, 53 } }, { 19, { 0, 0 } }, { -1, { 55, 101 } }, { -1, { 56, 98 } }, { 20, { 0, 0 } }, { -1, { 58, 111 } }, { 21, { 0, 0 } }, { -1, { 91, 60 } }, { -1, { 108, 61 } }, { 22, { 0, 0 } }, { -1, { 63, 114 } }, { -1, { 64, 125 } }, { 23, { 0, 0 } }, { -1, { 139, 66 } }, { -1, { 148, 67 } }, { 24, { 0, 0 } }, { -1, { 69, 131 } }, { -1, { 70, 159 } }, { 25, { 0, 0 } }, { -1, { 80, 72 } }, { -1, { 73, 76 } }, { -1, { 74, 167 } }, { -1, { 75, 164 } }, { 1792, { 0, 0 } }, { -1, { 77, 174 } }, { -1, { 78, 79 } }, { 1856, { 0, 0 } }, { 1920, { 0, 0 } }, { -1, { 81, 0 } }, { -1, { 82, 0 } }, { -1, { 83, 0 } }, { 9999, { 0, 0 } }, { -1, { 155, 85 } }, { -1, { 86, 87 } }, { 26, { 0, 0 } }, { 27, { 0, 0 } }, { -1, { 89, 90 } }, { 28, { 0, 0 } }, { 29, { 0, 0 } }, { -1, { 92, 95 } }, { -1, { 93, 94 } }, { 30, { 0, 0 } }, { 31, { 0, 0 } }, { -1, { 96, 97 } }, { 32, { 0, 0 } }, { 33, { 0, 0 } }, { -1, { 99, 100 } }, { 34, { 0, 0 } }, { 35, { 0, 0 } }, { -1, { 102, 105 } }, { -1, { 103, 104 } }, { 36, { 0, 0 } }, { 37, { 0, 0 } }, { -1, { 106, 107 } }, { 38, { 0, 0 } }, { 39, { 0, 0 } }, { -1, { 109, 110 } }, { 40, { 0, 0 } }, { 41, { 0, 0 } }, { -1, { 112, 113 } }, { 42, { 0, 0 } }, { 43, { 0, 0 } }, { -1, { 115, 118 } }, { -1, { 116, 117 } }, { 44, { 0, 0 } }, { 45, { 0, 0 } }, { -1, { 119, 120 } }, { 46, { 0, 0 } }, { 47, { 0, 0 } }, { -1, { 122, 152 } }, { -1, { 123, 124 } }, { 48, { 0, 0 } }, { 49, { 0, 0 } }, { -1, { 126, 127 } }, { 50, { 0, 0 } }, { 51, { 0, 0 } }, { -1, { 129, 137 } }, { -1, { 130, 184 } }, { 52, { 0, 0 } }, { -1, { 161, 132 } }, { -1, { 181, 133 } }, { 53, { 0, 0 } }, { -1, { 135, 193 } }, { -1, { 136, 190 } }, { 54, { 0, 0 } }, { -1, { 187, 138 } }, { 55, { 0, 0 } }, { -1, { 140, 146 } }, { -1, { 141, 200 } }, { 56, { 0, 0 } }, { -1, { 143, 150 } }, { -1, { 144, 145 } }, { 57, { 0, 0 } }, { 58, { 0, 0 } }, { -1, { 203, 147 } }, { 59, { 0, 0 } }, { -1, { 149, 206 } }, { 60, { 0, 0 } }, { -1, { 151, 158 } }, { 61, { 0, 0 } }, { -1, { 153, 154 } }, { 62, { 0, 0 } }, { 63, { 0, 0 } }, { -1, { 156, 157 } }, { 128, { 0, 0 } }, { 192, { 0, 0 } }, { 256, { 0, 0 } }, { -1, { 209, 160 } }, { 320, { 0, 0 } }, { -1, { 162, 163 } }, { 384, { 0, 0 } }, { 448, { 0, 0 } }, { -1, { 165, 166 } }, { 1984, { 0, 0 } }, { 2048, { 0, 0 } }, { -1, { 168, 171 } }, { -1, { 169, 170 } }, { 2112, { 0, 0 } }, { 2176, { 0, 0 } }, { -1, { 172, 173 } }, { 2240, { 0, 0 } }, { 2304, { 0, 0 } }, { -1, { 175, 178 } }, { -1, { 176, 177 } }, { 2368, { 0, 0 } }, { 2432, { 0, 0 } }, { -1, { 179, 180 } }, { 2496, { 0, 0 } }, { 2560, { 0, 0 } }, { -1, { 182, 183 } }, { 512, { 0, 0 } }, { 576, { 0, 0 } }, { -1, { 185, 186 } }, { 640, { 0, 0 } }, { 704, { 0, 0 } }, { -1, { 188, 189 } }, { 768, { 0, 0 } }, { 832, { 0, 0 } }, { -1, { 191, 192 } }, { 896, { 0, 0 } }, { 960, { 0, 0 } }, { -1, { 194, 197 } }, { -1, { 195, 196 } }, { 1024, { 0, 0 } }, { 1088, { 0, 0 } }, { -1, { 198, 199 } }, { 1152, { 0, 0 } }, { 1216, { 0, 0 } }, { -1, { 201, 202 } }, { 1280, { 0, 0 } }, { 1344, { 0, 0 } }, { -1, { 204, 205 } }, { 1408, { 0, 0 } }, { 1472, { 0, 0 } }, { -1, { 207, 208 } }, { 1536, { 0, 0 } }, { 1600, { 0, 0 } }, { -1, { 210, 211 } }, { 1664, { 0, 0 } }, { 1728, { 0, 0 } }, }; #endif capi4hylafax-svn/src/convert/sff2huf.cpp0000644000175000017500000005650110470310066020131 0ustar mastermaster/*---------------------------------------------------------------------------*\ * Copyright (C) 2000 AVM GmbH. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY, without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT * ANY LIABILITY FOR ANY DAMAGES arising out of or in connection * with the use or performance of this software. See the * GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include #include "sff2huf.h" #include "revbyte.h" #include "osImport.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define SFF_DOCUMENT_HEADER_SIZE 20 #define SFF_PAGE_HEADER_SIZE 18 // max number of bytes caused by expansion of empty lines // + additional 40 bytes safty margin #define HUFF_SFF_ADD_TO_PUT_IN ((253 - 216) * (HUF_EMPTY_LINE_CHAR_SIZE + 3) + 40) #define HUF_END_OF_LINE_CHAR_SIZE 2 //#define HUF_END_OF_PAGE_CHAR_SIZE 2 #define HUF_END_OF_PAGE_CHAR_SIZE 8 #define HUF_EMPTY_LINE_CHAR_SIZE 4 #define SFF 0x66666653 #define DLE_CHAR 0x10 /*===========================================================================*\ \*===========================================================================*/ CSFilter_Sff2Huf::CSFilter_Sff2Huf (void) { dhead ("CSFilter_Sff2Huf - Constructor", DCON_SffFilter); } /*===========================================================================*\ \*===========================================================================*/ CSFilter_Sff2Huf::~CSFilter_Sff2Huf (void) { dhead ("CSFilter_Sff2Huf - Destructor", DCON_SffFilter); } /*===========================================================================*\ \*===========================================================================*/ tBool CSFilter_Sff2Huf::Open (tUInt DataBitOrder) { dhead ("CSFilter_Sff2Huf::Open", DCON_SffFilter); rxSFFInit (DataBitOrder); return vTrue; } /*===========================================================================*\ \*===========================================================================*/ void CSFilter_Sff2Huf::Close (void) { dhead ("CSFilter_Sff2Huf::Close", DCON_SffFilter); } /*===========================================================================*\ \*===========================================================================*/ CSFilter_Sff2Huf::ctInfo CSFilter_Sff2Huf::PutChar (tUChar ch) { dhead ("CSFilter_Sff2Huf::PutChar", DCON_SffFilter); ctInfo fret = i_Normal; dassert (rxSff.count < MAX_SFF_HUF_BUFFER_LEN); if (rxSff.count > MAX_SFF_HUF_BUFFER_LEN - HUFF_SFF_ADD_TO_PUT_IN) { return i_QueueFull; } if (rxSff.Status != rxSFF_End) { PutQueueData (ch); } switch (rxSff.Status) { case rxSFF_Start: if (rxSff.count >= sizeof (tUInt)) { tUInt sffID; GetQueueData (&sffID, sizeof (tUInt)); if (sffID != SFF) { rxSFFInit (rxSff.BitOrder); fret = i_Error_NoFax; } else { rxSff.Status = rxSFF_RecvDocHeader; } } break; case rxSFF_RecvDocHeader: if (rxSff.count >= (SFF_DOCUMENT_HEADER_SIZE - sizeof (tUInt))) { IgnoreQueueData (6 * sizeof (tUByte)); GetQueueData (&rxSff.OffsetFirstPage, sizeof (tUShort)); IgnoreQueueData (8 * sizeof (tUByte)); rxSff.OffsetFirstPage = (tUShort) ((rxSff.OffsetFirstPage <= SFF_DOCUMENT_HEADER_SIZE) ? 0 : rxSff.OffsetFirstPage - SFF_DOCUMENT_HEADER_SIZE); rxSff.Status = rxSFF_GetDocHeader; } break; case rxSFF_GetDocHeader: if (rxSff.count > rxSff.OffsetFirstPage) { IgnoreQueueData (rxSff.OffsetFirstPage); if (ch != 254) { rxSFFInit (rxSff.BitOrder); fret = i_Error_NoFax; } else { rxSff.Status = rxSFF_RecvPageHeaderLen; } rxSff.offset = rxSff.count; } break; case rxSFF_RecvPageHeaderLen: if (ch) { if (ch < SFF_PAGE_HEADER_SIZE - 2 * sizeof (tUByte)) { rxSFFInit (rxSff.BitOrder); fret = i_Error_IllegalCoding; } else { rxSff.OffsetPageHeader = ch + sizeof (tUByte); rxSff.Status = rxSFF_RecvPageHeader; } } else { dassert (rxSff.count <= MAX_SFF_HUF_BUFFER_LEN - HUF_END_OF_PAGE_CHAR_SIZE); PutQueueData (0x00); PutQueueData (0x08); PutQueueData (0x80); PutQueueData (0x00); PutQueueData (0x08); PutQueueData (0x80); PutQueueData (0x00); PutQueueData (0x80); //PutQueueData (DLE_CHAR); //PutQueueData (0x03); rxSff.VirtCount += HUF_END_OF_PAGE_CHAR_SIZE; rxSff.CountDataHeaders++; rxSff.Status = rxSFF_End; fret = i_LastPage; } break; case rxSFF_RecvPageHeader: if (rxSff.count - rxSff.offset >= rxSff.OffsetPageHeader) { if (rxSff.PageInfo.PageNumber == 0) { /*----- First PageHeader received -----*/ /*----- remember VResolution and drop PageHeader -----*/ rxSff.offset = 0; rxSff.PageLen = 0; rxSff.PageInfo.PageNumber++; IgnoreQueueData (2 * sizeof (tUByte)); GetQueueData (&rxSff.PageInfo.ResolutionVertical, sizeof (tUByte)); GetQueueData (&rxSff.PageInfo.ResolutionHorizontal, sizeof (tUByte)); IgnoreQueueData (2 * sizeof (tUByte)); GetQueueData (&rxSff.PageInfo.LineLength, sizeof (tUShort)); GetQueueData (&rxSff.PageInfo.PageLength, sizeof (tUShort)); IgnoreQueueData (rxSff.OffsetPageHeader - 9); dassert (rxSff.count == 0); dassert (rxSff.CountDataHeaders == 0); } else { dassert (rxSff.count <= MAX_SFF_HUF_BUFFER_LEN - HUF_END_OF_PAGE_CHAR_SIZE); PutQueueData (0x00); PutQueueData (0x08); PutQueueData (0x80); PutQueueData (0x00); PutQueueData (0x08); PutQueueData (0x80); PutQueueData (0x00); PutQueueData (0x80); //PutQueueData (DLE_CHAR); //PutQueueData (0x03); rxSff.VirtCount += HUF_END_OF_PAGE_CHAR_SIZE; rxSff.CountDataHeaders++; } rxSff.Status = rxSFF_RecvDataHeader; } break; case rxSFF_RecvSpecialLen: if (ch) { rxSff.offset = rxSff.count; rxSff.LineLen = ch; rxSff.Status = rxSFF_GetSpecialLen; } else { rxSff.CountIllegalLines++; rxSff.CountAllLines++; rxSff.CountDataHeaders++; rxSff.Status = rxSFF_RecvDataHeader; } break; case rxSFF_GetSpecialLen: if (rxSff.count - rxSff.offset >= rxSff.LineLen) { rxSff.CountDataHeaders++; rxSff.Status = rxSFF_RecvDataHeader; } break; case rxSFF_RecvDataHeader: switch (ch) { case 255: rxSff.Status = rxSFF_RecvSpecialLen; break; case 254: rxSff.Status = rxSFF_RecvPageHeaderLen; break; case 0: rxSff.Status = rxSFF_RecvDataHeaderEx; break; default: if (ch <= 216) { /*----- save length always in the same format -----*/ dassert (rxSff.count <= MAX_SFF_HUF_BUFFER_LEN - sizeof (tUShort)); PutQueueData (ch); PutQueueData (0); rxSff.LineLen = ch; rxSff.Status = rxSFF_RecvData; } else { tUShort EmptyLen; ch -= 216; EmptyLen = (tUShort) (ch * (HUF_EMPTY_LINE_CHAR_SIZE + 3) - 1); if (rxSff.count + EmptyLen > MAX_SFF_HUF_BUFFER_LEN - 2) { fret = i_QueueFull; break; } rxSff.VirtCount += EmptyLen; rxSff.CountAllLines += ch; //rxSff.CountDataHeaders++; //PutQueueData ((tUChar)(EmptyLen & 0xFF)); //PutQueueData ((tUChar)(EmptyLen >> 8)); //rxSff.Status = rxSFF_RecvData; for (; ch > 0; ch--) { rxSff.CountDataHeaders++; PutQueueData (4); PutQueueData (0); rxSff.Status = rxSFF_RecvData; /*----- Add characters for a empty line -----*/ PutQueueData (0xB2); PutQueueData (0x59); PutQueueData (0x01); PutQueueData (0x80); rxSff.Status = rxSFF_RecvDataHeader; if (ch > 1) { PutQueueData (0); } } } break; } rxSff.offset = rxSff.count; break; case rxSFF_RecvDataHeaderEx: if (rxSff.count - rxSff.offset >= sizeof (tUShort)) { LookQueueData (rxSff.offset, &rxSff.LineLen, sizeof (tUShort)); dassert (rxSff.LineLen > 216); dassert (rxSff.LineLen <= 32767); rxSff.offset = rxSff.count; rxSff.Status = (rxSff.LineLen != 0) ? rxSFF_RecvData : rxSFF_RecvDataHeader; } break; case rxSFF_RecvData: dassert (rxSff.count - rxSff.offset <= rxSff.LineLen); rxSff.VirtCount++; //if (((rxSff.BitOrder) ? ch : REVBYTE[ch]) == DLE_CHAR) { // /*----- Escape-characters must be added twice -----*/ // dassert (rxSff.count < MAX_SFF_HUF_BUFFER_LEN); // PutQueueData (ch); // rxSff.LineLen++; // rxSff.VirtCount++; //} if (rxSff.count - rxSff.offset >= rxSff.LineLen) { /*----- add EndOfLine-character -----*/ dassert (rxSff.count <= MAX_SFF_HUF_BUFFER_LEN - HUF_END_OF_LINE_CHAR_SIZE); PutQueueData (0x00); PutQueueData (0x80); rxSff.LineLen += HUF_END_OF_LINE_CHAR_SIZE; rxSff.VirtCount += HUF_END_OF_LINE_CHAR_SIZE; /*----- remember the changed LineLen in the right place!! -----*/ dassert (rxSff.offset > sizeof (tUShort)); dassert (rxSff.offset + rxSff.LineLen == rxSff.count); SetInQueueData (rxSff.offset - sizeof (tUShort), &rxSff.LineLen, sizeof (tUShort)); rxSff.CountAllLines++; rxSff.CountDataHeaders++; rxSff.Status = rxSFF_RecvDataHeader; //cprint ("->SFFSetLineLen=%x, DataHeader=%x\n", rxSff.LineLen, rxSff.CountDataHeaders); } break; case rxSFF_End: default: dassert (0); break; } RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ tUInt CSFilter_Sff2Huf::GetStrip (tUChar *buffer, tUInt len, CSFilter_Sff2Huf::ctInfo *info) { dhead ("CSFilter_Sff2Huf::GetStrip", DCON_SffFilter); dassert (buffer != 0); dassert (len > 0); dassert (info != 0); tUInt size = CurStripSize(); if (!size) { *info = i_StripNotComplete; return 0; } else if (size > len) { *info = i_BufferToSmall; return 0; } return GetToPageEnd (buffer, len, info); } /*===========================================================================*\ \*===========================================================================*/ tUInt CSFilter_Sff2Huf::GetToPageEnd (tUChar *buffer, tUInt maxLen, CSFilter_Sff2Huf::ctInfo *info) { dhead ("CSFilter_Sff2Huf::GetToPageEnd", DCON_SffFilter); unsigned n; int SendBytes = 0; dassert (buffer != 0); dassert (info != 0); dassert (maxLen >= HUF_END_OF_PAGE_CHAR_SIZE); *info = rxSff.info; rxSff.info = i_Normal; if (!rxSff.VirtCount || *info != i_Normal) { return 0; } //dwarning (rxSff.count > 0); while (maxLen > 0) { if (rxSff.DeqLineLen) { dassert (rxSff.DeqLineLen <= rxSff.VirtCount); n = (maxLen > rxSff.DeqLineLen) ? rxSff.DeqLineLen : maxLen; dassert (n <= rxSff.count); GetQueueData (buffer, n); buffer += n; SendBytes += n; maxLen -= n; rxSff.VirtCount -= n; rxSff.DeqLineLen = (tUShort)(rxSff.DeqLineLen - n); } if (!rxSff.DeqLineLen) { // calculate the next value for DeqLineLen // Note: it´s important not to wait for the next loop, because if called from GetStrip // maxLen is always == DeqLineLen and so GetStrip never gets an LastPageEnd info tUByte DataHeader; if (rxSff.info != i_Normal) { /*----- Bei erreichen des Seitenende sofort Funktion benden -----*/ *info = rxSff.info; rxSff.info = i_Normal; break; } if (!rxSff.CountDataHeaders) { /*----- Es ist noch nicht genügend da -> Beende Funktion -----*/ break; } rxSff.CountDataHeaders--; GetQueueData (&DataHeader, sizeof (tUByte)); switch (DataHeader) { case 255: { tUByte IgnoreLen; dassert (rxSff.count >= sizeof (tUByte)); GetQueueData (&IgnoreLen, sizeof (tUByte)); if (IgnoreLen) { IgnoreQueueData (IgnoreLen); } break; } case 254: { tUByte PageHeaderLen; dassert (rxSff.count >= sizeof (tUByte) + HUF_END_OF_PAGE_CHAR_SIZE); rxSff.OldPageInfo = rxSff.PageInfo; rxSff.OldPageInfo.PageLength = rxSff.PageLen; // remember the real PageLen GetQueueData (&PageHeaderLen, sizeof (tUByte)); if (PageHeaderLen) { dassert (PageHeaderLen >= SFF_PAGE_HEADER_SIZE - 2 * sizeof (tUByte)); dassert (rxSff.count >= SFF_PAGE_HEADER_SIZE + HUF_END_OF_PAGE_CHAR_SIZE - 2); rxSff.info = i_NewPage; rxSff.PageInfo.PageNumber++; GetQueueData (&rxSff.PageInfo.ResolutionVertical, sizeof (tUByte)); GetQueueData (&rxSff.PageInfo.ResolutionHorizontal, sizeof (tUByte)); IgnoreQueueData (2 * sizeof (tUByte)); GetQueueData (&rxSff.PageInfo.LineLength, sizeof (tUShort)); GetQueueData (&rxSff.PageInfo.PageLength, sizeof (tUShort)); IgnoreQueueData (PageHeaderLen - 8); } else { rxSff.info = i_LastPage; rxSff.PageInfo.PageLength = rxSff.PageLen; dassert (rxSff.Status == rxSFF_End); } rxSff.PageLen = 0; rxSff.DeqLineLen = HUF_END_OF_PAGE_CHAR_SIZE; break; } default: rxSff.PageLen++; dassert (rxSff.count > sizeof (tUShort)); GetQueueData (&rxSff.DeqLineLen, sizeof (tUShort)); //cprint ("<-SFFGetLineLen=%x, Count=%x, CountHeader=%x\n", rxSff.DeqLineLen, rxSff.count, // rxSff.CountDataHeaders); dassert (rxSff.DeqLineLen > 0); dassert (rxSff.DeqLineLen < 32767); dassert (rxSff.DeqLineLen <= rxSff.count); break; } } } return SendBytes; } /*===========================================================================*\ \*===========================================================================*/ tUInt CSFilter_Sff2Huf::CurStripSize (void) { dhead ("CSFilter_Sff2Huf::CurStripSize", DCON_SffFilter); if (rxSff.DeqLineLen) { // return rest of current strip return rxSff.DeqLineLen; } tUByte dummy; tUInt offset = 0; tUShort size = 0; tUInt cHead = rxSff.CountDataHeaders; // loop over all PageHeader and DataLines till a valid strip size is found for (; cHead && !size; cHead--) { // get first byte of data header LookQueueData (offset++, &dummy, sizeof (tUByte)); if (dummy == 255) { LookQueueData (offset++, &dummy, sizeof (tUByte)); offset += dummy; } else if (dummy == 254) { LookQueueData (offset++, &dummy, sizeof (tUByte)); if (dummy) { offset += SFF_PAGE_HEADER_SIZE - 2; } else { // end of fax reached and no strip size found break; } } else { LookQueueData (offset, &size, sizeof (tUShort)); offset += sizeof (tUShort); } } return size; } /*===========================================================================*\ \*===========================================================================*/ tUInt CSFilter_Sff2Huf::CurSize (void) { dhead ("CSFilter_Sff2Huf::CurSize", DCON_SffFilter); dassert (rxSff.count >= rxSff.VirtCount); return (rxSff.CountDataHeaders) ? rxSff.VirtCount : 0; } /*===========================================================================*\ \*===========================================================================*/ tBool CSFilter_Sff2Huf::GetCurPageInfo (ctPageInfo *pPInfo) { dhead ("CSFilter_Sff2Huf::GetCurPageInfo", DCON_SffFilter); dassert (pPInfo != 0); if (rxSff.PageInfo.PageNumber > 0) { *pPInfo = rxSff.PageInfo; return vTrue; } return vFalse; } /*===========================================================================*\ \*===========================================================================*/ tBool CSFilter_Sff2Huf::GetLastPageInfo (ctPageInfo *pPInfo) { dhead ("CSFilter_Sff2Huf::GetLastPageInfo", DCON_SffFilter); dassert (pPInfo != 0); if (rxSff.OldPageInfo.PageNumber > 0) { *pPInfo = rxSff.OldPageInfo; return vTrue; } return vFalse; } /*===========================================================================*\ \*===========================================================================*/ tBool CSFilter_Sff2Huf::GetIllegalLines (tUInt *pCountIllegalLines, tUInt *pCountAllLines) { dhead ("CSFilter_Sff2Huf::GetIllegalLines", DCON_SffFilter); if (pCountIllegalLines) *pCountIllegalLines = rxSff.CountIllegalLines; if (pCountAllLines) *pCountAllLines = rxSff.CountAllLines; return (rxSff.CountIllegalLines || !rxSff.CountAllLines); } /*===========================================================================*\ \*===========================================================================*/ void CSFilter_Sff2Huf::rxSFFInit (tUInt DataBitOrder) { dhead ("CSFilter_Sff2Huf::rxSFFInit", DCON_SffFilter); dassert (DataBitOrder <= 1); memset (&rxSff, 0, sizeof (RXSFF)); rxSff.Status = rxSFF_Start; //rxSff.VResolution = -1; rxSff.info = i_Normal; rxSff.BitOrder = DataBitOrder; } /*===========================================================================*\ \*===========================================================================*/ void CSFilter_Sff2Huf::PutQueueData (tUChar c) { dhead ("CSFilter_Sff2Huf::PutQueueData", DCON_SffFilter); dassert (rxSff.count < MAX_SFF_HUF_BUFFER_LEN); rxSff.buffer[rxSff.head] = (!rxSff.BitOrder && (rxSff.Status == rxSFF_RecvData)) ? REVBYTE[c] : c; rxSff.count++; if (++rxSff.head >= MAX_SFF_HUF_BUFFER_LEN) { rxSff.head = 0; } } /*===========================================================================*\ \*===========================================================================*/ void CSFilter_Sff2Huf::IgnoreQueueData (tUInt len) { dhead ("CSFilter_Sff2Huf::IgnoreQueueData", DCON_SffFilter); dassert (rxSff.count >= len); rxSff.count -= len; if (rxSff.offset) { dassert (rxSff.offset >= len); rxSff.offset -= len; } rxSff.tail += len; if (rxSff.tail >= MAX_SFF_HUF_BUFFER_LEN) { rxSff.tail -= MAX_SFF_HUF_BUFFER_LEN; } } /*===========================================================================*\ \*===========================================================================*/ void CSFilter_Sff2Huf::GetQueueData (void *buf, tUInt len) { dhead ("CSFilter_Sff2Huf::GetQueueData", DCON_SffFilter); dassert (buf != 0); dassert (rxSff.count >= len); rxSff.count -= len; if (rxSff.offset) { dassert (rxSff.offset >= len); rxSff.offset -= len; } if (rxSff.tail + len > MAX_SFF_HUF_BUFFER_LEN) { tUInt dummy = MAX_SFF_HUF_BUFFER_LEN - rxSff.tail; memcpy (buf, rxSff.buffer + rxSff.tail, dummy); rxSff.tail = len - dummy; memcpy (((char *)buf) + dummy, rxSff.buffer, rxSff.tail); } else { memcpy (buf, rxSff.buffer + rxSff.tail, len); rxSff.tail += len; } } /*===========================================================================*\ \*===========================================================================*/ void CSFilter_Sff2Huf::LookQueueData (tUInt offset, void *buf, tUInt len) { dhead ("CSFilter_Sff2Huf::LookQueueData", DCON_SffFilter); dassert (buf != 0); dassert (rxSff.count >= offset + len); offset += rxSff.tail; if (offset >= MAX_SFF_HUF_BUFFER_LEN) { offset -= MAX_SFF_HUF_BUFFER_LEN; } if (offset + len > MAX_SFF_HUF_BUFFER_LEN) { tUInt dummy = MAX_SFF_HUF_BUFFER_LEN - offset; memcpy (buf, rxSff.buffer + offset, dummy); memcpy (((char *)buf) + dummy, rxSff.buffer, len - dummy); } else { memcpy (buf, rxSff.buffer + offset, len); } } /*===========================================================================*\ \*===========================================================================*/ void CSFilter_Sff2Huf::SetInQueueData (tUInt offset, void *buf, tUInt len) { dhead ("CSFilter_Sff2Huf::SetInQueueData", DCON_SffFilter); dassert (buf != 0); dassert (rxSff.count >= offset + len); offset += rxSff.tail; if (offset >= MAX_SFF_HUF_BUFFER_LEN) { offset -= MAX_SFF_HUF_BUFFER_LEN; } if (offset + len > MAX_SFF_HUF_BUFFER_LEN) { tUInt dummy = MAX_SFF_HUF_BUFFER_LEN - offset; memcpy (rxSff.buffer + offset, buf, dummy); memcpy (rxSff.buffer, ((char *)buf) + dummy, len - dummy); } else { memcpy (rxSff.buffer + offset, buf, len); } } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/convert/BasicFax.h0000644000175000017500000001273010470310066017707 0ustar mastermaster/*---------------------------------------------------------------------------*\ * Copyright (C) 2000 AVM GmbH. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY, without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT * ANY LIABILITY FOR ANY DAMAGES arising out of or in connection * with the use or performance of this software. See the * GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _BASICFAX_H_ #define _BASICFAX_H_ #include "ftif2huf.h" #include "sff2huf.h" #include "huf2ftif.h" #include "huf2sff.h" #include "MultiStr.h" #include "InfoType.h" #include "defaults.h" #include "CCSParam.h" #include /*===========================================================================*\ \*===========================================================================*/ class CBasicFaxConversion { public: CBasicFaxConversion (void); virtual ~CBasicFaxConversion (void); void ConnectLog (cp_ncpi_all *pNCPI); void WriteXferLog (const char *cmd, tUInt commid, tUChar *jobtag, tUInt *pJobid, char *devname, CDynamicString *pUser, CDynamicString *pDestination, char *statustext); tSInfo OpenSend (CMultiString *pSendFileList, tUInt Resolution); void StopSend (void); void CloseSend (void); tSInfo SendSFF (tUByte *buffer, tUInt maxLen, tUInt *pLen); tSInfo OpenRecv (void); void StopRecv (void); void CloseRecv (void); tSInfo RecvSFF (tUByte *buffer, tUInt len); FaxFormatType GetFormat (void); void SetFormat (FaxFormatType faxtype); tUInt GetPageCount (void); void SetPageCount (tUInt pc); tUInt GetBaudRate (void); CMultiString *GetRecvFiles (void); tUInt GetResolution (void); tUInt GetSendState (void); tUInt GetRecvState (void); tBool GetRecvIllegalLines (tUInt *pCountIllegalLines, tUInt *pCountAllLines); void ConnectionInd (void); void ConnectionStarted (void); void SetReceiveID (CDynamicString *pRecvIDStr); CDynamicString *GetReceiveID (void); time_t GetStartTime (void); virtual void PageEndReached (tBool IsLastPage) = 0; virtual void WriteLog (tSInt /*priority*/, char * /*text*/, ...) {} virtual tUInt GetRecvFileMode (void) { return DEFAULT_FILE_MODE; } virtual CDynamicString *GetSpoolDir (void) { return 0; } private: time_t GetStopTime (void); time_t GetConnectionTime (void); tSInfo FillSffFilter (void); tSInt GetRecvFile (void); tSInt GetNextRecvFile (void); CSFilter_fTif2Huf m_sTifFilter; CSFilter_Huf2Sff m_sSffFilter; CSFilter_Huf2fTif m_rTifFilter; CSFilter_Sff2Huf m_rSffFilter; FaxFormatType m_format; COneMultiString *m_pCurSendFile; CDynamicString *m_pRecvString; CMultiString m_RecvFileList; tUInt m_PageCount; tUInt m_BaudRate; tUInt m_VResolution; tUInt m_finishedFaxFile; tUInt m_recvState; tUInt m_faxFileNr; tSInt m_FaxFileD; tSInt m_RecvFile; time_t m_StartTime; time_t m_ConnectStartTime; time_t m_StartPageTime; time_t m_StopTime; }; /*===========================================================================*\ \*===========================================================================*/ inline FaxFormatType CBasicFaxConversion::GetFormat (void) { return m_format; } inline void CBasicFaxConversion::SetFormat (FaxFormatType faxtype) { m_format = faxtype; } inline tUInt CBasicFaxConversion::GetPageCount (void) { return m_PageCount; } inline void CBasicFaxConversion::SetPageCount (tUInt pc) { m_PageCount = pc; } inline tUInt CBasicFaxConversion::GetBaudRate (void) { return m_BaudRate; } inline tUInt CBasicFaxConversion::GetResolution (void) { return m_VResolution; } inline tUInt CBasicFaxConversion::GetSendState (void) { return m_finishedFaxFile; } inline tUInt CBasicFaxConversion::GetRecvState (void) { return m_recvState; } inline tBool CBasicFaxConversion::GetRecvIllegalLines (tUInt *pCountIllegalLines, tUInt *pCountAllLines) { return m_rSffFilter.GetIllegalLines (pCountIllegalLines, pCountAllLines); } inline void CBasicFaxConversion::ConnectionInd (void) { m_StartTime = m_StartPageTime = m_StopTime = time (0); m_ConnectStartTime = 0; } inline void CBasicFaxConversion::ConnectionStarted (void) { m_ConnectStartTime = m_StartPageTime = time (0); } inline void CBasicFaxConversion::SetReceiveID (CDynamicString *pRecvIDStr) { m_pRecvString = pRecvIDStr; } inline CDynamicString *CBasicFaxConversion::GetReceiveID (void) { return m_pRecvString; } inline time_t CBasicFaxConversion::GetStartTime (void) { return m_StartTime; } inline time_t CBasicFaxConversion::GetStopTime (void) { return m_StopTime; } inline time_t CBasicFaxConversion::GetConnectionTime (void) { return m_StopTime - m_ConnectStartTime; } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/convert/revbyte.h0000644000175000017500000000556710470310066017721 0ustar mastermaster/*---------------------------------------------------------------------------*\ * Copyright (C) 2000 AVM GmbH. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY, without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT * ANY LIABILITY FOR ANY DAMAGES arising out of or in connection * with the use or performance of this software. See the * GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _revbyte_h_ #define _revbyte_h_ /*=====================================================================*\ Bit reverse Tabelle \*=====================================================================*/ unsigned char const REVBYTE[256] = { 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff, }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #endif capi4hylafax-svn/src/convert/Makefile.am0000644000175000017500000000115410470310066020110 0ustar mastermaster## Process this file with automake to produce Makefile.in AUTOMAKE_OPTIONS = foreign CLEANFILES = *~ comperr MAINTAINERCLEANFILES = Makefile.in INCLUDES = -I$(srcdir)/../standard -I$(srcdir)/../linuxdep -I$(srcdir)/../capi -I$(srcdir)/.. noinst_HEADERS = BasicFax.h ftif2huf.h huf2ftif.h huf2sff.h hufman.h osImport.h revbyte.h sff2huf.h noinst_LIBRARIES = libconvert.a libconvert_a_SOURCES = BasicFax.cpp ftif2huf.cpp huf2ftif.cpp huf2sff.cpp sff2huf.cpp test: test.cpp libconvert.a $(CXX) $(CXXFLAGS) -O0 -I../standard -o test $< libconvert.a -ltiff capi4hylafax-svn/src/convert/huf2sff.h0000644000175000017500000000621110470310066017567 0ustar mastermaster/*---------------------------------------------------------------------------*\ * Copyright (C) 2000 AVM GmbH. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY, without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT * ANY LIABILITY FOR ANY DAMAGES arising out of or in connection * with the use or performance of this software. See the * GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef HUF2SFF_H #define HUF2SFF_H #include "aTypes.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define QUEUESIZE 4096 #define MAX_HUF_SFF_BUFFER_LEN 8192 /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ typedef struct inode { int token; /* Token number for this node. */ int next[2]; /* Pointers to next nodes in tree. */ } INODE; /*===========================================================================*\ \*===========================================================================*/ class CSFilter_Huf2Sff { public: CSFilter_Huf2Sff (); virtual ~CSFilter_Huf2Sff (void); tBool Open (tUInt vRes, tUInt DataBitOrder); void Close (void); void PutPageHeader (tBool lastPage); void PutChar (tUChar ch); tUInt Get (tUChar *buffer, tUInt maxLen); void SetVRes (tUInt vRes); tUInt CurSize (void); tBool IsEOP (void); private: void HUFMANinit (void); int HUFenq (unsigned char *buff, int len); int HUFenq1 (int val); void HUFtstBit (int bit); struct DATA_QUEUE { unsigned char Qdata[QUEUESIZE]; int Qread; /* Read Position */ int Qwrite; /* Write Position */ }; struct TXHUF { int inESCAPE; int EOP; int lineValid; DATA_QUEUE dq; int curInd; int EOLfound, EOLcount0; int white; int run0, run1; int EmptyLine; int numBytes; int outByte, outBits; int default_v_res; INODE *curNode; tUChar AuxBuff[MAX_HUF_SFF_BUFFER_LEN]; }; TXHUF txHuf; }; /*===========================================================================*\ \*===========================================================================*/ inline void CSFilter_Huf2Sff::SetVRes (tUInt vRes) { txHuf.default_v_res = vRes; } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/convert/sff2huf.h0000644000175000017500000000746410470310066017602 0ustar mastermaster/*---------------------------------------------------------------------------*\ * Copyright (C) 2000 AVM GmbH. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY, without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT * ANY LIABILITY FOR ANY DAMAGES arising out of or in connection * with the use or performance of this software. See the * GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _SFF2HUF_H_ #define _SFF2HUF_H_ #include "aTypes.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define MAX_SFF_HUF_BUFFER_LEN 16384 /*===========================================================================*\ \*===========================================================================*/ class CSFilter_Sff2Huf { public: enum ctInfo { i_Normal, i_NewPage, i_LastPage, i_BufferToSmall, i_StripNotComplete, i_Error_NoFax, i_Error_IllegalCoding, i_QueueFull }; struct ctPageInfo { tUShort PageNumber; tUByte ResolutionVertical; tUByte ResolutionHorizontal; tUShort LineLength; tUShort PageLength; }; /*-----------------------------------------------------------------------*/ CSFilter_Sff2Huf (void); virtual ~CSFilter_Sff2Huf (void); tBool Open (tUInt DataBitOrder); void Close (void); ctInfo PutChar (tUChar ch); tUInt GetStrip (tUChar *buffer, tUInt len, ctInfo *info); tUInt GetToPageEnd (tUChar *buffer, tUInt maxLen, ctInfo *info); tUInt CurStripSize (void); // 0 = strip not completly received tUInt CurSize (void); tBool GetCurPageInfo (ctPageInfo *pPInfo); tBool GetLastPageInfo (ctPageInfo *pPInfo); tBool GetIllegalLines (tUInt *pCountIllegalLines, tUInt *pCountAllLines); // return vTrue = IllegalLines or Fax with no Lines detected private: void rxSFFInit (tUInt DataBitOrder); void PutQueueData (tUChar c); void IgnoreQueueData (tUInt len); void GetQueueData (void *buf, tUInt len); void LookQueueData (tUInt offset, void *buf, tUInt len); void SetInQueueData (tUInt offset, void *buf, tUInt len); enum rxSFF_Status { rxSFF_Start, rxSFF_RecvDocHeader, rxSFF_GetDocHeader, rxSFF_RecvPageHeaderLen, rxSFF_RecvPageHeader, rxSFF_RecvSpecialLen, rxSFF_GetSpecialLen, rxSFF_RecvDataHeader, rxSFF_RecvDataHeaderEx, rxSFF_RecvData, rxSFF_End }; struct RXSFF { rxSFF_Status Status; tUInt BitOrder; tUShort OffsetFirstPage; tUByte OffsetPageHeader; tUShort LineLen; tUShort PageLen; tUShort DeqLineLen; ctPageInfo PageInfo; ctPageInfo OldPageInfo; ctInfo info; tUInt CountDataHeaders; tUInt CountAllLines; tUInt CountIllegalLines; tUInt VirtCount; tUInt offset; tUInt count; tUInt head; tUInt tail; tUByte buffer[MAX_SFF_HUF_BUFFER_LEN]; }; RXSFF rxSff; }; /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/convert/ftif2huf.cpp0000644000175000017500000002502610470310066020301 0ustar mastermaster/*---------------------------------------------------------------------------*\ * Copyright (C) 2000 AVM GmbH. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY, without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT * ANY LIABILITY FOR ANY DAMAGES arising out of or in connection * with the use or performance of this software. See the * GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "ftif2huf.h" #include "aFlags.h" #include "osImport.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define DLE 0x10 #define FAX_RESOLUTION_LOW 98 #define FAX_RESOLUTION_HIGH 196 /*===========================================================================*\ \*===========================================================================*/ CSFilter_fTif2Huf::CSFilter_fTif2Huf (void) { dhead ("CSFilter_fTif2Huf - Constructor", DCON_TifFilter); hTiff = 0; stripBuf = 0; YResolution = 0; Close(); // this close initialize the other members } /*===========================================================================*\ \*===========================================================================*/ CSFilter_fTif2Huf::~CSFilter_fTif2Huf (void) { dhead ("CSFilter_fTif2Huf - Destructor", DCON_TifFilter); Close(); } /*===========================================================================*\ \*===========================================================================*/ tBool CSFilter_fTif2Huf::Open (tUChar *TifFileName) { dhead ("CSFilter_fTif2Huf::Open", DCON_TifFilter); dassert (TifFileName != 0); dassert (hTiff == 0); hTiff = TIFFOpen ((char *)TifFileName, "r"); if (hTiff) { SetPageInfo(); tSInfo info; GetStrip (0, 0, &info); dwarning (info == i_Okay); return vTrue; } return vFalse; } /*===========================================================================*\ \*===========================================================================*/ void CSFilter_fTif2Huf::Close (void) { dhead ("CSFilter_fTif2Huf::Close", DCON_TifFilter); if (hTiff) { TIFFClose (hTiff); hTiff = 0; } if (stripBuf) { delete [] stripBuf; stripBuf = 0; } BitRevField = 0; StripCountField = 0; YResolution = 0; nStrips = 0; curStrip = -1; // GetToPageEnd add 1 before it first uses curStrip so we start correctly with 0 stripBufMaxLen = 0; stripBufLen = 0; stripBufOff = 0; } /*===========================================================================*\ \*===========================================================================*/ tBool CSFilter_fTif2Huf::CheckForCorrectFaxFile (void) { dhead ("CSFilter_fTif2Huf::CheckForCorrectFaxFile", DCON_TifFilter); // At the moment only b/w G3 Fax is allowed tUInt32 lValue; tUInt16 sValue = 0; if ((TIFFGetField (hTiff, TIFFTAG_BITSPERSAMPLE, &sValue) == 1) && (sValue == 1)) { sValue = 0; if ((TIFFGetField (hTiff, TIFFTAG_SAMPLESPERPIXEL, &sValue) == 1) && (sValue == 1)) { sValue = 0; if ((TIFFGetField (hTiff, TIFFTAG_COMPRESSION, &sValue) == 1) && (sValue == COMPRESSION_CCITTFAX3)) { lValue = 0; if ((TIFFGetField (hTiff, TIFFTAG_IMAGEWIDTH, &lValue) == 1) && (lValue == 1728)) { lValue = 0; if (TIFFGetField (hTiff, TIFFTAG_GROUP4OPTIONS, &lValue) == 0) { lValue = 0; if ( (TIFFGetField (hTiff, TIFFTAG_GROUP3OPTIONS, &lValue) == 1) && (CheckBitsClrAll (lValue, 0x3)) == vTrue) { RETURN ('x', vTrue); } } } } } } RETURN ('x', vFalse); } /*===========================================================================*\ \*===========================================================================*/ tUInt CSFilter_fTif2Huf::GetToPageEnd (tUByte *buffer, tUInt maxLen, tSInfo *pInfo) { dhead ("CSFilter_fTif2Huf::GetToPageEnd", DCON_TifFilter); dassert (maxLen > 0); dassert (pInfo != 0); tSInfo lInfo = i_Pending; // initialise with an (nearly) unused value tUInt len = 0; do { dprint ("stripBufLen=%x, curStrip=%x, nStrips=%x, last=%x ", stripBufLen, curStrip, nStrips, TIFFLastDirectory (hTiff)); if (stripBufLen <= stripBufOff) { stripBufLen = 0; stripBufOff = 0; do { curStrip++; if ((tUInt)curStrip >= nStrips) { // end of page reached if (TIFFLastDirectory (hTiff) || !TIFFReadDirectory (hTiff)) { lInfo = iWrn_Filter_LastPageEnd; } else { lInfo = iWrn_Filter_PageEnd; SetPageInfo(); } break; } stripBufLen = StripCountField[curStrip]; if (stripBufMaxLen < stripBufLen) { // buffer to small => resize tUChar *tmpBuf = new tUChar[stripBufLen]; if (!tmpBuf) { stripBufLen = 0; lInfo = iErr_OutOfMemory; break; } delete [] stripBuf; stripBuf = tmpBuf; stripBufMaxLen = stripBufLen; } } while (TIFFReadRawStrip (hTiff, curStrip, stripBuf, stripBufLen) < 0); // now we have a new strip or a stop condition } for (; (stripBufOff < stripBufLen); len++, stripBufOff++) { if (len >= maxLen) { lInfo = i_Okay; break; } buffer[len] = BitRevField[stripBuf[stripBufOff]]; //if (buffer[len] == DLE) { // len++; // if (len < maxLen) { // buffer[len] = DLE; // } else { // len -= 2; // lInfo = i_Okay; // break; // } //} } } while (lInfo == i_Pending); // lInfo changed from the unused value to a return condition *pInfo = lInfo; return len; } /*===========================================================================*\ \*===========================================================================*/ tUInt CSFilter_fTif2Huf::GetStrip (tUByte *buffer, tUInt maxLen, tSInfo *pInfo) { dhead ("CSFilter_fTif2Huf::GetStrip", DCON_TifFilter); dassert (pInfo != 0); tSInfo lInfo = i_Pending; // initialise with a (nearly) unused value tUInt len = 0; do { dprint ("stripBufLen=%x, curStrip=%x, nStrips=%x, last=%x ", stripBufLen, curStrip, nStrips, TIFFLastDirectory (hTiff)); if (stripBufLen <= stripBufOff) { stripBufLen = 0; stripBufOff = 0; do { curStrip++; if ((tUInt)curStrip >= nStrips) { // end of page reached if (TIFFLastDirectory (hTiff) || !TIFFReadDirectory (hTiff)) { lInfo = iWrn_Filter_LastPageEnd; } else { lInfo = iWrn_Filter_PageEnd; SetPageInfo(); } break; } stripBufLen = StripCountField[curStrip]; if (stripBufMaxLen < stripBufLen) { // buffer to small => resize tUChar *tmpBuf = new tUChar[stripBufLen]; if (!tmpBuf) { stripBufLen = 0; lInfo = iErr_OutOfMemory; break; } delete [] stripBuf; stripBuf = tmpBuf; stripBufMaxLen = stripBufLen; } } while (TIFFReadRawStrip (hTiff, curStrip, stripBuf, stripBufLen) < 0); // now we have a new strip or a stop condition } dprint ("l=%x,o=%x ", stripBufLen, stripBufOff); if (stripBufOff < stripBufLen) { lInfo = i_Okay; //tUInt countDLE = 0; //for (tUInt i = stripBufOff; i < stripBufLen; i++) { // if (BitRevField[stripBuf[i]] == DLE) { // countDLE++; // } //} if (maxLen >= (stripBufLen - stripBufOff)) { // + countDLE)) { for (; (stripBufOff < stripBufLen); len++, stripBufOff++) { buffer[len] = BitRevField[stripBuf[stripBufOff]]; //if (buffer[len] == DLE) { // len++; // buffer[len] = DLE; //} } } } } while (lInfo == i_Pending); // lInfo changed from the unused value to a return condition *pInfo = lInfo; RETURN ('x', len); } /*===========================================================================*\ \*===========================================================================*/ void CSFilter_fTif2Huf::SetPageInfo (void) { dhead ("CSFilter_fTif2Huf::SetPageInfo", DCON_TifFilter); dassert (hTiff != 0); float intyres = 0.0; tUShort fillorder; nStrips = TIFFNumberOfStrips (hTiff); curStrip = -1; // GetToPageEnd add 1 before it first uses curStrip so we start correctly with 0 TIFFGetFieldDefaulted (hTiff, TIFFTAG_FILLORDER, &fillorder); BitRevField = TIFFGetBitRevTable (fillorder != FILLORDER_LSB2MSB); TIFFGetField (hTiff, TIFFTAG_STRIPBYTECOUNTS, &StripCountField); TIFFGetField (hTiff, TIFFTAG_YRESOLUTION, &intyres); YResolution = (tUInt)intyres; } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/convert/huf2ftif.cpp0000644000175000017500000001540410470310066020300 0ustar mastermaster/*---------------------------------------------------------------------------*\ * Copyright (C) 2000 AVM GmbH. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY, without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT * ANY LIABILITY FOR ANY DAMAGES arising out of or in connection * with the use or performance of this software. See the * GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include #include #include #include "huf2ftif.h" #include "osImport.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define DLE_CHAR 0x10 /*===========================================================================*\ \*===========================================================================*/ CSFilter_Huf2fTif::CSFilter_Huf2fTif (void) { dhead ("CSFilter_Huf2fTif - Constructor", DCON_TifFilter); hTiff = 0; } /*===========================================================================*\ \*===========================================================================*/ CSFilter_Huf2fTif::~CSFilter_Huf2fTif (void) { dhead ("CSFilter_Huf2fTif - Destructor", DCON_TifFilter); Close(); } /*===========================================================================*\ \*===========================================================================*/ tBool CSFilter_Huf2fTif::Open (int fdTifFile, tUChar *TifFileName) { dhead ("CSFilter_Huf2fTif::Open", DCON_TifFilter); dassert (TifFileName != 0); dassert (hTiff == 0); countPage = 1; hTiff = TIFFFdOpen (fdTifFile, (char *)TifFileName, "w"); if (hTiff) { return vTrue; } else { close (fdTifFile); } return vFalse; } /*===========================================================================*\ \*===========================================================================*/ void CSFilter_Huf2fTif::Close (void) { dhead ("CSFilter_Huf2fTif::Close", DCON_TifFilter); if (hTiff) { TIFFClose (hTiff); hTiff = 0; } } /*===========================================================================*\ \*===========================================================================*/ tBool CSFilter_Huf2fTif::Put (tUChar *buffer, tUInt len) { dhead ("CSFilter_Huf2fTif::Put", Dbg_Level_Errors); //DCON_TifFilter); dparams ("%x,%x", buffer, len); dassert (buffer != 0); dwarning (len > 0); // Doppelte DLE´s entfernen //tUChar *lauf1 = buffer; //tUChar *lauf2 = buffer; //for (tUInt i = len; i > 0; i--, lauf1++, lauf2++) { // *lauf1 = *lauf2; // if ((*lauf2 == DLE_CHAR) && (i > 1)) { // lauf2++; // len--; // i--; // } //} TIFFWriteRawStrip (hTiff, 0, buffer, len); return vTrue; } /*===========================================================================*\ \*===========================================================================*/ tBool CSFilter_Huf2fTif::PutPageHeader (tUInt yRes, tUInt xRes, tUInt length, tUInt width, tUInt recvparams, tUChar *description, tUChar *manufact, tUChar *model, tUChar *hostname, tUChar *software) { dhead ("CSFilter_Huf2fTif::PutPageHeader", DCON_TifFilter); dparams ("%x,%x,%x,%x,%s,%s,%s,%s,%s", yRes, xRes, length, width, description, manufact, model, hostname, software); char dateTime[24]; time_t curTime; time (&curTime); strftime (dateTime, sizeof (dateTime), "%Y:%m:%d %H:%M:%S", localtime (&curTime)); dprint ("Time=%s ", dateTime); TIFFSetField (hTiff, TIFFTAG_BITSPERSAMPLE, 1); TIFFSetField (hTiff, TIFFTAG_SAMPLESPERPIXEL, 1); TIFFSetField (hTiff, TIFFTAG_COMPRESSION, COMPRESSION_CCITTFAX3); TIFFSetField (hTiff, TIFFTAG_FILLORDER, FILLORDER_LSB2MSB); TIFFSetField (hTiff, TIFFTAG_GROUP3OPTIONS, GROUP3OPT_FILLBITS); TIFFSetField (hTiff, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); TIFFSetField (hTiff, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE); TIFFSetField (hTiff, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); TIFFSetField (hTiff, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH); TIFFSetField (hTiff, TIFFTAG_SUBFILETYPE, FILETYPE_PAGE); TIFFSetField (hTiff, TIFFTAG_IMAGEWIDTH, width); TIFFSetField (hTiff, TIFFTAG_XRESOLUTION, (float)(1.0 * xRes)); TIFFSetField (hTiff, TIFFTAG_YRESOLUTION, (float)(1.0 * yRes)); TIFFSetField (hTiff, TIFFTAG_DATETIME, dateTime); TIFFSetField (hTiff, TIFFTAG_PAGENUMBER, countPage, 0); //TIFFSetField (hTiff, TIFFTAG_FAXSUBADDRESS, (const char*) sub); if (recvparams) { TIFFSetField (hTiff, TIFFTAG_FAXRECVPARAMS, recvparams); } if (description && *description) { TIFFSetField (hTiff, TIFFTAG_IMAGEDESCRIPTION, description); } if (manufact && *manufact) { TIFFSetField (hTiff, TIFFTAG_MAKE, manufact); } if (model && *model) { TIFFSetField (hTiff, TIFFTAG_MODEL, model); } if (hostname && *hostname) { TIFFSetField (hTiff, TIFFTAG_HOSTCOMPUTER, hostname); } if (software && *software) { TIFFSetField (hTiff, TIFFTAG_SOFTWARE, software); } if (length) { TIFFSetField (hTiff, TIFFTAG_IMAGELENGTH, length); TIFFSetField (hTiff, TIFFTAG_ROWSPERSTRIP, length); } else { TIFFSetField (hTiff, TIFFTAG_ROWSPERSTRIP, (uint32)-1); } return vTrue; } /*===========================================================================*\ \*===========================================================================*/ void CSFilter_Huf2fTif::PutPageEnd (tBool /*LastPage*/, tUInt length, tUInt duration) { dhead ("CSFilter_Huf2fTif::PutPageEnd", DCON_TifFilter); //dparams ("%x,%x", LastPage, length); if (length) { TIFFSetField (hTiff, TIFFTAG_IMAGELENGTH, length); } if (duration) { TIFFSetField (hTiff, TIFFTAG_FAXRECVTIME, duration); } TIFFWriteDirectory (hTiff); countPage++; } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/standard/0000755000175000017500000000000010470310070016166 5ustar mastermastercapi4hylafax-svn/src/standard/DynArray.cpp0000644000175000017500000000433210470310070020425 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "DynArray.h" #include "dbgSTD.h" /*===========================================================================*\ CDynamicArray::Append \*===========================================================================*/ tBool CDynamicArray::Append (void *dataIn, tUInt *pos) { dhead ("CDynamicArray::Append", DCON_CStandardArray); dassert (dataIn != 0); if (IsArrayFull()) { Resize ((MaxCountItems() >= (MAXVAL_tUInt / (ItemSize() * 2))) ? (MAXVAL_tUInt / ItemSize()) : ((MaxCountItems() * 2) + 1)); } return CStandardArray::Append (dataIn, pos); } /*===========================================================================*\ CDynamicArray::Ins \*===========================================================================*/ tBool CDynamicArray::Ins (tUInt pos, void *dataIn) { dhead ("CDynamicArray::Ins", DCON_CStandardArray); if (IsArrayFull()) { Resize ((MaxCountItems() >= (MAXVAL_tUInt / (ItemSize() * 2))) ? (MAXVAL_tUInt / ItemSize()) : ((MaxCountItems() * 2) + 1)); } return CStandardArray::Ins (pos, dataIn); } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/standard/StdArray.h0000644000175000017500000001375410470310070020102 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _STDARRAY_H_ #define _STDARRAY_H_ #include "aTypes.h" #include "Protect.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ typedef tResult (*tArrayCompFunc) (const void *data, const void *ItemFrag); /*===========================================================================*\ \*===========================================================================*/ class CStandardArray { public: CStandardArray (tUInt MaxCountOfItems, tUInt SizeOfItem); virtual ~CStandardArray (void); // return: 0 = error, 1 == success but no dataOut, 2 == success and dataOut valid tUInt Set (tUInt pos, void *dataIn, void *dataOut = 0); tUInt SetEmpty (void *dataIn, tUInt *pPos = 0); // Set an item in an empty place virtual tBool AppendEmpty (tUInt *pPos = 0); // Append an empty item virtual tBool Append (void *dataIn, tUInt *pPos = 0); virtual tBool Ins (tUInt pos, void *dataIn); tBool Get (tUInt pos, void *dataOut); const void *Get_Direct (tUInt pos); tBool GetNext (void *dataOut, tUInt *FindPos = 0, tUInt StartPos = 0); const void *GetNext_Direct (tUInt *FindPos = 0, tUInt StartPos = 0); // del removes the item from the array, all greater items will be shift one pos lower // for return value see above tUInt Del (tUInt pos, void *dataOut = 0); tUInt DelLast (void *dataOut = 0); void DelAll (void); // clear makes the item invalid, but the pos still exists // for return value see above tUInt Clear (tUInt pos, void *dataOut = 0); tUInt ClearLast (void *dataOut = 0); void ClearAll (void); tResult Find (tArrayCompFunc CompFunc, void *ItemFrag, void *dataOut = 0, tUInt *FindPos = 0, tUInt StartPos = 0); void *Find_Direct (tArrayCompFunc CompFunc, void *ItemFrag, tUInt StartPos = 0); // Return: CompFunc == vYes tBool IsItemEmpty (tUInt pos); tBool IsArrayEmpty (void); tBool IsArrayFull (void); tBool ExistUsedItems (void); tBool ExistEmptyItems (void); tUInt CountUsedItems (void); tUInt CountEmptyItems (void); tUInt CountAllItems (void); tUInt MaxCountItems (void); tUInt ItemSize (void); tBool Resize (tUInt newMaxItemCount); private: Protect_Define (hProtect); tUChar *Array; tUChar *ArrayEmpty; tUInt count; tUInt emptyCount; tUInt maxCount; tUInt sizeCopy; // size of the item == size needed to copy tUInt sizeItem; // real used, alligned size }; /*===========================================================================*\ \*===========================================================================*/ inline tBool CStandardArray::IsItemEmpty (tUInt pos) { return (tBool)(ArrayEmpty[pos] == 1); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tBool CStandardArray::IsArrayEmpty (void) { return (count) ? vFalse : vTrue; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tBool CStandardArray::IsArrayFull (void) { return (count == maxCount) ? vTrue : vFalse; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tBool CStandardArray::ExistUsedItems (void) { return (count > emptyCount) ? vTrue : vFalse; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tBool CStandardArray::ExistEmptyItems (void) { return (emptyCount) ? vTrue : vFalse; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tUInt CStandardArray::CountUsedItems (void) { return count - emptyCount; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tUInt CStandardArray::CountEmptyItems (void) { return emptyCount; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tUInt CStandardArray::CountAllItems (void) { return count; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tUInt CStandardArray::MaxCountItems (void) { return maxCount; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tUInt CStandardArray::ItemSize (void) { return sizeItem - 1; } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/CEvent.h0000644000175000017500000000755710470310070017541 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _CEVENT_H_ #define _CEVENT_H_ #ifndef CEVENT_USE_SEMAPHORE /*===========================================================================*\ \*===========================================================================*/ #include "Eventing.h" class CEvent { public: CEvent (void) : m_hEvent (vIllegalHandle) {} virtual ~CEvent (void) { Event_Destroy (&m_hEvent); } tBool Init (void) { return Event_Create (&m_hEvent); } void Set (void) { Event_Set (m_hEvent); } void Clear (void) { Event_Clear (m_hEvent); } tBool Wait (tUInt msecs) { return Event_Wait (m_hEvent, msecs); } private: thEvent m_hEvent; }; /*===========================================================================*\ \*===========================================================================*/ #else // #ifndef CEVENT_USE_SEMAPHORE #include "ProtClas.h" #include "SemaFunc.h" class CEvent : private CProtectClass { public: CEvent (void); virtual ~CEvent (void); tBool Init (void); void Set (void); void Clear (void); tBool Wait (tUInt msecs); private: thSemaphore m_hSema; tBool m_Flag; tBool m_Wait; tBool m_IncCalled; }; /*===========================================================================*\ \*===========================================================================*/ inline CEvent::CEvent (void) : m_hSema (vIllegalHandle), m_Flag (vFalse), m_Wait (vFalse), m_IncCalled (vFalse) { } inline CEvent::~CEvent (void) { Semaphore_Destroy (&m_hSema); } inline tBool CEvent::Init (void) { tBool fret = Semaphore_Init (&m_hSema); if (fret == vTrue) { fret = CProtectClass::Init(); if (fret == vFalse) { Semaphore_Destroy (&m_Sema); } } return fret; } inline void CEvent::Set (void) { BeginWrite(); if (m_Flag == vFalse) { m_Flag = vTrue; if ((m_Wait == vTrue) && (m_IncCalled == vFalse)) { m_IncCalled == vTrue; EndWrite(); Semaphore_Inc (m_hSema); return; } } EndWrite(); return; } inline void CEvent::Clear (void) { BeginWrite(); m_Flag = vFalse; EndWrite(); } inline tBool CEvent::Wait (tUInt msecs) { tBool fret = vTrue; BeginWrite(); if (!m_Flag) { m_Wait = vTrue; EndWrite(); fret = Semaphore_Wait (m_hSema, msecs); BeginWrite(); m_Wait = vFalse; if ((fret == vFalse) && (m_IncCalled == vTrue)) { EndWrite(); // Set nach Wait aufgerufen => Semaphore muß nun noch wieder in den Grundzustand fret = Semaphore_Wait (m_hSema, 1); BeginWrite(); } } m_Flag = vFalse; m_IncCalled = vFalse; EndWrite(); return fret; } #endif // #ifndef CEVENT_USE_SEMAPHORE /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/StdQueue.cpp0000644000175000017500000001227210470310070020435 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "StdQueue.h" #include "dbgSTD.h" /*===========================================================================*\ CStandardQueue - Constructor \*===========================================================================*/ CStandardQueue::CStandardQueue (tUInt MaxCountOfItems, tUInt SizeOfItem) : ByteQueue (MaxCountOfItems * SizeOfItem) { dhead ("CStandardQueue-Constructor", DCON_CStandardQueue); dassert (MaxCountOfItems > 0); dassert (SizeOfItem > 0); dassert ((MaxCountOfItems / 10) * (SizeOfItem / 10) <= (MAXVAL_tUInt / 100)); sizeItem = SizeOfItem; maxItems = (ByteQueue.MaxSize() != 0) ? MaxCountOfItems : 0; dassert (ByteQueue.MaxSize() / sizeItem == maxItems); } /*===========================================================================*\ CStandardQueue - Destructor \*===========================================================================*/ CStandardQueue::~CStandardQueue () { dhead ("CStandardQueue-Destructor", DCON_CStandardQueue); maxItems = 0; sizeItem = 0; } /*===========================================================================*\ \*===========================================================================*/ tBool CStandardQueue::Put (void *dataIn) { dhead ("CStandardQueue::Put", DCON_CStandardQueue); dassert (dataIn != 0); dassert (sizeItem != 0); dwarning (maxItems != 0); #ifdef NDEBUG return (ByteQueue.Put ((tUByte *)dataIn, sizeItem) != 0) ? vTrue : vFalse; #else dinfo (ByteQueue.FreeSize() >= sizeItem, "ByteQueue to small: put=%x, free=%x", sizeItem, ByteQueue.FreeSize()); tUInt _in = ByteQueue.Put ((tUByte *)dataIn, sizeItem); if (_in) { dassert (_in == sizeItem); return vTrue; } return vFalse; #endif } /*===========================================================================*\ \*===========================================================================*/ tBool CStandardQueue::PutInFront (void *dataIn) { dhead ("CStandardQueue::PutInFront", DCON_CStandardQueue); dassert (dataIn != 0); dassert (sizeItem != 0); dwarning (maxItems != 0); #ifdef NDEBUG return (ByteQueue.PutInFront ((tUByte *)dataIn, sizeItem) != 0) ? vTrue : vFalse; #else dinfo (ByteQueue.FreeSize() >= sizeItem, "ByteQueue to small: putInFront=%x, free=%x", sizeItem, ByteQueue.FreeSize()); tUInt _in = ByteQueue.PutInFront ((tUByte *)dataIn, sizeItem); if (_in) { dassert (_in == sizeItem); return vTrue; } return vFalse; #endif } /*===========================================================================*\ \*===========================================================================*/ tBool CStandardQueue::Get (void *dataOut) { dhead ("CStandardQueue::Get", DCON_CStandardQueue); dassert (dataOut != 0); dassert (sizeItem != 0); dwarning (maxItems != 0); #ifdef NDEBUG return (ByteQueue.Get ((tUByte *)dataOut, sizeItem) != 0) ? vTrue : vFalse; #else dinfo (((ByteQueue.UsedSize() <= sizeItem) && ByteQueue.UsedSize()), "CStandardQueue: Perhaps ByteQueue lost Data: get=%x, use=%x", sizeItem, ByteQueue.UsedSize()); tUInt _out = ByteQueue.Get ((tUByte *)dataOut, sizeItem); if (_out) { dassert (_out == sizeItem); return vTrue; } return vFalse; #endif } /*===========================================================================*\ \*===========================================================================*/ tBool CStandardQueue::Resize (tUInt newMaxCountOfItems) { dhead ("CStandardQueue::Resize", DCON_CStandardQueue); dassert (newMaxCountOfItems > 0); dassert ((newMaxCountOfItems / 10) * (sizeItem / 10) <= (MAXVAL_tUInt / 100)); dassert (sizeItem != 0); dwarning (maxItems != 0); if (ByteQueue.Resize (newMaxCountOfItems * sizeItem) == vTrue) { maxItems = newMaxCountOfItems; dassert (ByteQueue.MaxSize() / sizeItem == maxItems); return vTrue; } return vFalse; } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/standard/DynByteQ.cpp0000644000175000017500000000404210470310070020371 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "DynByteQ.h" #include "dbgSTD.h" /*===========================================================================*\ CDynamicByteQueue::Put \*===========================================================================*/ tUInt CDynamicByteQueue::Put (tUByte *dataIn, tUInt length) { dhead ("CDynamicByteQueue::Put", DCON_CStandardByteQueue); if (FreeSize() < length) { Resize ((MaxSize() >= (MAXVAL_tUInt / 2)) ? MAXVAL_tUInt : ((MaxSize() * 2) + 1)); } return CStandardByteQueue::Put (dataIn, length); } /*===========================================================================*\ CDynamicByteQueue::PutInFront \*===========================================================================*/ tUInt CDynamicByteQueue::PutInFront (tUByte *dataIn, tUInt length) { dhead ("CDynamicByteQueue::PutInFront", DCON_CStandardByteQueue); if (FreeSize() < length) { Resize ((MaxSize() >= (MAXVAL_tUInt / 2)) ? MAXVAL_tUInt : ((MaxSize() * 2) + 1)); } return CStandardByteQueue::PutInFront (dataIn, length); } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/standard/Makefile.in0000644000175000017500000004235610470310070020245 0ustar mastermaster# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/standard DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libstandard_a_AR = $(AR) $(ARFLAGS) libstandard_a_LIBADD = am_libstandard_a_OBJECTS = aStdLib.$(OBJEXT) aString.$(OBJEXT) \ aStrPrt.$(OBJEXT) ByteQueu.$(OBJEXT) CBTimer.$(OBJEXT) \ CDbgIDS.$(OBJEXT) ConfAssi.$(OBJEXT) ConfPars.$(OBJEXT) \ CString.$(OBJEXT) DbgFile.$(OBJEXT) DbgInfo.$(OBJEXT) \ DynArray.$(OBJEXT) DynByteQ.$(OBJEXT) DynQueue.$(OBJEXT) \ DynStore.$(OBJEXT) FilePars.$(OBJEXT) LinePars.$(OBJEXT) \ PtrList.$(OBJEXT) SortList.$(OBJEXT) StdArray.$(OBJEXT) \ StdQueue.$(OBJEXT) libstandard_a_OBJECTS = $(am_libstandard_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) depcomp = $(SHELL) $(top_srcdir)/src/scripts/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libstandard_a_SOURCES) DIST_SOURCES = $(libstandard_a_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) INSTALL = @INSTALL@ ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ hylafaxbindir = @hylafaxbindir@ hylafaxspooldir = @hylafaxspooldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign CLEANFILES = *~ comperr MAINTAINERCLEANFILES = Makefile.in noinst_HEADERS = aFlags.h \ aStdLib.h \ aStrPrt.h \ aTypes.h \ aString.h \ ByteQueu.h \ CBTimer.h \ CDbgIDS.h \ CEvent.h \ ConfAssi.h \ ConfPars.h \ CString.h \ DataList.h \ DataPack.h \ DataPool.h \ DatBlock.h \ DbgFile.h \ DbgInfo.h \ dbgSTD.h \ DynArray.h \ DynByteQ.h \ DynQueue.h \ DynStore.h \ Eventing.h \ ExtFuncs.h \ FilePars.h \ InfoType.h \ LinePars.h \ MultiStr.h \ osmem.h \ PathName.h \ Protect.h \ ProtClas.h \ PtrList.h \ SecTimer.h \ SemaFunc.h \ SortList.h \ StdArray.h \ StdQueue.h noinst_LIBRARIES = libstandard.a libstandard_a_SOURCES = aStdLib.cpp \ aString.cpp \ aStrPrt.cpp \ ByteQueu.cpp \ CBTimer.cpp \ CDbgIDS.cpp \ ConfAssi.cpp \ ConfPars.cpp \ CString.cpp \ DbgFile.cpp \ DbgInfo.cpp \ DynArray.cpp \ DynByteQ.cpp \ DynQueue.cpp \ DynStore.cpp \ FilePars.cpp \ LinePars.cpp \ PtrList.cpp \ SortList.cpp \ StdArray.cpp \ StdQueue.cpp all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/standard/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/standard/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libstandard.a: $(libstandard_a_OBJECTS) $(libstandard_a_DEPENDENCIES) -rm -f libstandard.a $(libstandard_a_AR) libstandard.a $(libstandard_a_OBJECTS) $(libstandard_a_LIBADD) $(RANLIB) libstandard.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ByteQueu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CBTimer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CDbgIDS.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CString.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ConfAssi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ConfPars.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DbgFile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DbgInfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DynArray.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DynByteQ.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DynQueue.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DynStore.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FilePars.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LinePars.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PtrList.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SortList.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StdArray.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StdQueue.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aStdLib.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aStrPrt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aString.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: capi4hylafax-svn/src/standard/FilePars.cpp0000644000175000017500000000755410470310070020412 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "FilePars.h" #include "dbgSTD.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define CONFIGPARSER_MaxLength 200 /*===========================================================================*\ \*===========================================================================*/ tSInfo CConfigFileParser::ParseFile (tUChar *FileName) { dhead ("CConfigFileParser::ParseFile", DCON_ConfigParser); dassert (FileName != 0); tSInfo fret; FILE *hFile = fopen ((char *)FileName, "r"); if (!hFile) { return iErr_File_OpenFailed; } fret = ParseFile (hFile); fclose (hFile); return fret; } /*===========================================================================*\ \*===========================================================================*/ tSInfo CConfigFileParser::ParseFile (FILE *FileHandle) { dhead ("CConfigFileParser::ParseFile", DCON_ConfigParser); dassert (FileHandle != 0); char szPartLine[CONFIGPARSER_MaxLength + 1]; CDynamicString curLine; tUInt curLineNr = 0; if (!GetMainSection()) { return iErr_OutOfMemory; } // TODO?: set file position to begin of file? // fseek (FileHandle, 0, SEEK_SET); while (feof (FileHandle) == 0) { if (fgets (szPartLine, CONFIGPARSER_MaxLength, FileHandle)) { if (curLine.Append ((tUChar *)szPartLine) == vFalse) { return iErr_OutOfMemory; } if (curLine.GetLen()) { if ((curLine.GetLastChar() == '\r') || (curLine.GetLastChar() == '\n')) { // Remove "\r\n" at the end do { curLine.CutLen (1); } while ( (curLine.GetLen() > 0) && ( (curLine.GetLastChar() == '\r') || (curLine.GetLastChar() == '\n'))); if (curLine.GetLen() == 0) { // Line includes only line end chars continue; } } else if (feof (FileHandle) == 0) { // Line longer than CONFIGPARSER_MaxLength. Get more data before parsing continue; } dprint ("ParseLine=(%s)\n", curLine.GetPointer()); switch (ParseLine (&curLine)) { case i_Okay: case i_Pending: break; case iErr_OutOfMemory: return iErr_OutOfMemory; default: LineCodingError (++curLineNr, &curLine); break; } } } curLine.RemoveAll(); } return (ParseLine (0) == iErr_OutOfMemory) ? iErr_OutOfMemory : i_Okay; } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/standard/CString.cpp0000644000175000017500000007212210470310070020247 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "CString.h" #include "aString.h" #include "aStdLib.h" #include "aStrPrt.h" #include "aFlags.h" #include "dbgSTD.h" /*---------------------------------------------------------------------------*\ internal defines \*---------------------------------------------------------------------------*/ #define CSTRING_PRINT_BufferSize 80 // Must be enough to take a int or // pointer to string conversion string #define CSTRING_PRINT_MemoryError -1 #define PRINTFLAGS_ACTIVE 0x0001 // Placeholder found #define PRINTFLAGS_READY 0x0002 // Placeholder fully insert #define PRINTFLAGS_MINUS 0x0004 // Output left oriented #define PRINTFLAGS_PLUS 0x0008 // Use sign '+' or '-' #define PRINTFLAGS_ZERO 0x0010 // Fill with leading zeros #define PRINTFLAGS_BLANK 0x0020 // Use sign '-' or ' ' #define PRINTFLAGS_HASH 0x0040 // Show 0 or 0x before numbers #define PRINTFLAGS_LARGE 0x0080 // Placeholder is in LARGE-format #define PRINTFLAGS_SHORT 0x0100 // Placeholder is in SHORT-format #define PRINTFLAGS_FAR 0x0200 // Placeholder is a FAR-pointer #define PRINTFLAGS_NEAR 0x0400 // Placeholder is a NEAR-pointer #define PRINTFLAGS_QUESTION 0x0800 // Sizeof Char specified before string #define PRINTFLAGS_STRINGTYPE 0x1000 // Placeholder is a CDynamicString-Pointer /*===========================================================================*\ \*===========================================================================*/ CConstString::CConstString (tString string, tUInt len) : pntr (string), detectError (vFalse) { dhead ("CConstString-Constructor", DCON_CDynamicString); dassert (!len || pntr); if (!len) { len = check_strlen (string); } curLen = len; maxSize = (len) ? len + 1 : 0; // TODO?: Is this correct? } /*===========================================================================*\ \*===========================================================================*/ tUInt CConstString::check_strlen (const tChar *string) { dhead ("CConstString::check_strlen", DCON_CDynamicString); dassert (string != 0); tSize s = s_strlen (string); dassert (s < MAXVAL_tUInt); return (tUInt)s; } /*===========================================================================*\ \*===========================================================================*/ tUInt CConstString::check_strlen (const tWiChar *string) { dhead ("CConstString::check_strlenW", DCON_CDynamicString); dassert (string != 0); tSize s = s_strlen (string); dassert (s < MAXVAL_tUInt); return (tUInt)s; } /*===========================================================================*\ \*===========================================================================*/ tUInt CConstString::check_strlen (const char *string) { dhead ("CConstString::check_strlenC", DCON_CDynamicString); dassert (string != 0); tSize s = s_strlen (string); dassert (s < MAXVAL_tUInt); return (tUInt)s; } /*===========================================================================*\ \*===========================================================================*/ CDynamicString::CDynamicString (tFormatChar *string, tUInt len) { dhead ("CDynamicString-Constructor", DCON_CDynamicString); dparams ("%s,%x", string, len); Set (string, len); } /*===========================================================================*\ \*===========================================================================*/ CDynamicString::CDynamicString (CConstString *pcstr) { dhead ("CDynamicString-Constructor", DCON_CDynamicString); dparams ("%s", pcstr); Set (pcstr); } /*===========================================================================*\ \*===========================================================================*/ CDynamicString::CDynamicString (tUInt startSize) { dhead ("CDynamicString-Constructor", DCON_CDynamicString); Resize (startSize); } /*===========================================================================*\ \*===========================================================================*/ CDynamicString::~CDynamicString (void) { dhead ("CDynamicString-Destructor", DCON_CDynamicString); tString delPntr = pntr; pntr = 0; curLen = 0; maxSize = 0; detectError = vFalse; if (delPntr) { delete [] delPntr; } } /*===========================================================================*\ \*===========================================================================*/ tBool CDynamicString::Change (tString string, tUInt startPos, tUInt len) { dhead ("CDynamicString::Change", DCON_CDynamicString); dparams ("%s,%x,%x", string, startPos, len, pntr); dassert (string != 0); dassert (startPos <= GetLen()); if (!len) { len = check_strlen (string); dprint ("CalcLen=%x ", len); } tUInt endPos = len + startPos; if (endPos >= GetMaxSize()) { if (DynExpand (endPos + 1) == vFalse) { return vFalse; } } dassert (endPos < GetMaxSize()); dassert (pntr != 0); s_strncpy (pntr + startPos, string, len); if (endPos > GetLen()) { pntr[endPos] = '\0'; curLen = endPos; } return vTrue; } /*===========================================================================*\ \*===========================================================================*/ tBool CDynamicString::Change (tFormatChar *string, tUInt startPos, tUInt len) { dhead ("CDynamicString::Change", DCON_CDynamicString); dparams ("%s,%x,%x,%s", string, startPos, len, pntr); dassert (string != 0); dassert (startPos <= GetLen()); if (!len) { len = check_strlen (string); dprint ("CalcLen=%x ", len); } tUInt endPos = len + startPos; if (endPos >= GetMaxSize()) { if (DynExpand (endPos + 1) == vFalse) { return vFalse; } } dassert (endPos < GetMaxSize()); dassert (pntr != 0); s_strncpy (pntr + startPos, string, len); if (endPos > GetLen()) { pntr[endPos] = '\0'; curLen = endPos; } return vTrue; } /*===========================================================================*\ \*===========================================================================*/ tBool CDynamicString::Insert (tString string, tUInt startPos, tUInt len) { dhead ("CDynamicString::Insert", DCON_CDynamicString); dassert (string != 0); dassert (startPos <= GetLen()); if (!len) { len = check_strlen (string); } tUInt endPos = len + GetLen(); if (endPos >= GetMaxSize()) { if (DynExpand (endPos + 1) == vFalse) { return vFalse; } } dassert (endPos < GetMaxSize()); dassert (pntr != 0); if (GetLen() > startPos) { s_strmov (pntr + startPos, len, GetLen() - startPos); } s_strncpy (pntr + startPos, string, len); pntr[endPos] = '\0'; curLen = endPos; return vTrue; } /*===========================================================================*\ \*===========================================================================*/ tBool CDynamicString::Fill (tStringChar fillChar, tUInt len, tUInt startPos) { dhead ("CDynamicString::Fill", DCON_CDynamicString); dparams ("%c,%x,%x,%s", fillChar, len, startPos, pntr); dassert (startPos <= GetLen()); tUInt endPos = len + startPos; if (endPos >= GetMaxSize()) { if (DynExpand (endPos + 1) == vFalse) { return vFalse; } } dassert (endPos < GetMaxSize()); dassert (pntr != 0); s_strset (pntr + startPos, fillChar, len); if (endPos > GetLen()) { pntr[endPos] = '\0'; curLen = endPos; } return vTrue; } /*===========================================================================*\ \*===========================================================================*/ tCompare CDynamicString::Compare (tString string, tUInt len) { dhead ("CDynamicString::Compare", DCON_CDynamicString); dassert (string != 0); if (!len) { len = check_strlen (string); } tCompare cmp2; if (len == GetLen()) { cmp2 = vEqual; } else if (len > GetLen()) { len = GetLen(); cmp2 = vHigher; } else { cmp2 = vLower; } tCompare fret = s_strncmp (string, pntr, len); if (fret == vEqual) { fret = cmp2; } RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ void CDynamicString::Get (tString string, tUInt len, tUInt startPos) { dhead ("CDynamicString::Get", DCON_CDynamicString); dassert (string != 0); dassert (startPos <= GetLen()); dassert (len <= GetLen()); dassert (startPos + len <= GetLen()); s_strncpy (string, pntr + startPos, len); string[len] = '\0'; } /*===========================================================================*\ \*===========================================================================*/ tUInt CDynamicString::FindChar (tStringChar ch, tUInt startpos) { dhead ("CDynamicString::FindChar", DCON_CDynamicString); for (; startpos < GetLen(); startpos++) { if (pntr[startpos] == ch) { RETURN ('x', startpos); } } RETURN ('x', MAXVAL_tUInt); } /*===========================================================================*\ \*===========================================================================*/ tUInt CDynamicString::FindLastChar (tStringChar ch) { dhead ("CDynamicString::FindLastChar", DCON_CDynamicString); tUInt i = GetLen(); while (i > 0) { if (pntr[--i] == ch) { RETURN ('x', i); } } RETURN ('x', MAXVAL_tUInt); } /*===========================================================================*\ \*===========================================================================*/ void CDynamicString::Remove (tUInt startPos, tUInt len) { dhead ("CDynamicString::Remove", DCON_CDynamicString); dparams ("%x,%x,%x", startPos, len, GetLen()); dassert (startPos <= GetLen()); dassert (len <= GetLen()); dassert (startPos + len <= GetLen()); tUInt endPos = startPos + len; if (endPos >= GetLen()) { SetLen (startPos); } else { s_strmov (pntr + endPos, -(tSLong)len, GetLen() - endPos + 1); dassert (curLen > len); curLen -= len; } } /*===========================================================================*\ \*===========================================================================*/ void CDynamicString::RemoveChars (tString RemoveChars, tUInt startPos, tUInt len) { dhead ("CDynamicString::RemoveChars", DCON_CDynamicString); if (startPos < GetLen()) { if (!len || (len + startPos > GetLen())) { len = GetLen() - startPos; } dassert (GetPointer() != 0); tString lauf = GetPointer() + startPos; for (; (len > 0) && (s_findfirstchar (*lauf, RemoveChars) == 0); len--, lauf++) { dassert (*lauf != 0); } for (tString current = lauf + 1; len > 0; len--, current++) { dassert (*current != 0); if (s_findfirstchar (*current, RemoveChars) == 0) { *lauf++ = *current; } else { curLen--; } } *lauf = '\0'; } } /*===========================================================================*\ \*===========================================================================*/ tBool CDynamicString::Resize (tUInt newMaxSize) { dhead ("CDynamicString::Resize", DCON_CDynamicString); dassert (GetLen() + 1 <= newMaxSize); tString delPntr = 0; tString newPntr = new tStringChar [newMaxSize]; if (!newPntr) { detectError = vTrue; return vFalse; } if (pntr) { s_strncpy (newPntr, pntr, GetLen() + 1); } else { newPntr[0] = '\0'; } delPntr = pntr; pntr = newPntr; maxSize = newMaxSize; delete [] delPntr; return vTrue; } /*===========================================================================*\ \*===========================================================================*/ tSInt CDynamicString::i_vPrintAppend (tFormatChar *format, va_list argptr, tUInt tabsize, tStringChar tabchar) { dhead ("CDynamicString::i_vPrintAppend", DCON_CDynamicString); dassert (format != 0); tFormatChar localBuf[CSTRING_PRINT_BufferSize]; // Local internal buffer tFormatChar *savepos = format; // Position of last "placeholder" tFormatChar *copyBuf = &localBuf[0]; // Buffer that will be append to String tUInt copyBufLen = 0; // Size of copyBuf tUInt PrtFlags = 0; // Possible Flags for "placeholder" tUInt PrtWidth = 0; // Width of "placeholder" tSInt PrtPreci = -2; // Precision of "placeholder" tUInt startLen = GetLen(); // Len of str before Print was executed while (*format != 0) { if (PrtFlags) { /*----- exams placeholders (%...) -----*/ switch (*format) { /*----- FLAGS -----*/ case '-': PrtFlags |= PRINTFLAGS_MINUS; break; case '+': PrtFlags |= PRINTFLAGS_PLUS; break; case ' ': PrtFlags |= PRINTFLAGS_BLANK; break; case '#': PrtFlags |= PRINTFLAGS_HASH; break; case '?': PrtFlags |= PRINTFLAGS_QUESTION; break; case 'l': case 'L': PrtFlags |= PRINTFLAGS_LARGE; break; case 'h': PrtFlags |= PRINTFLAGS_SHORT; break; /*----- WIDTH or PRECISION-----*/ case '0': if (PrtPreci == -2) { PrtFlags |= PRINTFLAGS_ZERO; } // no break! case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (PrtPreci == -2) { PrtWidth = a_strtol (format, &format, 10); } else { PrtPreci = a_strtol (format, &format, 10); } format--; break; case '*': if (PrtPreci == -2) { PrtWidth = va_arg (argptr, tUInt); } else { PrtPreci = va_arg (argptr, tUInt); } break; /*----- TYPE -----*/ case 'b': if ((tUByte)va_arg (argptr, int)) { s_strncpy (localBuf, "TRUE", 5); copyBufLen = 4; } else { s_strncpy (localBuf, "FALSE", 6); copyBufLen = 5; } if (PrtPreci == 1) { copyBufLen = 1; } PrtFlags &= ~(PRINTFLAGS_LARGE | PRINTFLAGS_SHORT); PrtFlags |= PRINTFLAGS_READY; break; case 't': tabsize = PrtWidth; s_charcpy (&tabchar, (tFormatChar)va_arg (argptr, int)); copyBufLen = 0; PrtFlags |= PRINTFLAGS_READY; break; case 'd': case 'i': copyBufLen = i_Print_ltoa (©Buf, (CheckBitsOne (PrtFlags, PRINTFLAGS_LARGE) ? va_arg (argptr, tUInt64) : (CheckBitsOne (PrtFlags, PRINTFLAGS_SHORT) ? (tUInt16)va_arg (argptr, int) : va_arg (argptr, tUInt))), -10, &PrtWidth, PrtFlags); if (!copyBufLen) { RETURN ('x', CSTRING_PRINT_MemoryError); } PrtFlags &= ~(PRINTFLAGS_LARGE | PRINTFLAGS_SHORT); PrtFlags |= PRINTFLAGS_READY; break; case 'u': copyBufLen = i_Print_ltoa (©Buf, (CheckBitsOne (PrtFlags, PRINTFLAGS_LARGE) ? va_arg (argptr, tUInt64) : (CheckBitsOne (PrtFlags, PRINTFLAGS_SHORT) ? (tUInt16)va_arg (argptr, int) : va_arg (argptr, tUInt))), 10, &PrtWidth, PrtFlags); if (!copyBufLen) { RETURN ('x', CSTRING_PRINT_MemoryError); } PrtFlags &= ~(PRINTFLAGS_LARGE | PRINTFLAGS_SHORT); PrtFlags |= PRINTFLAGS_READY; break; case 'o': copyBufLen = i_Print_ltoa (©Buf, (CheckBitsOne (PrtFlags, PRINTFLAGS_LARGE) ? va_arg (argptr, tUInt64) : (CheckBitsOne (PrtFlags, PRINTFLAGS_SHORT) ? (tUInt16)va_arg (argptr, int) : va_arg (argptr, tUInt))), 8, &PrtWidth, PrtFlags); if (!copyBufLen) { RETURN ('x', CSTRING_PRINT_MemoryError); } PrtFlags &= ~(PRINTFLAGS_LARGE | PRINTFLAGS_SHORT); PrtFlags |= PRINTFLAGS_READY; break; case 'x': copyBufLen = i_Print_ltoa (©Buf, (CheckBitsOne (PrtFlags, PRINTFLAGS_LARGE) ? va_arg (argptr, tUInt64) : (CheckBitsOne (PrtFlags, PRINTFLAGS_SHORT) ? (tUInt16)va_arg (argptr, int) : va_arg (argptr, tUInt))), 0x10, &PrtWidth, PrtFlags); if (!copyBufLen) { RETURN ('x', CSTRING_PRINT_MemoryError); } PrtFlags &= ~(PRINTFLAGS_SHORT | PRINTFLAGS_LARGE); PrtFlags |= PRINTFLAGS_READY; break; case 'X': copyBufLen = i_Print_ltoa (©Buf, (CheckBitsOne (PrtFlags, PRINTFLAGS_LARGE) ? va_arg (argptr, tUInt64) : (CheckBitsOne (PrtFlags, PRINTFLAGS_SHORT) ? (tUInt16)va_arg (argptr, int) : va_arg (argptr, tUInt))), - 0x10, &PrtWidth, PrtFlags); if (!copyBufLen) { RETURN ('x', CSTRING_PRINT_MemoryError); } PrtFlags &= ~(PRINTFLAGS_SHORT | PRINTFLAGS_LARGE); PrtFlags |= PRINTFLAGS_READY; break; case 'c': if ((PrtFlags & PRINTFLAGS_QUESTION) && (va_arg (argptr, tUInt) > 1)) { PrtFlags |= PRINTFLAGS_LARGE; } if (PrtFlags & PRINTFLAGS_LARGE) { *((tUWiChar *)copyBuf) = (tUWiChar)va_arg (argptr, int); } else if (PrtFlags & PRINTFLAGS_SHORT) { *((tUChar *)copyBuf) = (tUChar)va_arg (argptr, int); } else { copyBuf[0] = (tFormatChar)va_arg (argptr, int); } copyBufLen = 1; PrtFlags |= PRINTFLAGS_READY; break; case 's': if ((PrtFlags & PRINTFLAGS_QUESTION) && (va_arg (argptr, tUInt) > 1)) { PrtFlags |= PRINTFLAGS_LARGE; } copyBuf = va_arg (argptr, tFormatChar *); if (copyBuf) { if (PrtFlags & PRINTFLAGS_LARGE) { copyBufLen = check_strlen ((tUWiChar *)copyBuf); } else if (PrtFlags & PRINTFLAGS_SHORT) { copyBufLen = check_strlen ((tUChar *)copyBuf); } else { copyBufLen = check_strlen (copyBuf); } } else { s_strncpy (localBuf, "[NULL]", 7); copyBufLen = 6; } PrtFlags |= PRINTFLAGS_READY; break; case 'S': { CConstString *pStr = va_arg (argptr, CConstString *); if (pStr) { copyBuf = (tFormatChar *)pStr->GetPointer(); copyBufLen = pStr->GetLen(); PrtFlags |= PRINTFLAGS_STRINGTYPE; } else { s_strncpy (localBuf, "[NULL]", 7); copyBufLen = 6; } PrtFlags |= PRINTFLAGS_READY; } break; case 'p': copyBufLen = a_pointer2string (va_arg (argptr, void *), copyBuf); PrtFlags |= PRINTFLAGS_READY; break; /*----- Found PRECISION -----*/ case '.': if (PrtPreci == -2) { PrtPreci = -1; break; } /*----- no Break! -----*/ /*----- OTHERS: wrong placeholder -----*/ default: copyBuf = savepos; copyBufLen = (tUInt)(format - savepos + 1); PrtFlags |= PRINTFLAGS_READY; break; } //end: switch (*format) if (PrtFlags & PRINTFLAGS_READY) { // placeholder found if (copyBufLen > 0) { if (!(PrtFlags & PRINTFLAGS_MINUS) && (PrtWidth > copyBufLen)) { PrtWidth -= copyBufLen; if (FillAppend ((PrtFlags & PRINTFLAGS_ZERO) ? '0' : ' ', PrtWidth) == vFalse) { RETURN ('x', CSTRING_PRINT_MemoryError); } PrtWidth = 0; } tUInt endPos = curLen + copyBufLen; if (endPos >= GetMaxSize()) { if (DynExpand (endPos + 1) == vFalse) { RETURN ('x', CSTRING_PRINT_MemoryError); } } dassert (endPos < GetMaxSize()); dassert (pntr != 0); if (PrtFlags & PRINTFLAGS_STRINGTYPE) { s_strncpy (pntr + curLen, (tStringChar *)copyBuf, copyBufLen); } else if (PrtFlags & PRINTFLAGS_LARGE) { s_strncpy (pntr + curLen, (tUWiChar *)copyBuf, copyBufLen); } else if (PrtFlags & PRINTFLAGS_SHORT) { s_strncpy (pntr + curLen, (tUChar *)copyBuf, copyBufLen); } else { s_strncpy (pntr + curLen, copyBuf, copyBufLen); } pntr[endPos] = '\0'; curLen = endPos; if ((PrtWidth > copyBufLen) && (FillAppend (' ', PrtWidth - copyBufLen) == vFalse)) { RETURN ('x', CSTRING_PRINT_MemoryError); } } PrtFlags = 0; PrtWidth = 0; PrtPreci = -2; copyBuf = &localBuf[0]; copyBufLen = 0; savepos = format + 1; } } else { switch (*format) { case '%': //ASSERT (PrtFlags == 0); if ((format > savepos) && (Append (savepos, (tUInt)(format - savepos)) == vFalse)) { RETURN ('x', CSTRING_PRINT_MemoryError); } if (format[1] == '%') { // found %% => eliminate one % format++; savepos = format; } else { savepos = format; PrtFlags = PRINTFLAGS_ACTIVE; } break; case '\n': if ((tabsize > 0) && (tabchar > 0)) { if ( ( (format > savepos) && (Append (savepos, (tUInt)(format - savepos)) == vFalse)) || (FillAppend (tabchar, tabsize) == vFalse)) { RETURN ('x', CSTRING_PRINT_MemoryError); } savepos = format + 1; } break; } } format++; } //end: while if ((format > savepos) && (Append (savepos, (tUInt)(format - savepos)) == vFalse)) { RETURN ('x', CSTRING_PRINT_MemoryError); } dassert (GetLen() >= startLen); RETURN ('x', GetLen() - startLen); } /*===========================================================================*\ \*===========================================================================*/ tUInt CDynamicString::i_Print_ltoa (tFormatChar **pBuffer, tUInt64 value, tSByte radix, tUInt *pWidth, tUInt Flags) { dhead ("CDynamicString::i_Print_ltoa", DCON_CDynamicString); dparams ("r=%x,w=%x,f=%x", radix, *pWidth, Flags); dassert (pBuffer != 0); dassert (*pBuffer != 0); dassert (pWidth != 0); dassert (radix <= 16); dassert (radix >= -16); dassert (CSTRING_PRINT_BufferSize > sizeof (tUInt64) * 8 + 3); static tFormatChar LowDigitForStrings[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'x' }; static tFormatChar HighDigitForStrings[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'X' }; tFormatChar *DigitForStrings = &LowDigitForStrings[0]; tFormatChar *buffer = *pBuffer + CSTRING_PRINT_BufferSize - 1; tFormatChar prechar = 0; tUInt prelen = 0; tUInt bufpos = 0; if (Flags & PRINTFLAGS_PLUS) { prechar = '+'; } else if (Flags & PRINTFLAGS_BLANK) { prechar = ' '; } switch (radix) { case -10: if ((tSInt64)value < 0) { prechar = '-'; value *= -1; } radix *= -1; break; case -0x10: DigitForStrings = &HighDigitForStrings[0]; radix *= -1; break; } dassert (radix > 1); tUInt64 orgval; while (value >= (tUInt64) radix) { orgval = value; //value /= radix; Special64BitDiv (&value, (tUByte)radix); dassert ((tUInt)(orgval - value * radix) < 0x10); *buffer-- = DigitForStrings[(tUByte)(orgval - value * radix)]; bufpos++; } bufpos++; *buffer = DigitForStrings[value]; if (Flags & PRINTFLAGS_HASH) { switch (radix) { case 16: *--buffer = DigitForStrings[0x10]; // x or X prelen++; // no break! case 8: *--buffer = '0'; prelen++; break; } } if (prechar) { *--buffer = prechar; prelen++; } bufpos += prelen; if (prelen && ((Flags & (PRINTFLAGS_MINUS | PRINTFLAGS_ZERO)) == PRINTFLAGS_ZERO) && (*pWidth > bufpos)) { // PRINTFLAGS_MINUS is not set and PRINTFLAGS_ZERO ist set if (Append (buffer, prelen) == vTrue) { buffer += prelen; bufpos -= prelen; *pWidth -= prelen; } else { bufpos = 0; } prelen = 0; } *pBuffer = buffer; return bufpos; } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/standard/ConfAssi.h0000644000175000017500000000403610470310070020047 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _CONFASSI_H_ #define _CONFASSI_H_ #include "ConfPars.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ enum ConfigAssignment_Types { // Data-Type ConfigAssignment_String, // CDynamicString* ConfigAssignment_StringList, // CMultiString* ConfigAssignment_UInt // tUInt* }; struct ConfigAssignment_Item { char *Name; ConfigAssignment_Types Type; void *Data; }; /*===========================================================================*\ \*===========================================================================*/ void ConfigValuesAssignment (CPointerList *ValueList, ConfigAssignment_Item *ItemList); tUInt ConfigValuesTestName (CPointerList *ValueList, ConfigAssignment_Item *searchItem); // return: 0 = Name not found // 1 = Name found, but Data is different // 2 = Name found and Data is identical /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/aString.h0000644000175000017500000003726410470310070017762 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _ASTRING_H_ #define _ASTRING_H_ #include "aTypes.h" #include "aStdLib.h" #include #ifndef ASTRING_DONT_USE_WCHAR #include #endif #ifdef __linux__ #define _strnicmp strncasecmp #define _wcsnicmp wcsncasecmp #endif /*===========================================================================*\ String length and size \*===========================================================================*/ tBool s_strempty (const tChar *string); // without (string == 0) check tBool s_strempty (const tWiChar *string); tBool s_strempty (const char *string); tBool s_strnull (const tChar *string); // strempty with (string == 0) check tBool s_strnull (const tWiChar *string); tBool s_strnull (const char *string); tSize s_strlen (const tChar *string); tSize s_strlen (const tWiChar *string); tSize s_strlen (const char *string); tSize s_strsize (const tChar *string); // with (string == 0) check tSize s_strsize (const tWiChar *string); tSize s_strsize (const char *string); /*===========================================================================*\ Copy \*===========================================================================*/ void s_strcpy (tChar *dest, const tChar *src); void s_strcpy (tChar *dest, const tWiChar *src); void s_strcpy (tChar *dest, const char *src); void s_strcpy (tWiChar *dest, const tChar *src); void s_strcpy (tWiChar *dest, const tWiChar *src); void s_strcpy (tWiChar *dest, const char *src); void s_strcpy (char *dest, const tChar *src); void s_strcpy (char *dest, const tWiChar *src); void s_strcpy (char *dest, const char *src); /*===========================================================================*\ N-Copy \*===========================================================================*/ void s_strncpy (tChar *dest, const tChar *src, tSize len); void s_strncpy (tChar *dest, const tWiChar *src, tSize len); void s_strncpy (tChar *dest, const char *src, tSize len); void s_strncpy (tWiChar *dest, const tChar *src, tSize len); void s_strncpy (tWiChar *dest, const tWiChar *src, tSize len); void s_strncpy (tWiChar *dest, const char *src, tSize len); void s_strncpy (char *dest, const tChar *src, tSize len); void s_strncpy (char *dest, const tWiChar *src, tSize len); void s_strncpy (char *dest, const char *src, tSize len); void s_memcpy (void *dest, void *src, tSize len); /*===========================================================================*\ 1-Copy \*===========================================================================*/ void s_charcpy (tChar *dest, tChar src); void s_charcpy (tChar *dest, tWiChar src); void s_charcpy (tChar *dest, char src); void s_charcpy (tWiChar *dest, tChar src); void s_charcpy (tWiChar *dest, tWiChar src); void s_charcpy (tWiChar *dest, char src); /*===========================================================================*\ Move \*===========================================================================*/ void s_strmov (tChar *string, tOffset offset, tSize len); void s_strmov (tWiChar *string, tOffset offset, tSize len); void s_memmov (void *pointer, tOffset offset, tSize len); /*===========================================================================*\ Set \*===========================================================================*/ void s_strset (tChar *string, tChar setch, tSize len); void s_strset (tWiChar *string, tWiChar setch, tSize len); void s_memset (void *dest, tUByte setby, tSize len); void s_memzero (void *dest, tSize len); /*===========================================================================*\ Clean (return the new strlen) \*===========================================================================*/ tUInt s_strclean (tChar *string, tChar *CleanChars); tUInt s_strkeep (tChar *string, tChar *KeepChars); /*===========================================================================*\ Duplicate \*===========================================================================*/ tBool s_strdup (tChar **pDest, const tChar *src, tSize len = 0); tBool s_strdup (tChar **pDest, const tWiChar *src, tSize len = 0); tBool s_strdup (tWiChar **pDest, const tChar *src, tSize len = 0); tBool s_strdup (tWiChar **pDest, const tWiChar *src, tSize len = 0); void s_strdel (tChar **pString); void s_strdel (tWiChar **pString); /*===========================================================================*\ Find \*===========================================================================*/ tChar *s_findfirstchar (tChar chSearch, tChar *string); tWiChar *s_findfirstchar (tWiChar chSearch, tWiChar *string); tChar *s_findfirstchar (tChar chSearch, tChar *string, tSize len); tWiChar *s_findfirstchar (tWiChar chSearch, tWiChar *string, tSize len); tChar *s_findstring (tChar *fullString, tSize fullLen, tChar *search, tSize searchLen); /*===========================================================================*\ Compare \*===========================================================================*/ tCompare s_strcmp (const tChar *str1, const tChar *str2); tCompare s_strcmp (const tChar *str1, const tWiChar *str2); tCompare s_strcmp (const tWiChar *str1, const tChar *str2); tCompare s_strcmp (const tWiChar *str1, const tWiChar *str2); tCompare s_strncmp (const tChar *str1, const tChar *str2, tSize len); tCompare s_strncmp (const tChar *str1, const tWiChar *str2, tSize len); tCompare s_strncmp (const tWiChar *str1, const tChar *str2, tSize len); tCompare s_strncmp (const tWiChar *str1, const tWiChar *str2, tSize len); tCompare s_strnicmp (const tChar *str1, const tChar *str2, tSize len); tCompare s_strnicmp (const tWiChar *str1, const tWiChar *str2, tSize len); tCompare s_memcmp (const tUByte *mem1, const tUByte *mem2, tSize len); /*===========================================================================*\ inline Funktionen \*===========================================================================*/ inline tBool s_strempty (const tChar *string) { return (*string != 0) ? vFalse : vTrue; } inline tBool s_strempty (const tWiChar *string) { return (*string != 0) ? vFalse : vTrue; } inline tBool s_strempty (const char *string) { return (*string != 0) ? vFalse : vTrue; } inline tBool s_strnull (const tChar *string) { return !string || s_strempty (string); } inline tBool s_strnull (const tWiChar *string) { return !string || s_strempty (string); } inline tBool s_strnull (const char *string) { return !string || s_strempty (string); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tSize s_strlen (const tChar *string) { return strlen ((const char *)string); } #ifndef ASTRING_DONT_USE_WCHAR inline tSize s_strlen (const tWiChar *string) { return wcslen (string); } #endif inline tSize s_strlen (const char *string) { return strlen (string); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tSize s_strsize (const tChar *string) { return (string) ? (s_strlen (string) + 1) : 0; } inline tSize s_strsize (const tWiChar *string) { return (string) ? (s_strlen (string) + 1) * sizeof (tWiChar) : 0; } inline tSize s_strsize (const char *string) { return (string) ? (s_strlen (string) + 1) : 0; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline void s_strcpy (tChar *dest, const tChar *src) { strcpy ((char *)dest, (char *)src); } inline void s_strcpy (tChar *dest, const tWiChar *src) { while (*src != 0) { s_charcpy (dest++, *src++); } *dest = '\0'; } inline void s_strcpy (tChar *dest, const char *src) { s_strcpy (dest, (tChar *)src); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline void s_strcpy (tWiChar *dest, const tChar *src) { while (*src != 0) { s_charcpy (dest++, *src++); } *dest = '\0'; } #ifndef ASTRING_DONT_USE_WCHAR inline void s_strcpy (tWiChar *dest, const tWiChar *src) { wcscpy (dest, src); } #endif inline void s_strcpy (tWiChar *dest, const char *src) { s_strcpy (dest, (tChar *)src); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline void s_strcpy (char *dest, const tChar *src) { s_strcpy ((tChar *)dest, src); } inline void s_strcpy (char *dest, const tWiChar *src) { s_strcpy ((tChar *)dest, src); } inline void s_strcpy (char *dest, const char *src) { s_strcpy ((tChar *)dest, src); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline void s_strncpy (tChar *dest, const tChar *src, tSize len) { memcpy (dest, src, len); } inline void s_strncpy (tChar *dest, const tWiChar *src, tSize len) { for (; len > 0; len--) { s_charcpy (dest++, *src++); } } inline void s_strncpy (tChar *dest, const char *src, tSize len) { s_strncpy (dest, (tChar *)src, len); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline void s_strncpy (tWiChar *dest, const tChar *src, tSize len) { for (; len > 0; len--) { s_charcpy (dest++, *src++); } } inline void s_strncpy (tWiChar *dest, const tWiChar *src, tSize len) { memcpy (dest, src, len * sizeof (tWiChar)); } inline void s_strncpy (tWiChar *dest, const char *src, tSize len) { s_strncpy (dest, (tChar *)src, len); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline void s_strncpy (char *dest, const tChar *src, tSize len) { s_strncpy ((tChar *)dest, src, len); } inline void s_strncpy (char *dest, const tWiChar *src, tSize len) { s_strncpy ((tChar *)dest, src, len); } inline void s_strncpy (char *dest, const char *src, tSize len) { s_strncpy ((tChar *)dest, src, len); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline void s_charcpy (tChar *dest, tChar src) { *dest = src; } inline void s_charcpy (tChar *dest, tWiChar src) { *dest = (tChar)src; } inline void s_charcpy (tChar *dest, char src) { *dest = (tChar)src; } inline void s_charcpy (tWiChar *dest, tChar src) { *dest = (tWiChar)src; } inline void s_charcpy (tWiChar *dest, tWiChar src) { *dest = (tWiChar)src; } inline void s_charcpy (tWiChar *dest, char src) { *dest = (tWiChar)src; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline void s_strset (tChar *string, tChar setch, tSize len) { memset (string, setch, len); } inline void s_strset (tWiChar *string, tWiChar setch, tSize len) { for (; len > 0; len--) { *string++ = setch; } } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline void s_memcpy (void *dest, void *src, tSize len) { memcpy (dest, src, len); } inline void s_memmov (void *dest, tOffset offset, tSize len) { s_strmov ((tUByte *)dest, offset, len); } inline void s_memset (void *dest, tUByte setby, tSize len) { memset (dest, setby, len); } inline void s_memzero (void *dest, tSize len) { s_memset (dest, '\0', len); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline void s_strdel (tChar **pString) { if (*pString) { tChar *tmpStr = *pString; *pString = 0; delete [] tmpStr; } } inline void s_strdel (tWiChar **pString) { if (*pString) { tWiChar *tmpStr = *pString; *pString = 0; delete [] tmpStr; } } inline tChar *s_findfirstchar (tChar chSearch, tChar *string) { return (tChar *)strchr ((char *)string, chSearch); } #ifndef ASTRING_DONT_USE_WCHAR inline tWiChar *s_findfirstchar (tWiChar chSearch, tWiChar *string) { return wcschr (string, chSearch); } #endif inline tChar *s_findfirstchar (tChar chSearch, tChar *string, tSize len) { for (; len > 0; len--, string++) { if (chSearch == *string) { return string; } } return 0; } inline tWiChar *s_findfirstchar (tWiChar chSearch, tWiChar *string, tSize len) { for (; len > 0; len--, string++) { if (chSearch == *string) { return string; } } return 0; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tCompare s_strcmp (const tChar *str1, const tChar *str2) { // assert (tCompare == tSign)! return (tCompare)a_getsign (strcmp ((const char *)str1, (const char *)str2)); } inline tCompare s_strncmp (const tChar *str1, const tChar *str2, tSize len) { // assert (tCompare == tSign)! return (tCompare)a_getsign (strncmp ((const char *)str1, (const char *)str2, len)); } inline tCompare s_strnicmp (const tChar *str1, const tChar *str2, tSize len) { // assert (tCompare == tSign)! return (tCompare)a_getsign (_strnicmp ((const char *)str1, (const char *)str2, len)); } #ifndef ASTRING_DONT_USE_WCHAR inline tCompare s_strcmp (const tWiChar *str1, const tWiChar *str2) { // assert (tCompare == tSign)! return (tCompare)a_getsign (wcscmp (str1, str2)); } inline tCompare s_strncmp (const tWiChar *str1, const tWiChar *str2, tSize len) { // assert (tCompare == tSign)! return (tCompare)a_getsign (wcsncmp (str1, str2, len)); } inline tCompare s_strnicmp (const tWiChar *str1, const tWiChar *str2, tSize len) { // assert (tCompare == tSign)! return (tCompare)a_getsign (_wcsnicmp (str1, str2, len)); } #endif inline tCompare s_memcmp (const tUByte *mem1, const tUByte *mem2, tSize len) { // assert (tCompare == tSign)! return (tCompare)a_getsign (memcmp (mem1, mem2, len)); //for (; len > 0; len--, mem1++, mem2++) { // if (*mem1 != *mem2) { // return (*mem1 < *mem2) ? vLower : vHigher; // } //} //return vEqual; } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/DynStore.h0000644000175000017500000000510710470310070020111 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _DYNSTORE_H_ #define _DYNSTORE_H_ #include "aTypes.h" #include "ProtClas.h" /*===========================================================================*\ \*===========================================================================*/ typedef tUByte *DynStorePointer; /*===========================================================================*\ \*===========================================================================*/ class CDynamicStore { public: CDynamicStore (void); virtual ~CDynamicStore (void); tBool Init (tUInt SizeOfData, tUInt StartCount = 0); DynStorePointer Alloc (void); void Free (DynStorePointer pData); protected: struct Element { Element *next; tUByte data[1]; }; CProtectClass m_Protect; private: Element *pStore; tUInt dataSize; #ifndef NDEBUG tUInt count; #endif }; /*===========================================================================*\ \*===========================================================================*/ class CDynStoreQueue : public CDynamicStore { public: CDynStoreQueue (void); virtual ~CDynStoreQueue (void); void InQueue (DynStorePointer pData); DynStorePointer OutQueue (void); void FreeQueue (void); tBool IsQueueEmpty (void); private: Element *first; Element *last; }; /*===========================================================================*\ \*===========================================================================*/ inline tBool CDynStoreQueue::IsQueueEmpty (void) { return (first) ? vFalse : vTrue; } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/LinePars.cpp0000644000175000017500000000715410470310070020416 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "LinePars.h" #include "aString.h" #include "dbgSTD.h" /*===========================================================================*\ \*===========================================================================*/ tBool ParseConfigLine (CDynamicString *StrLine, CMultiString *WordList) { dhead ("ParseConfigLine", DCON_ConfigParser); dassert (StrLine != 0); dassert (WordList != 0); COneMultiString *newWord; tString startPos; tUInt rest = StrLine->GetLen(); tString lauf = StrLine->GetPointer(); dassert ((lauf == 0) || (rest != 0)); do { for (; rest > 0; rest--, lauf++) { dassert (*lauf != '\0'); if ((*lauf != ' ') && (*lauf != '\t')) { break; } } if (rest) { rest--; startPos = lauf; switch (*lauf++) { default: for (; rest > 0; rest--, lauf++) { dassert (*lauf != '\0'); if ((s_findfirstchar (*lauf, (tUChar *)" \t=:,-[{}]") != 0) && (*(lauf - 1) != '\\')) { break; } } break; case '"': for (; rest > 0; rest--, lauf++) { dassert (*lauf != '\0'); if ((*lauf == '"') && (*(lauf - 1) != '\\')) { // the last " must included to this word lauf++; rest--; break; } } break; case '[': //for (; rest > 0; rest--, lauf++) { // dassert (*lauf != '\0'); // if ((*lauf == ']') && (*(lauf - 1) != '\\')) { // break; // } //} //break; case ']': case '{': case '}': case '=': case ':': case ',': case '-': //case ';': break; case '#': if (rest) { lauf += rest; rest = 0; } break; } newWord = new COneMultiString; if (!newWord || (newWord->Set (startPos, lauf - startPos) == vFalse)) { delete newWord; return vFalse; } dprint ("AddWord=%s(%x)\n", newWord->GetPointer(), newWord->GetLen()); WordList->AddLast (newWord); } } while (rest > 0); return vTrue; } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/standard/DbgInfo.h0000644000175000017500000002666110470310070017662 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _DBGINFO_H_ #define _DBGINFO_H_ #include "aTypes.h" #include "ExtFuncs.h" /*---------------------------------------------------------------------------*\ Debug- und Print-Levels \*---------------------------------------------------------------------------*/ #define Dbg_Level_Nothing 0x00 // Wirklich nichts ausgeben #define Dbg_Level_Errors 0x01 // Nur Asserts und Errors #define Dbg_Level_Infos 0x02 // Assert, Errors, Warnungen und Infos #define Dbg_Level_Logs 0x03 // Assert, Errors, Warnungen, Infos und Logs #define Dbg_Level_Short 0x04 // -"- und der Funktionsaufruf (inkl. Parameter) #define Dbg_Level_Entry 0x06 // -"- und Funktionsaufrufe und -ende (inkl. Parameter) #define Dbg_Level_Internal 0x07 // Alles wird ausgegeben // Print-Ausgabe von: #define Prt_Level_NoFunctionName 0x0000 // Keine Ausgabe des Funktonsnamen #define Prt_Level_NameInEveryLine 0x0040 // Name der Funkton bei jeder // Print-Ausgabe angeben #define Prt_Level_NameAtFuncStart 0x0080 // Name der Funktion nur am Funktions- // Ein- & Austrittspunkt angeben #define Prt_Level_FileNameAtStart 0x0100 // Dateiname nur beim Funktionsaufruf #define Prt_Level_FileNameAtInfo 0x0200 // Dateiname vor jeder Debug-Ausgabe #define Prt_Level_FuncNameAtError 0x0400 // Funktionsname statt Dateiname bei Fehlern #define Prt_Level_Default (Prt_Level_NameAtFuncStart | \ Prt_Level_FileNameAtInfo) /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define _USE_DEBUG_INFO_CLASS_NONE 0 // Reihenfolge wichtig!! #define _USE_DEBUG_INFO_CLASS_EMULATION 1 // noch nicht ganz implementiert #define _USE_DEBUG_INFO_CLASS_NORMAL 2 #ifndef USE_DEBUG_INFO_CLASS #error USE_DEBUG_INFO_CLASS not defined! #endif /*---------------------------------------------------------------------------*\ Activate Assert-BreakPoints \*---------------------------------------------------------------------------*/ #if (USE_DEBUG_INFO_CLASS == _USE_DEBUG_INFO_CLASS_NONE) #define dActivateBreakPoint(activate) #else void dActivateBreakPoint (tBool activate); #endif /*---------------------------------------------------------------------------*\ dwriteE & dwriteI \*---------------------------------------------------------------------------*/ #if (USE_DEBUG_INFO_CLASS == _USE_DEBUG_INFO_CLASS_NONE) #define dwriteErr(DL, format) #define dwriteWrn(DL, format) #define dwriteLog(DL, format) #define dwriteS(DL, format) #define dwriteE(DL, format) #define dwriteI(DL, format) #else void dwriteErr (unsigned DL, char *format, ...); // Logs void dwriteWrn (unsigned DL, char *format, ...); // Logs void dwriteLog (unsigned DL, char *format, ...); // Logs void dwriteS (unsigned DL, char *format, ...); // Short void dwriteE (unsigned DL, char *format, ...); // Entry void dwriteI (unsigned DL, char *format, ...); // Internal #endif #if (USE_DEBUG_INFO_CLASS == _USE_DEBUG_INFO_CLASS_NONE) /*---------------------------------------------------------------------------*\ Release Makros \*---------------------------------------------------------------------------*/ #define dhead(name, DL) #define dheadP(name, DL, PL) #define dprintBuf(data, length) #define dassert(expr) #define dwarning(expr) #define dvalue(val) (val) #define RETURN(format, retval) return (retval) #ifdef __linux__ #define dparams(format, x...) #define dprint(format, x...) #define dprintWrn(format, x...) #define dprintErr(format, x...) #define dinfo(expression, format, x...) #else #pragma warning (disable: 4002) // Ignore: "too many parameters for macro" #define dparams(format) #define dprint(format) #define dprintWrn(format) #define dprintErr(format) #define dinfo(expression, format) #endif #elif (USE_DEBUG_INFO_CLASS == _USE_DEBUG_INFO_CLASS_EMULATION) /*---------------------------------------------------------------------------*\ Debug-Ausgaben direkt ohne die DebugInfoClass TODO: noch nicht vollständig implementiert!!!!! \*---------------------------------------------------------------------------*/ #define dhead(name, DL) char *_CDI_Object_Name = (name); \ tUInt _CDI_Object_Level = (DL); \ if (_CDI_Object_Level >= Dbg_Level_Short) { \ DbgIPrintFull (NAMEATFUNCSTART_BEGIN "%s%s" \ NAMEATFUNCSTART_END, \ DbgIPrintLinePrefix, \ _CDI_Object_Name); \ } #define dheadP(name, DL, PL) char *_CDI_Object_Name = (name); \ tUInt _CDI_Object_Level = (DL); \ if (_CDI_Object_Level >= Dbg_Level_Short) { \ DbgIPrintFull (NAMEATFUNCSTART_BEGIN "%s%s" \ NAMEATFUNCSTART_END, \ DbgIPrintLinePrefix, \ _CDI_Object_Name); \ } #define dparams if (_CDI_Object_Level >= Dbg_Level_Entry) DbgIPrintParams #define dprint if (_CDI_Object_Level >= Dbg_Level_Internal) DbgIPrintFull #define dprintBuf(data, length) if (_CDI_Object_Level >= Dbg_Level_Internal) DbgIPrintBuf #define dprintWrn if (_CDI_Object_Level >= Dbg_Level_Infos) DbgIPrintFull #define dprintErr DbgIPrintFull #define dwarning(expr) if (_CDI_Object_Level >= Dbg_Level_Infos) DbgIAssert (expr) #define dassert(expr) DbgIAssert (expr) #define dinfo if (_CDI_Object_Level >= Dbg_Level_Infos) DbgIPrintInfo #define dvalue(val) ((_CDI_Object_Level >= Dbg_Level_Internal) ? \ DbgIPrintValue (val, #val, __FILE__, __LINE__) : (val)) #define RETURN(format, retval) if (_CDI_Object_Level >= Dbg_Level_Short) { \ DbgIPrintFull (RETURNVALUE_BEGIN "%x" \ RETURNVALUE_END NAMEATFUNCEND_BEGIN \ "%s" NAMEATFUNCEND_END, (retval), \ _CDI_Object_Name); \ } \ return (retval) #elif (USE_DEBUG_INFO_CLASS >= _USE_DEBUG_INFO_CLASS_NORMAL) /*---------------------------------------------------------------------------*\ Includes nur fürs Debuggen \*---------------------------------------------------------------------------*/ #include #include "CDbgIDS.h" /*---------------------------------------------------------------------------*\ Debug Makros & Funktionen \*---------------------------------------------------------------------------*/ #define dhead(name, DL) CDebugInfo _CDI_Object (name, DL, Prt_Level_Default, __FILE__, __LINE__) #define dheadP(name, DL, PL) CDebugInfo _CDI_Object (name, DL, PL, __FILE__, __LINE__) //void dparams (const char *format, ...); #define dparams _CDI_Object.PrintParams //int dprint (const char *format, ...); #define dprint _CDI_Object.print #define dprintBuf(data, length) _CDI_Object.printBuf (data, length) #define dprintWrn _CDI_Object.printWrn #define dprintErr _CDI_Object.printErr #define dassert(expr) (void) ((expr) || (_CDI_Object.assertion (#expr, __LINE__), 0)) #define dwarning(expr) (void) ((expr) || (_CDI_Object.warning (#expr, __LINE__), 0)) //int dinfo (const int expression, const char *format, ...); #define dinfo _CDI_Object.info #define dvalue(val) _CDI_Object.printValue (val, #val, __LINE__) #define RETURN(format, retval) _CDI_Object.SetRetVal ((format), (retval)); \ return (retval) /*---------------------------------------------------------------------------*\ CDebugInfo - Class \*---------------------------------------------------------------------------*/ class CDebugInfo { public: CDebugInfo (char *FuncName, unsigned DebugLevel, unsigned PrintLevel, char *_FileName = "?", unsigned _LineNumber = 0); virtual ~CDebugInfo (void); void print (const char *format, ...); void printBuf (const void *data, unsigned length); unsigned printValue (unsigned val, const char *sval, const unsigned int line); void printWrn (const char *format, ...); void printErr (const char *format, ...); void assertion (const char *exp, const unsigned int line); void assertion (const int expValue, const char *exp, const char *fname, const unsigned int line); void warning (const char *output, const unsigned int line); void warning (const int expression, const char *output, const char *fname, const unsigned int line); void info (const int expression, const char *format, ...); void PrintParams (const char *format, ...); void SetRetVal (const char format, ...); void ShowAllOutputs (void); protected: void RememberOutput (const char *format, ...); void vRememberOutput (const char *format, va_list param); private: char *name; char *filename; unsigned linenumber; unsigned debuglevel; unsigned printlevel; unsigned spaces; CDbgIDynString Output; struct RetValueStruct { char format; union { void *p; char *s; char c; tUInt u; tSInt i; tBool b; }; } RetValue; void DbgPrintIntern (void); }; #endif /* (USE_DEBUG_INFO_CLASS) */ /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #endif capi4hylafax-svn/src/standard/ConfPars.h0000644000175000017500000000610310470310070020052 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _CONFPARS_H_ #define _CONFPARS_H_ #include "LinePars.h" #include "MultiStr.h" #include "InfoType.h" /*---------------------------------------------------------------------------*\ tSInfo - Values \*---------------------------------------------------------------------------*/ #define iErr_IniFile_WrongAssignCoding CalculateInfoValue (infoType_IniFile, infoKind_Error, 1) #define iErr_IniFile_TwoMuchSectionEnds CalculateInfoValue (infoType_IniFile, infoKind_Error, 2) #define iErr_IniFile_ParamCombination CalculateInfoValue (infoType_IniFile, infoKind_Error, 3) /*===========================================================================*\ \*===========================================================================*/ class CConfigParserValue : public CPointerListElement { public: CDynamicString Name; CMultiString DataList; }; class CConfigParserSection : public CPointerListElement { public: CConfigParserSection (void) { pUpperSection = 0; } virtual ~CConfigParserSection (void) { pUpperSection = 0; } CConfigParserSection *pUpperSection; CPointerList SectionList; CPointerList ValueList; }; /*===========================================================================*\ \*===========================================================================*/ class CConfigGrammarParser : private CConfigLineParser { public: CConfigGrammarParser (CConfigParserSection *pMainSection = 0); virtual ~CConfigGrammarParser (void); tBool ReinitMainSection (void); CConfigParserSection *GetMainSection (void); tSInfo ParseLine (CDynamicString *StrLine); // StrLine == 0 => Finish tSInfo ParseWords (CMultiString *WordList); // WordList == 0 => Finish private: CConfigParserSection *pMainSec; CConfigParserSection *pCurSec; }; /*===========================================================================*\ \*===========================================================================*/ inline CConfigParserSection *CConfigGrammarParser::GetMainSection (void) { return pMainSec; } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/Eventing.h0000644000175000017500000000313010470310070020113 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _EVENTING_H_ #define _EVENTING_H_ #include "aTypes.h" /*===========================================================================*\ \*===========================================================================*/ typedef tHandle thEvent; tBool Event_Create (thEvent *pEvent); void Event_Destroy (thEvent *pEvent); void Event_Set (thEvent event); void Event_Clear (thEvent event); tBool Event_Wait (thEvent event, tUInt TimeInMSec = 0); // TimeInMSec == 0 => wait infinite // return: vFalse => Timer was executed /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/StdList.cpp0000644000175000017500000002441610470310070020267 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "StdList.h" #include "dbgSTD.h" /*===========================================================================*\ \*===========================================================================*/ CStandardList::CStandardList (tBool AutoSort) : m_AutoSort (AutoSort), m_count (0) { dhead ("CStandardList-Constructor", DCON_CStandardList); Protect_Create (&m_hProtect); m_pLow = m_pHigh = this; } /*===========================================================================*\ \*===========================================================================*/ CStandardList::~CStandardList (void) { dhead ("CStandardList-Destructor", DCON_CStandardList); RemoveAndDeleteAll(); Protect_Destroy (&m_hProtect); } /*===========================================================================*\ \*===========================================================================*/ tBool CStandardList::AddLow (CListElement *pNew, CListElement *pCur) { dhead ("CStandardList::AddLow", DCON_CStandardList); dassert (pNew != 0); tBool fret = vFalse; // TODO: check if pCur is in the List if (m_AutoSort == vTrue) { void *RefData = pNew->GetRefCompData(); // TODO: Implementieren mittels Find and Get Protect_BeginWrite (m_hProtect); if (!pCur) { pCur = m_pLow; } switch (pCur->Compare (RefData)) { case vLower: pCur = pCur->m_pLow; while (pCur->Compare (RefData) == vLower) { pCur = pCur->m_pLow; } pCur = pCur->m_pHigh; break; case vEqual: if (pCur == this) { break; } fret = vTrue; // no break! case vHigher: dprint ("-Wrong Direction- "); dwarning (0); pCur = pCur->m_pHigh; while ((pCur != this) && (pCur->Compare (RefData) != vLower)) { pCur = pCur->m_pHigh; } break; } if ((pCur->m_pLow != this) && (pCur->m_pLow->Compare (RefData) == vEqual)) { fret = vTrue; } } else { Protect_BeginWrite (m_hProtect); if (!pCur) { pCur = this; } } pCur->m_pLow->m_pHigh = pNew; pNew->m_pLow = pCur->m_pLow; pNew->m_pHigh = pCur; m_count++; Protect_EndWrite (m_hProtect); RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ tBool CStandardList::AddHigh (CListElement *pNew, CListElement *pCur) { dhead ("CStandardList::AddHigh", DCON_CStandardList); dassert (pNew != 0); tBool fret = vFalse; // TODO: check if pCur is in the List if (m_AutoSort == vTrue) { void *RefData = pNew->GetRefCompData(); // TODO: Implementieren mittels Find and Get Protect_BeginWrite (m_hProtect); if (!pCur) { pCur = m_pHigh; } switch (pCur->Compare (RefData)) { case vHigher: pCur = pCur->m_pHigh; while (pCur->Compare (RefData) == vHigher) { pCur = pCur->m_pHigh; } pCur = pCur->m_pLow; break; case vEqual: if (pCur == this) { break; } // no break! case vLower: dprint ("-Wrong Direction- "); dwarning (0); pCur = pCur->m_pLow; while ((pCur != this) && (pCur->Compare (RefData) != vHigher)) { pCur = pCur->m_pLow; } break; } if ((pCur->m_pHigh != this) && (pCur->m_pHigh->Compare (RefData) == vEqual)) { fret = vTrue; } } else { Protect_BeginWrite (m_hProtect); if (!pCur) { pCur = this; } } pCur->m_pHigh->m_pLow = pNew; pNew->m_pHigh = pCur->m_pHigh; pNew->m_pLow = pCur; m_count++; Protect_EndWrite (m_hProtect); RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ tBool CStandardList::GetLow (void *ppGet, CListElement *pCur) { dhead ("CStandardList::GetLow", DCON_CStandardList); dassert (ppGet != 0); Protect_BeginRead (m_hProtect); pCur = (pCur) ? pCur->m_pLow : m_pLow; if (pCur != this) { *(CListElement **)ppGet = pCur; Protect_EndRead (m_hProtect); RETURN ('x', vTrue); } *(CListElement **)ppGet = 0; Protect_EndRead (m_hProtect); RETURN ('x', vFalse); } /*===========================================================================*\ \*===========================================================================*/ tBool CStandardList::GetHigh (void *ppGet, CListElement *pCur) { dhead ("CStandardList::GetHigh", DCON_CStandardList); dassert (ppGet != 0); Protect_BeginRead (m_hProtect); pCur = (pCur) ? pCur->m_pHigh : m_pHigh; if (pCur != this) { *(CListElement **)ppGet = pCur; Protect_EndRead (m_hProtect); RETURN ('x', vTrue); } *(CListElement **)ppGet = 0; Protect_EndRead (m_hProtect); RETURN ('x', vFalse); } /*===========================================================================*\ \*===========================================================================*/ tResult CStandardList::FindLow (ctFindFunc func, void *RefData, void *ppFind, CListElement *pCur) { dhead ("CStandardList::FindLow", DCON_CStandardList); tResult fret = vNo; while (GetLow (&pCur, pCur) == vTrue) { dassert (pCur != 0); fret = func (pCur, RefData); if (fret != vNo) { if (ppFind) { *(CListElement **)ppFind = pCur; } break; } } RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ tResult CStandardList::FindHigh (ctFindFunc func, void *RefData, void *ppFind, CListElement *pCur) { dhead ("CStandardList::FindHigh", DCON_CStandardList); tResult fret = vNo; while (GetHigh (&pCur, pCur) == vTrue) { dassert (pCur != 0); fret = func (pCur, RefData); if (fret != vNo) { if (ppFind) { *(CListElement **)ppFind = pCur; } break; } } RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ tResult CStandardList::FindLow (void *RefCompData, void *ppFind, CListElement *pCur) { dhead ("CStandardList::FindLow", DCON_CStandardList); while (GetLow (&pCur, pCur) == vTrue) { dassert (pCur != 0); switch (pCur->Compare (RefCompData)) { case vEqual: if (ppFind) { *(CListElement **)ppFind = pCur; } RETURN ('x', vYes); case vHigher: if (ppFind) { *(CListElement **)ppFind = pCur; } RETURN ('x', vCancel); case vLower: break; } } RETURN ('x', vNo); } /*===========================================================================*\ \*===========================================================================*/ tResult CStandardList::FindHigh (void *RefCompData, void *ppFind, CListElement *pCur) { dhead ("CStandardList::FindLow", DCON_CStandardList); while (GetHigh (&pCur, pCur) == vTrue) { dassert (pCur != 0); switch (pCur->Compare (RefCompData)) { case vEqual: if (ppFind) { *(CListElement **)ppFind = pCur; } RETURN ('x', vYes); case vLower: if (ppFind) { *(CListElement **)ppFind = pCur; } RETURN ('x', vCancel); case vHigher: break; } } RETURN ('x', vNo); } /*===========================================================================*\ \*===========================================================================*/ void CStandardList::Remove (CListElement *pCur) { dhead ("CStandardList::Remove", DCON_CStandardList); dassert (pCur != 0); dassert (pCur->m_pHigh != 0); dassert (pCur->m_pLow != 0); dassert (m_count > 0); Protect_BeginWrite (m_hProtect); pCur->m_pLow->m_pHigh = pCur->m_pHigh; pCur->m_pHigh->m_pLow = pCur->m_pLow; m_count--; Protect_EndWrite (m_hProtect); pCur->m_pLow = 0; pCur->m_pHigh = 0; } /*===========================================================================*\ \*===========================================================================*/ void CStandardList::RemoveAndDeleteAll (void) { dhead ("CStandardList::RemoveAndDeleteAll", DCON_CStandardList); CListElement *pDel; Protect_BeginWrite (m_hProtect); while (m_pLow != this) { pDel = m_pLow; m_pLow = m_pLow->m_pLow; m_pLow->m_pHigh = this; delete pDel; } m_count = 0; dassert (m_pLow == this); dassert (m_pHigh == this); Protect_EndWrite (m_hProtect); } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/standard/StdArray.cpp0000644000175000017500000004306010470310070020426 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "StdArray.h" #include "dbgSTD.h" #include "aString.h" /*===========================================================================*\ CStandardArray - Constructor \*===========================================================================*/ CStandardArray::CStandardArray (tUInt MaxCountOfItems, tUInt SizeOfItem) : Array (0), ArrayEmpty (0), count (0), emptyCount (0), maxCount (0), sizeCopy (SizeOfItem), sizeItem (SizeOfItem + (sizeof (void*) - (SizeOfItem % sizeof (void*))) % sizeof (void*)) { dhead ("CStandardArray-Constructor", DCON_CStandardArray); // The stuff value ensure that each item will be alinged at pointer boundaries. // tUInt stuff = (sizeof (void*) - (SizeOfItem % sizeof (void*))) % sizeof (void*); dassert (MaxCountOfItems > 0); dassert (SizeOfItem > 0); dassert ((MaxCountOfItems / 10) * ((sizeItem)/ 10) <= (MAXVAL_tUInt / 100)); Protect_InitHandle (&hProtect); Resize (MaxCountOfItems); } /*===========================================================================*\ CStandardArray - Destructor \*===========================================================================*/ CStandardArray::~CStandardArray (void) { dhead ("CStandardArray-Destructor", DCON_CStandardArray); tUChar *tmpArray; tUChar *tmpArrayEmpty; Protect_BeginWrite (hProtect); sizeItem = 0; count = 0; emptyCount = 0; maxCount = 0; tmpArray = Array; tmpArrayEmpty = ArrayEmpty; Array = 0; Protect_EndWrite (hProtect); delete [] tmpArray; delete [] tmpArrayEmpty; Protect_Destroy (&hProtect); } /*===========================================================================*\ CStandardArray::Set \*===========================================================================*/ tUInt CStandardArray::Set (tUInt pos, void *dataIn, void *dataOut) { dhead ("CStandardArray::Set", DCON_CStandardArray); dparams ("%x,%p,%p", pos, dataIn, dataOut); dassert (dataIn != 0); tUInt fret = 0; Protect_BeginWrite (hProtect); if (count > pos) { fret++; if (ArrayEmpty[pos] != 1) { if (dataOut) { fret++; s_memcpy (dataOut, Array + pos * sizeItem, sizeCopy); } } else { dassert (emptyCount > 0); ArrayEmpty[pos] = 0; emptyCount--; } s_memcpy (Array + pos * sizeItem, dataIn, sizeCopy); Protect_EndWrite (hProtect); } else if (count == pos) { Protect_EndWrite (hProtect); fret = (Append (dataIn) == vFalse) ? 0 : 1; } else { Protect_EndWrite (hProtect); } RETURN ('x', fret); } /*===========================================================================*\ CStandardArray::SetEmpty \*===========================================================================*/ tUInt CStandardArray::SetEmpty (void *dataIn, tUInt *pPos) { dhead ("CStandardArray::SetEmpty", DCON_CStandardArray); dparams ("%p,%p", dataIn, pPos); dassert (dataIn != 0); Protect_BeginWrite (hProtect); if (emptyCount) { tUInt pos; for (tUInt i = 0; i < count; i++) { pos = i * sizeItem; if (ArrayEmpty[i] == 1) { emptyCount--; ArrayEmpty[i] = 0; s_memcpy (Array + pos, dataIn, sizeCopy); if (pPos) { *pPos = i; } Protect_EndWrite (hProtect); return 1; } } } Protect_EndWrite (hProtect); return (Append (dataIn, pPos) == vFalse) ? 0 : 1; } /*===========================================================================*\ CStandardArray::AppendEmpty \*===========================================================================*/ tBool CStandardArray::AppendEmpty (tUInt *pPos) { dhead ("CStandardArray::AppendEmpty", DCON_CStandardArray); dparams ("%p", pPos); tBool fret = vFalse; Protect_BeginWrite (hProtect); if (count < maxCount) { ArrayEmpty[count] = 1; if (pPos) { *pPos = count; } emptyCount++; count++; fret = vTrue; } Protect_EndWrite (hProtect); RETURN ('x', fret); } /*===========================================================================*\ CStandardArray::Append \*===========================================================================*/ tBool CStandardArray::Append (void *dataIn, tUInt *pPos) { dhead ("CStandardArray::Append", DCON_CStandardArray); dparams ("%p,%p", dataIn, pPos); dassert (dataIn != 0); tBool fret = vFalse; Protect_BeginWrite (hProtect); if (count < maxCount) { tUInt pos = count * sizeItem; ArrayEmpty[count] = 0; s_memcpy (Array + pos, dataIn, sizeCopy); if (pPos) { *pPos = count; } count++; fret = vTrue; } Protect_EndWrite (hProtect); RETURN ('x', fret); } /*===========================================================================*\ CStandardArray::Ins \*===========================================================================*/ tBool CStandardArray::Ins (tUInt pos, void *dataIn) { dhead ("CStandardArray::Ins", DCON_CStandardArray); dparams ("%x,%p", pos, dataIn); tBool fret = vFalse; Protect_BeginWrite (hProtect); if (pos == count) { Protect_EndWrite (hProtect); fret = Append (dataIn); } else { if ((pos < count) && (count < maxCount)) { tUInt len = count - pos; s_strmov (ArrayEmpty + pos, sizeof (tUChar), len); ArrayEmpty[pos] = 0; pos *= sizeItem; s_strmov (Array + pos, sizeItem, len * sizeItem); s_memcpy (Array + pos, dataIn, sizeCopy); count++; fret = vTrue; } Protect_EndWrite (hProtect); } RETURN ('x', fret); } /*===========================================================================*\ CStandardArray::Get \*===========================================================================*/ tBool CStandardArray::Get (tUInt pos, void *dataOut) { dhead ("CStandardArray::Get", DCON_CStandardArray); dparams ("%x,%p", pos, dataOut); dassert (dataOut != 0); tBool fret = vFalse; tUInt ix = pos; Protect_BeginRead (hProtect); if (pos < count) { pos *= sizeItem; if (ArrayEmpty[ix] != 1) { s_memcpy (dataOut, Array + pos, sizeCopy); fret = vTrue; } } Protect_EndRead (hProtect); return fret; } /*===========================================================================*\ CStandardArray::Get_Direct \*===========================================================================*/ const void *CStandardArray::Get_Direct (tUInt pos) { dhead ("CStandardArray::Get_Direct", DCON_CStandardArray); dparams ("%x", pos); void *fret = 0; tUInt ix = pos; Protect_BeginRead (hProtect); if (pos < count) { pos *= sizeItem; if (ArrayEmpty[ix] != 1) { fret = Array + pos; } } Protect_EndRead (hProtect); return fret; } /*===========================================================================*\ CStandardArray::GetNext \*===========================================================================*/ tBool CStandardArray::GetNext (void *dataOut, tUInt *FindPos, tUInt StartPos) { dhead ("CStandardArray::GetNext", DCON_CStandardArray); dparams ("%p,%p,%x", dataOut, FindPos, StartPos); tBool fret = vFalse; tUInt pos = 0; Protect_BeginRead (hProtect); for (; StartPos < count; StartPos++) { pos = StartPos * sizeItem; if (ArrayEmpty[StartPos] != 1) { if (dataOut) { s_memcpy (dataOut, Array + pos, sizeCopy); } if (FindPos) { *FindPos = StartPos; } fret = vTrue; break; } } Protect_EndRead (hProtect); RETURN ('x', fret); } /*===========================================================================*\ CStandardArray::GetNext_Direct \*===========================================================================*/ const void *CStandardArray::GetNext_Direct (tUInt *FindPos, tUInt StartPos) { dhead ("CStandardArray::GetNext_Direct", DCON_CStandardArray); dparams ("%p,%x", FindPos, StartPos); void *fret = 0; tUInt pos = 0; Protect_BeginRead (hProtect); for (; StartPos < count; StartPos++) { pos = StartPos * sizeItem; if (ArrayEmpty[StartPos] != 1) { if (FindPos) { *FindPos = StartPos; } fret = Array + pos; break; } } Protect_EndRead (hProtect); return fret; } /*===========================================================================*\ CStandardArray::Del \*===========================================================================*/ tUInt CStandardArray::Del (tUInt pos, void *dataOut) { dhead ("CStandardArray::Del", DCON_CStandardArray); tUInt fret = 0; Protect_BeginWrite (hProtect); if (pos + 1 < count) { fret++; if (ArrayEmpty[pos] == 1) { dassert (emptyCount > 0); emptyCount--; } else if (dataOut) { fret++; s_memcpy (dataOut, Array + pos * sizeItem, sizeCopy); } s_strmov (ArrayEmpty + pos + 1, -1, count - pos - 1); s_strmov (Array + (pos + 1) * sizeItem, -(tSInt)sizeItem, (count - pos - 1) * sizeItem); count--; fret = vTrue; Protect_EndWrite (hProtect); } else if (pos + 1 == count) { Protect_EndWrite (hProtect); fret = DelLast (dataOut); } else { Protect_EndWrite (hProtect); } RETURN ('x', fret); } /*===========================================================================*\ CStandardArray::DelLast \*===========================================================================*/ tUInt CStandardArray::DelLast (void *dataOut) { dhead ("CStandardArray::DelLast", DCON_CStandardArray); tUInt fret = 0; Protect_BeginWrite (hProtect); if (count) { count--; fret++; if (ArrayEmpty[count] == 1) { dassert (emptyCount > 0); emptyCount--; } else if (dataOut) { fret++; s_memcpy (dataOut, Array + count * sizeItem, sizeCopy); } } Protect_EndWrite (hProtect); RETURN ('x', fret); } /*===========================================================================*\ CStandardArray::DelAll \*===========================================================================*/ void CStandardArray::DelAll (void) { dhead ("CStandardArray::DelAll", DCON_CStandardArray); Protect_BeginWrite (hProtect); count = 0; emptyCount = 0; Protect_EndWrite (hProtect); } /*===========================================================================*\ CStandardArray::Clear \*===========================================================================*/ tUInt CStandardArray::Clear (tUInt pos, void *dataOut) { dhead ("CStandardArray::Clear", DCON_CStandardArray); tUInt fret = 0; Protect_BeginWrite (hProtect); if (pos + 1 < count) { if (ArrayEmpty[pos] != 1) { ArrayEmpty[pos] = 1; emptyCount++; dassert (emptyCount <= count); fret++; if (dataOut) { fret++; s_memcpy (dataOut, Array + pos * sizeItem, sizeCopy); } } Protect_EndWrite (hProtect); } else if (pos + 1 == count) { Protect_EndWrite (hProtect); fret = ClearLast (dataOut); } else { Protect_EndWrite (hProtect); } RETURN ('x', fret); } /*===========================================================================*\ CStandardArray::ClearLast \*===========================================================================*/ tUInt CStandardArray::ClearLast (void *dataOut) { dhead ("CStandardArray::ClearLast", DCON_CStandardArray); tUInt fret = 0; Protect_BeginWrite (hProtect); if (count) { tUInt pos = count - 1; if (ArrayEmpty[pos] != 1) { ArrayEmpty[pos] = 1; emptyCount++; dassert (emptyCount <= count); fret++; if (dataOut) { fret++; s_memcpy (dataOut, Array + pos * sizeItem, sizeCopy); } } } Protect_EndWrite (hProtect); RETURN ('x', fret); } /*===========================================================================*\ CStandardArray::ClearAll \*===========================================================================*/ void CStandardArray::ClearAll (void) { dhead ("CStandardArray::ClearAll", DCON_CStandardArray); Protect_BeginWrite (hProtect); for (tUInt i = 0; i < count; i++) { ArrayEmpty[i] = 1; } emptyCount = count; Protect_EndWrite (hProtect); } /*===========================================================================*\ CStandardArray::Find \*===========================================================================*/ tResult CStandardArray::Find (tArrayCompFunc CompFunc, void *ItemFrag, void *dataOut, tUInt *FindPos, tUInt StartPos) { dhead ("CStandardArray::Find", DCON_CStandardArray); dparams ("%p,%p,%p,%p,%x", CompFunc, ItemFrag, dataOut, FindPos, StartPos); dassert (CompFunc != 0); dassert (sizeItem > 0); dwarning (Array != 0); tResult fret = vNo; tUChar *lauf; Protect_BeginRead (hProtect); for (lauf = Array + (StartPos * sizeItem); StartPos < count; StartPos++, lauf += sizeItem) { if (ArrayEmpty [StartPos] != 1) { fret = CompFunc (lauf, ItemFrag); if (fret != vNo) { if (FindPos) { *FindPos = StartPos; } if (dataOut) { s_memcpy (dataOut, lauf, sizeCopy); } break; } } } Protect_EndRead (hProtect); RETURN ('x', fret); } /*===========================================================================*\ CStandardArray::Find_Direct \*===========================================================================*/ void *CStandardArray::Find_Direct (tArrayCompFunc CompFunc, void *ItemFrag, tUInt StartPos) { dhead ("CStandardArray::Find_Direct", DCON_CStandardArray); dparams ("%p,%p,%x", CompFunc, ItemFrag, StartPos); dassert (CompFunc != 0); dassert (sizeItem > 0); dwarning (Array != 0); tResult fret; Protect_BeginRead (hProtect); for (tUChar *lauf = Array + (StartPos * sizeItem); StartPos < count; StartPos++, lauf += sizeItem) { if (ArrayEmpty [StartPos] != 1) { fret = CompFunc (lauf, ItemFrag); if (fret != vNo) { if (fret == vYes) { Protect_EndRead (hProtect); RETURN ('x', lauf); } break; } } } Protect_EndRead (hProtect); RETURN ('x', 0); } /*===========================================================================*\ CStandardArray::Resize \*===========================================================================*/ tBool CStandardArray::Resize (tUInt newMaxItemCount) { dhead ("CStandardArray::Resize", DCON_CStandardArray); dparams ("%x,old=%x,count=%x", newMaxItemCount, maxCount, count); dassert (newMaxItemCount > 0); dassert ((newMaxItemCount / 10) * (sizeItem / 10) <= (MAXVAL_tUInt / 100)); tBool fret = vFalse; if ( (Protect_IsCreated (hProtect) == vTrue) || (Protect_Create (&hProtect) == vTrue)) { tUChar *newArray = new tUChar [newMaxItemCount * sizeItem]; tUChar *newArrayEmpty = new tUChar [newMaxItemCount ]; tUChar *delArray = newArray; tUChar *delArrayEmpty = newArrayEmpty; Protect_BeginWrite (hProtect); if ((count < newMaxItemCount) && newArray && newArrayEmpty) { if (count) { s_memcpy (newArray , Array , count * sizeItem); s_memcpy (newArrayEmpty, ArrayEmpty, count ); } maxCount = newMaxItemCount; delArray = Array; delArrayEmpty = ArrayEmpty; Array = newArray; ArrayEmpty = newArrayEmpty; fret = vTrue; } Protect_EndWrite (hProtect); delete [] delArray; delete [] delArrayEmpty; } RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/standard/CBTimer.h0000644000175000017500000000622310470310070017627 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _CBTIMER_H_ #define _CBTIMER_H_ #include "aTypes.h" #include "aString.h" #include "Protect.h" /*===========================================================================*\ Definitons for CallBack-Functions \*===========================================================================*/ typedef void (*tCallBackTimerFunc) (void *, void *); typedef class CBasicTimerSupport *(*tBasicTimerInitFunc) (void); /*===========================================================================*\ A Basic Timer class for internal use only \*===========================================================================*/ class CBasicTimerSupport { public: CBasicTimerSupport (void); virtual ~CBasicTimerSupport (void) {} void SetHandles (void *handle1, void *handle2); void SetCallBack (tCallBackTimerFunc func); void DoCallBack (void); static tBool Create (tHandle *pTimer, tBasicTimerInitFunc func); static void Destroy (tHandle *pTimer); private: tCallBackTimerFunc m_func; #ifdef USE_TIMER_POOL CBasicTimerSupport *m_next; #endif void *m_handle1; void *m_handle2; }; /*===========================================================================*\ Timer Pool \*===========================================================================*/ #ifdef USE_TIMER_POOL tUInt BasicTimerPool_Alloc (tUInt count, tBasicTimerInitFunc func); void BasicTimerPool_Free (tUInt count); #endif // USE_TIMER_POOL /*===========================================================================*\ CBasicTimerSupport - inline functions \*===========================================================================*/ inline CBasicTimerSupport::CBasicTimerSupport (void) : m_func (0), #ifdef USE_TIMER_POOL m_next (0), #endif m_handle1 (0), m_handle2 (0) { } inline void CBasicTimerSupport::SetHandles (void *handle1, void *handle2) { m_handle1 = handle1; m_handle2 = handle2; } inline void CBasicTimerSupport::SetCallBack (tCallBackTimerFunc func) { m_func = func; } inline void CBasicTimerSupport::DoCallBack (void) { // dassert (m_func != 0); m_func (m_handle1, m_handle2); } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/ProtClas.h0000644000175000017500000002353110470310070020072 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _PROTCLAS_H_ #define _PROTCLAS_H_ #define USE_TEMPLATE_FUNCTIONALITY #include "Protect.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define UNIQUE_INIT_VALUE (tUInt)0 typedef tBool (*tProtectUniqueFunc) (void *); class CProtectUniqueClass { public: CProtectUniqueClass (void) : m_Counter (UNIQUE_INIT_VALUE) {} virtual ~CProtectUniqueClass (void) {} virtual tBool SynchronFunc (void) = 0; private: tUInt m_Counter; friend class CProtectClass; friend void basicUniqueCall (CProtectUniqueClass *pPUC); }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #ifdef USE_TEMPLATE_FUNCTIONALITY template inline tBool basicTestAndSet (T *pVar, T testVal, T setVal) { if (*pVar != testVal) { return vFalse; } *pVar = setVal; return vTrue; } template inline T basicInc (T *pVar) { tUInt fret = *pVar; (*pVar)++; return fret; } template inline T basicDec (T *pVar) { tUInt fret = *pVar; (*pVar)--; return fret; } #else inline tBool basicTestAndSet (tUInt *pVar, tUInt testVal, tUInt setVal) { if (*pVar != testVal) { return vFalse; } *pVar = setVal; return vTrue; } inline tUInt basicInc (tUInt *pVar) { tUInt fret = *pVar; (*pVar)++; return fret; } inline tUInt basicDec (tUInt *pVar) { tUInt fret = *pVar; (*pVar)--; return fret; } #endif /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tBool basicUniqueStart (tUInt *pCounter) { (*pCounter)++; return (*pCounter) == UNIQUE_INIT_VALUE + 1; } inline tBool basicUniqueStop (tUInt *pCounter) { (*pCounter)--; return (*pCounter) == UNIQUE_INIT_VALUE; } inline void basicUniqueClear (tUInt *pCounter) { *pCounter = UNIQUE_INIT_VALUE; } inline void basicUniqueCall (tUInt *pCounter, tProtectUniqueFunc Func, void *Handle) { if (basicUniqueStart (pCounter)) { do { if (Func (Handle) == vFalse) { basicUniqueClear (pCounter); return; } } while (basicUniqueStop (pCounter) == vFalse); } } inline void basicUniqueCall (CProtectUniqueClass *pPUC) { if (basicUniqueStart (&pPUC->m_Counter)) { do { if (pPUC->SynchronFunc() == vFalse) { basicUniqueClear (&pPUC->m_Counter); return; } } while (basicUniqueStop (&pPUC->m_Counter) == vFalse); } } /*===========================================================================*\ \*===========================================================================*/ class CProtectClass { public: CProtectClass (void); virtual ~CProtectClass (void); tBool Init (void); // Init can be called multiple times!! tBool IsInitialized (void); // Mainly for debuging purpose void BeginRead (void); void EndRead (void); void BeginWrite (void); void EndWrite (void); // Set, Add, Sub, Inc & Dec return always the old/previous value of pVar!! #ifdef USE_TEMPLATE_FUNCTIONALITY template T Get (T *pVar) { BeginRead(); T fret = *pVar; EndRead(); return fret; } template T Set (T *pVar, T value) { BeginWrite(); T fret = *pVar; *pVar = value; EndWrite(); return fret; } template tBool TestAndSet (T *pVar, T testVal, T setVal) { tBool fret = vFalse; BeginWrite(); if (*pVar == testVal) { *pVar = setVal; fret = vTrue; } EndWrite(); return fret; } template T Add (T *pVar, T value) { BeginWrite(); T fret = *pVar; *pVar += value; EndWrite(); return fret; } template T Sub (T *pVar, T value) { BeginWrite(); T fret = *pVar; *pVar -= value; EndWrite(); return fret; } template T Inc (T *pVar) { BeginWrite(); T fret = *pVar; (*pVar)++; EndWrite(); return fret; } template T Dec (T *pVar) { BeginWrite(); T fret = *pVar; (*pVar)--; EndWrite(); return fret; } #else tUInt Get (tUInt *pVar); tBool Get (tBool *pVar); tUInt Set (tUInt *pVar, tUInt value); tBool Set (tBool *pVar, tBool value); tBool TestAndSet (tUInt *pVar, tUInt testVal, tUInt setVal); tUInt Add (tUInt *pVar, tUInt value); tUInt Sub (tUInt *pVar, tUInt value); tUInt Inc (tUInt *pVar); tUInt Dec (tUInt *pVar); #endif tBool UniqueStart (tUInt *pCounter); tBool UniqueStop (tUInt *pCounter); void UniqueClear (tUInt *pCounter); void UniqueCall (tUInt *pCounter, tProtectUniqueFunc Func, void *Handle); void UniqueCall (CProtectUniqueClass *pPUC); private: Protect_Define (m_hProtect); }; /*===========================================================================*\ CProtectClass - inline functions \*===========================================================================*/ inline CProtectClass::CProtectClass (void) { Protect_InitHandle (&m_hProtect); (void)Protect_Create (&m_hProtect); } inline CProtectClass::~CProtectClass (void) { Protect_Destroy (&m_hProtect); } inline tBool CProtectClass::Init (void) { return Protect_IsCreated (m_hProtect) ? vTrue : Protect_Create (&m_hProtect); } inline tBool CProtectClass::IsInitialized (void) { return Protect_IsCreated (m_hProtect) ? vTrue : vFalse; } inline void CProtectClass::BeginRead (void) { Protect_BeginRead (m_hProtect); } inline void CProtectClass::EndRead (void) { Protect_EndRead (m_hProtect); } inline void CProtectClass::BeginWrite (void) { Protect_BeginWrite (m_hProtect); } inline void CProtectClass::EndWrite (void) { Protect_EndWrite (m_hProtect); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #ifndef USE_TEMPLATE_FUNCTIONALITY inline tUInt CProtectClass::Get (tUInt *pVar) { BeginRead(); tUInt fret = *pVar; EndRead(); return fret; } inline tBool CProtectClass::Get (tBool *pVar) { BeginRead(); tBool fret = *pVar; EndRead(); return fret; } inline tUInt CProtectClass::Set (tUInt *pVar, tUInt value) { BeginWrite(); tUInt fret = *pVar; *pVar = value; EndWrite(); return fret; } inline tBool CProtectClass::Set (tBool *pVar, tBool value) { BeginWrite(); tBool fret = *pVar; *pVar = value; EndWrite(); return fret; } inline tBool CProtectClass::TestAndSet (tUInt *pVar, tUInt testVal, tUInt setVal) { tBool fret = vFalse; BeginWrite(); if (*pVar == testVal) { *pVar = setVal; fret = vTrue; } EndWrite(); return fret; } inline tUInt CProtectClass::Add (tUInt *pVar, tUInt value) { BeginWrite(); tUInt fret = *pVar; *pVar += value; EndWrite(); return fret; } inline tUInt CProtectClass::Sub (tUInt *pVar, tUInt value) { BeginWrite(); tUInt fret = *pVar; *pVar -= value; EndWrite(); return fret; } inline tUInt CProtectClass::Inc (tUInt *pVar) { BeginWrite(); tUInt fret = *pVar; (*pVar)++; EndWrite(); return fret; } inline tUInt CProtectClass::Dec (tUInt *pVar) { BeginWrite(); tUInt fret = *pVar; (*pVar)--; EndWrite(); return fret; } #endif // !USE_TEMPLATE_FUNCTIONALITY /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tBool CProtectClass::UniqueStart (tUInt *pCounter) { return Inc (pCounter) == UNIQUE_INIT_VALUE; } inline tBool CProtectClass::UniqueStop (tUInt *pCounter) { return Dec (pCounter) == UNIQUE_INIT_VALUE + 1; } inline void CProtectClass::UniqueClear (tUInt *pCounter) { Set (pCounter, UNIQUE_INIT_VALUE); } inline void CProtectClass::UniqueCall (tUInt *pCounter, tProtectUniqueFunc Func, void *Handle) { if (UniqueStart (pCounter)) { do { if (Func (Handle) == vFalse) { UniqueClear (pCounter); return; } } while (UniqueStop (pCounter) == vFalse); } } inline void CProtectClass::UniqueCall (CProtectUniqueClass *pPUC) { if (UniqueStart (&pPUC->m_Counter)) { do { if (pPUC->SynchronFunc() == vFalse) { UniqueClear (&pPUC->m_Counter); return; } } while (UniqueStop (&pPUC->m_Counter) == vFalse); } } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/CDbgIDS.h0000644000175000017500000000417110470310070017501 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _CDBGIDS_H_ #define _CDBGIDS_H_ #include /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define DBGDYNSTRING_STARTMAXLENGTH 200 /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class CDbgIDynString { public: CDbgIDynString (void); ~CDbgIDynString (void); int AddTo (unsigned tabsize, const char *format, ...); int vAddTo (unsigned tabsize, const char *format, va_list param); char *GetLastEntry (void); char *GetAll (void); void Delete (void); unsigned IsEmpty (void); private: unsigned maxlength; unsigned length; unsigned lastlength; char *buffer; char startbuffer[DBGDYNSTRING_STARTMAXLENGTH]; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline unsigned CDbgIDynString::IsEmpty (void) { return (length == 0); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #endif capi4hylafax-svn/src/standard/ExtFuncs.h0000644000175000017500000000471110470310070020101 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _EXTFUNCS_H_ #define _EXTFUNCS_H_ /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #ifndef NDEBUG #define USE_DEBUG_INFO_CLASS 2 #define DEBUG_INDENT_WIDTH 0 //#define DEBUG_FILE_NAME "/tmp/c2faxfcalls.log" #else #define USE_DEBUG_INFO_CLASS 0 #endif /*---------------------------------------------------------------------------*/ #define NAMEATFUNCSTART_BEGIN "" #define NAMEATFUNCSTART_END "<\n" #define NAMEATFUNCEND_BEGIN ">" #define NAMEATFUNCEND_END "\n" #define NAMEINEVERYLINE_BEGIN "\n" #define NAMEINEVERYLINE_END ": " #define NAMEFORSHORT_BEGIN "" #define NAMEFORSHORT_END " " #define PARAMETERS_SHORT_BEGIN "(" #define PARAMETERS_SHORT_END ")\n" #define PARAMETERS_BEGIN "(" #define PARAMETERS_END ")<\n" #define RETURNVALUE_BEGIN "(" #define RETURNVALUE_END ")>" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define DbgIAssert(a) extern char *DbgIPrintLinePrefix; extern unsigned DbgIPrintLinePrefixLen; extern void DbgIPrintStr (char *output); extern void DbgIBreakPoint (void); /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #endif capi4hylafax-svn/src/standard/ConfAssi.cpp0000644000175000017500000001404110470310070020377 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "ConfAssi.h" #include "LinePars.h" #include "dbgSTD.h" #include #include /*===========================================================================*\ \*===========================================================================*/ void ConfigValuesAssignment (CPointerList *ValueList, ConfigAssignment_Item *ItemList) { dhead ("ConfigValuesAssignment", DCON_ConfigParserAssi); dassert (ValueList != 0); dassert (ItemList != 0); ConfigAssignment_Item *lauf; for (CConfigParserValue *curValue = (CConfigParserValue *)ValueList->GetFirst(); curValue != 0; curValue = (CConfigParserValue *)curValue->GetNext()) { dassert (curValue->Name.GetPointer() != 0); dassert (curValue->DataList.GetFirst() != 0); dwarning (((COneMultiString *)curValue->DataList.GetFirst())->GetPointer() != 0); for (lauf = ItemList; (lauf != 0) && (lauf->Name != 0); lauf++) { if (strcasecmp ((char *)curValue->Name.GetPointer(), lauf->Name) == 0) { dprint ("Found %s in ConfigList. ", lauf->Name); switch (lauf->Type) { case ConfigAssignment_String: { COneMultiString *pOMS = (COneMultiString *)curValue->DataList.GetFirst(); if (pOMS) { ((CDynamicString *)lauf->Data)->Set (pOMS); while ((pOMS = pOMS->GetNext()) != 0) { ((CDynamicString *)lauf->Data)->Append (" ", 1); ((CDynamicString *)lauf->Data)->Append (pOMS); } } else { dprint ("Illegal String-Data.\n"); } dprint ("String-Data=%s.\n", ((CDynamicString *)lauf->Data)->GetPointer()); break; } case ConfigAssignment_StringList: dprint ("String-ListData\n"); for (COneMultiString *sl = (COneMultiString *)curValue->DataList.GetFirst(); sl != 0; sl = sl->GetNext()) { COneMultiString *newStr = new COneMultiString; if (newStr) { newStr->Set (sl); ((CPointerList *)lauf->Data)->AddLast (newStr); } } break; case ConfigAssignment_UInt: if ((curValue->DataList.GetFirst())->GetPointer() != 0) { char *Last; tUInt val = strtol ((char *)((COneMultiString *)curValue->DataList.GetFirst())->GetPointer(), &Last, 0); if (*Last == '\0') { dprint ("UInt-Data=%x.\n", val); *((tUInt *)lauf->Data) = val; } else { dprint ("Illegal UInt-Data.\n"); } } else { dprint ("Illegal UInt-Data(2).\n"); } break; } } } } } /*===========================================================================*\ \*===========================================================================*/ tUInt ConfigValuesTestName (CPointerList *ValueList, ConfigAssignment_Item *searchItem) { dhead ("ConfigValuesTestName", DCON_ConfigParserAssi); dassert (ValueList != 0); dassert (searchItem != 0); tUInt fret = 0; for (CConfigParserValue *curValue = (CConfigParserValue *)ValueList->GetFirst(); curValue != 0; curValue = (CConfigParserValue *)curValue->GetNext()) { dassert (curValue->Name.GetPointer() != 0); dassert (curValue->DataList.GetFirst() != 0); dassert (((COneMultiString *)curValue->DataList.GetFirst())->GetPointer() != 0); if (strcasecmp ((char *)curValue->Name.GetPointer(), searchItem->Name) == 0) { fret = 1; switch (searchItem->Type) { case ConfigAssignment_String: if ( (searchItem->Data != 0) && (strcasecmp ((char *)((CDynamicString *)searchItem->Data)->GetPointer(), (char *)((COneMultiString *)curValue->DataList.GetFirst())->GetPointer()) == 0)) { fret = 2; } break; case ConfigAssignment_StringList: // TODO: not implememted yet! break; case ConfigAssignment_UInt: { char *Last; tUInt val = strtol ((char *)((COneMultiString *)curValue->DataList.GetFirst())->GetPointer(), &Last, 0); if ((*Last == '\0') && (searchItem->Data != 0) && (val == *((tUInt *)searchItem->Data))) { fret = 2; } break; } } break; } } RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/standard/SemaFunc.h0000644000175000017500000000313310470310070020040 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _SEMAFUNC_H_ #define _SEMAFUNC_H_ #include "aTypes.h" /*===========================================================================*\ \*===========================================================================*/ typedef tHandle thSemaphore; tBool Semaphore_Create (thSemaphore *pSema); void Semaphore_Destroy (thSemaphore *pSema); void Semaphore_Inc (thSemaphore sema); tBool Semaphore_Wait (thSemaphore sema, tUInt TimeInMSec = 0); // TimeInMSec == 0 => wait infinite // return: vFalse => Timer was executed /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/aString.cpp0000644000175000017500000002510710470310070020306 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "aString.h" #include "aStdLib.h" #include "dbgSTD.h" /*===========================================================================*\ \*===========================================================================*/ void s_strmov (tChar *string, tOffset offset, tSize len) { dhead ("s_strmov", DCON_StringFuncs); tChar *dest; tSInt direct; if (offset < 0) { direct = 1; } else { direct = -1; string += len - 1; } dest = string + offset; for (; len > 0; len--) { *dest = *string; dest += direct; string += direct; } } /*===========================================================================*\ \*===========================================================================*/ void s_strmov (tWiChar *string, tOffset offset, tSize len) { dhead ("s_strmovW", DCON_StringFuncs); tWiChar *dest; tSInt direct; if (offset < 0) { direct = 1; } else { direct = -1; string += len - 1; } dest = string + offset; for (; len > 0; len--) { *dest = *string; dest += direct; string += direct; } } /*===========================================================================*\ \*===========================================================================*/ tUInt s_strclean (tChar *string, tChar *CleanChars) { dhead ("s_strclean", DCON_StringFuncs); dparams ("'%s'(%p),'%s'", string, string, CleanChars); dassert (string != 0); dassert (CleanChars != 0); tUInt count = 0; if (*string != '\0') { dprint (".%c.", *string); while (s_findfirstchar (*string, CleanChars) == 0) { string++; count++; dprint (".%c.", *string); if (*string == '\0') { dprint (" Nothing2Do! "); return count; } } dprint ("cleaning at '%s'(%p). ", string, string); for (tChar *current = string + 1; *current != '\0'; current++) { dprint (".%c.", *current); if (s_findfirstchar (*current, CleanChars) == 0) { dprint ("-"); *string++ = *current; count++; } } dprint ("finished at '%s'(%p). ", string, string); *string = '\0'; } return count; } /*===========================================================================*\ \*===========================================================================*/ tUInt s_strkeep (tChar *string, tChar *KeepChars) { dhead ("s_strkeep", DCON_StringFuncs); dparams ("'%s'(%p),'%s'", string, string, KeepChars); dassert (string != 0); dassert (KeepChars != 0); tUInt count = 0; if (*string != '\0') { dprint (".%c.", *string); while (s_findfirstchar (*string, KeepChars) != 0) { string++; count++; dprint (".%c.", *string); if (*string == '\0') { dprint (" Nothing2Do! "); return count; } } dprint ("starting at '%s'(%p). ", string, string); for (tChar *current = string + 1; *current != '\0'; current++) { dprint (".%c.", *current); if (s_findfirstchar (*current, KeepChars) != 0) { dprint ("-"); *string++ = *current; count++; } } dprint ("finished at '%s'(%p). ", string, string); *string = '\0'; } return count; } /*===========================================================================*\ \*===========================================================================*/ tBool s_strdup (tChar **pDest, const tChar *src, tSize len) { dhead ("s_strdup", DCON_StringFuncs); dassert (pDest != 0); tChar *tmpStr; if (*pDest) { tmpStr = *pDest; *pDest = 0; delete [] tmpStr; } if (src) { if (!len) { len = s_strlen (src); } tmpStr = new tChar [len + 1]; if (!tmpStr) { return vFalse; } s_strncpy (tmpStr, src, len); tmpStr[len] = '\0'; *pDest = tmpStr; } return vTrue; } /*===========================================================================*\ \*===========================================================================*/ tBool s_strdup (tChar **pDest, const tWiChar *src, tSize len) { dhead ("s_strdup_W", DCON_StringFuncs); dassert (pDest != 0); tChar *tmpStr; if (*pDest) { tmpStr = *pDest; *pDest = 0; delete [] tmpStr; } if (src) { if (!len) { len = s_strlen (src); } tmpStr = new tChar [len + 1]; if (!tmpStr) { return vFalse; } s_strncpy (tmpStr, src, len); tmpStr[len] = '\0'; *pDest = tmpStr; } return vTrue; } /*===========================================================================*\ \*===========================================================================*/ tBool s_strdup (tWiChar **pDest, const tChar *src, tSize len) { dhead ("s_strdupW", DCON_StringFuncs); dassert (pDest != 0); tWiChar *tmpStr; if (*pDest) { tmpStr = *pDest; *pDest = 0; delete [] tmpStr; } if (src) { if (!len) { len = s_strlen (src); } tmpStr = new tWiChar [len + 1]; if (!tmpStr) { return vFalse; } s_strncpy (tmpStr, src, len); tmpStr[len] = '\0'; *pDest = tmpStr; } return vTrue; } /*===========================================================================*\ \*===========================================================================*/ tBool s_strdup (tWiChar **pDest, const tWiChar *src, tSize len) { dhead ("s_strdupWW", DCON_StringFuncs); dassert (pDest != 0); tWiChar *tmpStr; if (*pDest) { tmpStr = *pDest; *pDest = 0; delete [] tmpStr; } if (src) { if (!len) { len = s_strlen (src); } tmpStr = new tWiChar [len + 1]; if (!tmpStr) { return vFalse; } s_strncpy (tmpStr, src, len); tmpStr[len] = '\0'; *pDest = tmpStr; } return vTrue; } /*===========================================================================*\ \*===========================================================================*/ tChar *s_findstring (tChar *fullString, tSize fullLen, tChar *search, tSize searchLen) { dhead ("s_findstring", DCON_StringFuncs); dassert (fullString != 0); dassert (fullLen > 0); dassert (search != 0); dassert (searchLen > 0); if (fullLen >= searchLen) { searchLen--; for (fullLen -= searchLen; fullLen > 0; fullLen++, fullString++) { if ( (*fullString == *search) && ( (searchLen == 0) || (s_strncmp (fullString + 1, search + 1, searchLen) == vEqual))) { RETURN ('x', fullString); } } } RETURN ('x', 0); } /*===========================================================================*\ \*===========================================================================*/ tCompare s_strcmp (const tChar *str1, const tWiChar *str2) { dhead ("s_strcmp", DCON_StringFuncs); dassert (str1 != 0); dassert (str2 != 0); tWiChar wchr1; s_charcpy (&wchr1, *str1); while (*str1 && *str2 && (wchr1 == *str2)) { str1++; str2++; s_charcpy (&wchr1, *str1); } // assert (TYPE tCompare == TYPE tSign)! return (tCompare)a_getsign (((tSLong)*str1) - ((tSLong)*str2)); } /*===========================================================================*\ \*===========================================================================*/ tCompare s_strcmp (const tWiChar *str1, const tChar *str2) { dhead ("s_strcmpW", DCON_StringFuncs); dassert (str1 != 0); dassert (str2 != 0); tWiChar wchr2; s_charcpy (&wchr2, *str2); while (*str1 && *str2 && (*str1 == wchr2)) { str1++; str2++; s_charcpy (&wchr2, *str2); } // assert (TYPE tCompare == TYPE tSign)! return (tCompare)a_getsign (((tSLong)*str1) - ((tSLong)*str2)); } /*===========================================================================*\ \*===========================================================================*/ tCompare s_strncmp (const tChar *str1, const tWiChar *str2, tSize len) { dhead ("s_strncmp", DCON_StringFuncs); dassert (str1 != 0); dassert (str2 != 0); dassert (len > 0); tWiChar wchr1; s_charcpy (&wchr1, *str1); while (*str1 && *str2 && (wchr1 == *str2)) { len--; if (!len) { return vEqual; } str1++; str2++; s_charcpy (&wchr1, *str1); } // assert (TYPE tCompare == TYPE tSign)! return (tCompare)a_getsign (((tSLong)*str1) - ((tSLong)*str2)); } /*===========================================================================*\ \*===========================================================================*/ tCompare s_strncmp (const tWiChar *str1, const tChar *str2, tSize len) { dhead ("s_strncmpW", DCON_StringFuncs); dassert (str1 != 0); dassert (str2 != 0); dassert (len > 0); tWiChar wchr2; s_charcpy (&wchr2, *str2); while (*str1 && *str2 && (*str1 == wchr2)) { len--; if (!len) { return vEqual; } str1++; str2++; s_charcpy (&wchr2, *str2); } // assert (TYPE tCompare == TYPE tSign)! return (tCompare)a_getsign (((tSLong)*str1) - ((tSLong)*str2)); } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/standard/DynStore.cpp0000644000175000017500000001442110470310070020443 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "DynStore.h" #include "dbgSTD.h" /*===========================================================================*\ \*===========================================================================*/ CDynamicStore::CDynamicStore (void) : pStore (0), dataSize (0) { dhead ("CDynamicStore-Constructor", DCON_CDynamicStore); m_Protect.Init(); #ifndef NDEBUG count = 0; #endif } /*===========================================================================*\ \*===========================================================================*/ CDynamicStore::~CDynamicStore (void) { dhead ("CDynamicStore-Destructor", DCON_CDynamicStore); #ifndef NDEBUG dassert (count == 0); #endif tUByte *delOne; m_Protect.BeginWrite(); while (pStore) { delOne = (tUByte *)pStore; pStore = pStore->next; m_Protect.EndWrite(); delete [] delOne; m_Protect.BeginWrite(); } m_Protect.EndWrite(); } /*===========================================================================*\ \*===========================================================================*/ tBool CDynamicStore::Init (tUInt SizeOfData, tUInt StartCount) { dhead ("CDynamicStore-Constructor", DCON_CDynamicStore); dassert (SizeOfData > 0); if (m_Protect.Init() == vFalse) { RETURN ('x', vFalse); } Element *newOne; dataSize = SizeOfData + sizeof (Element *); pStore = 0; #ifndef NDEBUG count = 0; #endif for (; StartCount > 0; StartCount--) { newOne = (Element *)new tUByte [dataSize]; if (!newOne) { break; } m_Protect.BeginWrite(); newOne->next = pStore; pStore = newOne; m_Protect.EndWrite(); } RETURN ('x', vTrue); } /*===========================================================================*\ \*===========================================================================*/ DynStorePointer CDynamicStore::Alloc (void) { dhead ("CDynamicStore::Alloc", DCON_CDynamicStore); dassert (dataSize > 0); m_Protect.BeginWrite(); Element *allocOne = pStore; if (pStore) { pStore = pStore->next; #ifndef NDEBUG count++; #endif m_Protect.EndWrite(); } else { m_Protect.EndWrite(); allocOne = (Element *)new tUByte [dataSize]; if (!allocOne) { return 0; } #ifndef NDEBUG else { m_Protect.BeginWrite(); count++; m_Protect.EndWrite(); } #endif } return allocOne->data; } /*===========================================================================*\ \*===========================================================================*/ void CDynamicStore::Free (DynStorePointer pData) { dhead ("CDynamicStore::Free", DCON_CDynamicStore); dassert (dataSize > 0); if (pData) { dassert (pData != 0); pData -= sizeof (Element *); m_Protect.BeginWrite(); ((Element *)pData)->next = pStore; pStore = (Element *)pData; #ifndef NDEBUG dassert (count > 0); count--; #endif m_Protect.EndWrite(); } } /*===========================================================================*\ \*===========================================================================*/ CDynStoreQueue::CDynStoreQueue (void) : first (0), last (0) { dhead ("CDynStoreQueue-Constructor", DCON_CDynamicStore); } /*===========================================================================*\ \*===========================================================================*/ CDynStoreQueue::~CDynStoreQueue (void) { dhead ("CDynStoreQueue-Destructor", DCON_CDynamicStore); FreeQueue(); } /*===========================================================================*\ \*===========================================================================*/ void CDynStoreQueue::InQueue (DynStorePointer pData) { dhead ("CDynStoreQueue::InQueue", DCON_CDynamicStore); dassert (pData != 0); pData -= sizeof (Element *); ((Element *)pData)->next = 0; m_Protect.BeginWrite(); if (last) { last->next = ((Element *)pData); } last = (Element *)pData; if (first == 0) { first = last; } m_Protect.EndWrite(); } /*===========================================================================*\ \*===========================================================================*/ DynStorePointer CDynStoreQueue::OutQueue (void) { dhead ("CDynStoreQueue::OutQueue", DCON_CDynamicStore); DynStorePointer fret = 0; m_Protect.BeginWrite(); if (first) { fret = first->data; first = first->next; if (first == 0) { last = 0; } } m_Protect.EndWrite(); return fret; } /*===========================================================================*\ \*===========================================================================*/ void CDynStoreQueue::FreeQueue (void) { dhead ("CDynStoreQueue::FreeQueue", DCON_CDynamicStore); DynStorePointer delOne = OutQueue(); while (delOne) { Free (delOne); delOne = OutQueue(); } dassert (first == 0); dassert (last == 0); } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/standard/ConfPars.cpp0000644000175000017500000002327010470310070020411 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _CONFPARS_CPP_ #define _CONFPARS_CPP_ #include "ConfPars.h" #include "dbgSTD.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ enum GrammarParseState { ps_SearchName, ps_SearchAssign, ps_SearchData, ps_SearchEnd }; /*===========================================================================*\ \*===========================================================================*/ CConfigGrammarParser::CConfigGrammarParser (CConfigParserSection *pMainSection) { dhead ("CConfigGrammarParser-Constructor", DCON_ConfigParser); if (!pMainSection) { pMainSection = new CConfigParserSection; } pCurSec = pMainSec = pMainSection; } /*===========================================================================*\ \*===========================================================================*/ CConfigGrammarParser::~CConfigGrammarParser (void) { dhead ("CConfigGrammarParser-Destructor", DCON_ConfigParser); // TODO?: delete is not always the best idea here delete pMainSec; pMainSec = 0; } /*===========================================================================*\ \*===========================================================================*/ tBool CConfigGrammarParser::ReinitMainSection (void) { dhead ("CConfigGrammarParser::ReinitMainSection", DCON_ConfigParser); delete pMainSec; pMainSec = new CConfigParserSection; pCurSec = pMainSec; return (pMainSec != 0); } /*===========================================================================*\ \*===========================================================================*/ tSInfo CConfigGrammarParser::ParseLine (CDynamicString *StrLine) { dhead ("CConfigGrammarParser::ParseLine", DCON_ConfigParser); tSInfo fret = i_Okay; if ((StrLine) && (CConfigLineParser::ParseLine (StrLine) == vFalse)) { return iErr_OutOfMemory; } CMultiString *wordList = GetWordList(); dwarning (wordList != 0); if (wordList) { fret = ParseWords (wordList); if ((fret != i_Pending) || (!StrLine)) { wordList->RemoveAndDeleteAll(); } } return fret; } /*===========================================================================*\ \*===========================================================================*/ tSInfo CConfigGrammarParser::ParseWords (CMultiString *WordList) { dhead ("CConfigGrammarParser::ParseWordsX", DCON_ConfigParser); dassert (WordList != 0); COneMultiString *pPStr; // Test for line concernator '\\' pPStr = WordList->GetLast(); if (!pPStr) { dprint (" WordList is EMPTY "); RETURN ('x', i_Okay); } dassert (pPStr->GetLen() > 0); while (pPStr->GetChar (0) == '#') { pPStr = pPStr->GetPrev(); if (!pPStr) { RETURN ('x', i_Okay); } } if ((pPStr->GetLen() == 1) && (pPStr->GetChar (0) == '\\')) { // found line concernator and all later comments COneMultiString *delPStr; while (pPStr) { delPStr = pPStr; pPStr = pPStr->GetNext(); delete delPStr; } RETURN ('x', i_Pending); } // parse words tBool InRange = vFalse; CConfigParserValue *pCurValue = 0; GrammarParseState ParseState = ps_SearchName; // parse current string list while ((pPStr = WordList->GetFirst()) != 0) { dassert (pPStr->GetLen() > 0); dassert (pCurSec != 0); //dprint ("CurWord=%s ", pPStr->GetPointer()); switch (pPStr->GetChar (0)) { case '{': { dprint ("Found: Section OPEN\n"); dassert (pPStr->GetLen() == 1); if (pCurValue) { if (pCurValue->DataList.IsEmpty() == vFalse) { pCurSec->ValueList.AddLast (pCurValue); } else { delete pCurValue; } pCurValue = 0; } CConfigParserSection *newSec = new CConfigParserSection; if (!newSec) { return iErr_OutOfMemory; } newSec->pUpperSection = pCurSec; pCurSec->SectionList.AddLast (newSec); pCurSec = newSec; InRange = vFalse; break; } case '}': dprint ("Found: Section CLOSE\n"); dassert (pPStr->GetLen() == 1); if (pCurValue) { if (pCurValue->DataList.IsEmpty() == vFalse) { pCurSec->ValueList.AddLast (pCurValue); } else { delete pCurValue; } pCurValue = 0; } if (pCurSec->pUpperSection == 0) { return iErr_IniFile_TwoMuchSectionEnds; } pCurSec = pCurSec->pUpperSection; InRange = vFalse; break; case '"': // Remove " if ((pPStr->GetLen() < 2) || (pPStr->GetLastChar() != '"')) { // do nothing !!!! //delete pCurValue; //return i_Err_QuotationError; } else { pPStr->CutLen (1); pPStr->Remove (0, 1); } // TODO?: Remove \ from \" ? // no break! default: if (!pCurValue) { pCurValue = new CConfigParserValue; if (!pCurValue) { delete pCurValue; return iErr_OutOfMemory; } dprint ("Name=%s ", pPStr->GetPointer()); pCurValue->Name.Set (pPStr); ParseState = ps_SearchAssign; } else { switch (ParseState) { case ps_SearchName: case ps_SearchAssign: case ps_SearchEnd: ParseState = ps_SearchName; delete pCurValue; pCurValue = 0; return iErr_IniFile_WrongAssignCoding; case ps_SearchData: if (InRange == vTrue) { COneMultiString *pLast = pCurValue->DataList.GetLast(); dassert (pLast != 0); pLast->Append (pPStr); InRange = vFalse; } else { dprint ("Data=%s ", pPStr->GetPointer()); pPStr->RemoveFromList(); pCurValue->DataList.AddLast (pPStr); pPStr = 0; } break; } } break; case '=': case ':': dassert (pPStr->GetLen() == 1); InRange = vFalse; switch (ParseState) { case ps_SearchData: dwarning (0); break; case ps_SearchAssign: ParseState = ps_SearchData; break; default: delete pCurValue; return iErr_IniFile_WrongAssignCoding; } break; case ',': if (ParseState != ps_SearchData) { delete pCurValue; return iErr_IniFile_WrongAssignCoding; } InRange = vFalse; break; case '-': // Range found if (ParseState != ps_SearchData) { delete pCurValue; return iErr_IniFile_WrongAssignCoding; } if (InRange == vFalse) { InRange = vTrue; if (pCurValue->DataList.IsEmpty()) { pPStr->RemoveFromList(); pCurValue->DataList.AddLast (pPStr); pPStr = 0; } else { COneMultiString *pLast = pCurValue->DataList.GetLast(); dassert (pLast != 0); pLast->Append ("-", 1); } } break; //case ';': // if (pCurValue) { // if (pCurValue->DataList.IsEmpty() == vFalse) { // pCurSec->ValueList.AddLast (pCurValue); // } else { // delete pCurValue; // } // pCurValue = 0; // } // ParseState = ps_SearchName; // break; case '#': InRange = vFalse; break; } delete pPStr; } if (pCurValue) { if (pCurValue->DataList.IsEmpty() == vFalse) { pCurSec->ValueList.AddLast (pCurValue); } else { delete pCurValue; } } RETURN ('x', i_Okay); } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/CBTimer.cpp0000644000175000017500000001271010470310070020160 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "CBTimer.h" #include "dbgSTD.h" /*===========================================================================*\ \*===========================================================================*/ #ifndef USE_TIMER_POOL tBool CBasicTimerSupport::Create (tHandle *pTimer, tBasicTimerInitFunc func) { dhead ("CBasicTimerSupport::Create", DCON_CBasicTimerSupport); dassert (func != 0); *pTimer = (tHandle)func(); dwarning (*pTimer != 0); RETURN ('x', (*pTimer) ? vTrue : vFalse); } void CBasicTimerSupport::Destroy (tHandle *pTimer) { dhead ("CBasicTimerSupport::Destroy", DCON_CBasicTimerSupport); if (*pTimer) { delete (CBasicTimerSupport *)*pTimer; *pTimer = 0; } } /*===========================================================================*\ \*===========================================================================*/ # else // #ifndef USE_TIMER_POOL struct CBTimerPool_Type { CBasicTimerSupport *first; tUInt count; Protect_Define (hProtect); }; static CBTimerPool_Type CBTimerPool = { 0 }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ tBool CBasicTimerSupport::Create (tHandle *pTimer, tBasicTimerInitFunc) { dhead ("CBasicTimer(Pool)Support::Create", DCON_CBasicTimerSupport); dassert (CBTimerPool.count > 0); dassert (pTimer != 0); Protect_BeginWrite (CBTimerPool.hProtect); dwarning (CBTimerPool.first != 0); // Pool has a to small dimension!! if (CBTimerPool.first) { *pTimer = (tHandle)CBTimerPool.first; CBTimerPool.first = CBTimerPool.first->m_next; Protect_EndWrite (CBTimerPool.hProtect); ((CBasicTimerSupport *)*pTimer)->m_next = 0; RETURN ('x', vTrue); } Protect_EndWrite (CBTimerPool.hProtect); *pTimer = 0; RETURN ('x', vFalse); } void CBasicTimerSupport::Destroy (tHandle *pTimer) { dhead ("CBasicTimer(Pool)Support::Destroy", DCON_CBasicTimerSupport); dassert (CBTimerPool.count > 0); dassert (pTimer != 0); dassert (*pTimer != 0); Protect_BeginWrite (CBTimerPool.hProtect); ((CBasicTimerSupport *)*pTimer)->m_next = CBTimerPool.first; CBTimerPool.first = (CBasicTimerSupport *)*pTimer; Protect_EndWrite (CBTimerPool.hProtect); *pTimer = 0; } /*===========================================================================*\ \*===========================================================================*/ tUInt BasicTimerPool_Alloc (tUInt count, tBasicTimerInitFunc func) { dhead ("BasicTimerPool_Alloc", DCON_CBasicTimerSupport); dassert (count > 0); dassert (func != 0); if (CBTimerPool.count == 0) { dprint ("-init- "); if (Protect_Create (&CBTimerPool.hProtect) == vFalse) { dassert (0); return ('x', 0); } } tHandle h; tUInt i = 0; for (; i < count; i++) { h = (tHandle)func(); if (!h) { break; } CBTimerPool.count++; CBasicTimerSupport::Destroy (&h); } if (!CBTimerPool.count) { dwarning (0); // no timer is allocated! Protect_Destroy (&CBTimerPool.hProtect); } dwarning (count == i); RETURN ('x', i); } /*===========================================================================*\ \*===========================================================================*/ void BasicTimerPool_Free (tUInt count) { dhead ("BasicTimerPool_Free", DCON_CBasicTimerSupport); dparams ("%x", count); dassert (CBTimerPool.count > 1); tHandle h; if (count && (count <= CBTimerPool.count)) { for (; count > 0; count--) { if (CBasicTimerSupport::Create (&h, 0) == vFalse) { dassert (0); break; } dassert (h != 0); dassert (CBTimerPool.count > 0); CBTimerPool.count--; delete (CBasicTimerSupport *)h; } } else { while (CBTimerPool.count && (CBasicTimerSupport::Create (&h, 0) == vTrue)) { dassert (CBTimerPool.count > 0); CBTimerPool.count--; dassert (h != 0); delete (CBasicTimerSupport *)h; } dassert (CBTimerPool.count == 0); dassert (CBTimerPool.first == 0); CBTimerPool.count = 0; Protect_Destroy (&CBTimerPool.hProtect); } } /*===========================================================================*\ \*===========================================================================*/ #endif // USE_TIMER_POOL capi4hylafax-svn/src/standard/osmem.h0000644000175000017500000002012110470310070017453 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _osmem_h #define _osmem_h /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #include "aString.h" #define ISALIGNED(p) (0 == (PtrToUlong (p) & 3)) /*===========================================================================*\ \*===========================================================================*/ void* getPtr(tUByte *m); tUInt64 get64 (tUByte *m); tUInt32 get32 (tUByte *m); tUInt16 get16 (tUByte *m); tUByte get8 (tUByte *m); /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ tUInt64 getNBO64 (tUByte *m); // Network Byte Order tUInt32 getNBO32 (tUByte *m); tUInt16 getNBO16 (tUByte *m); tUInt64 getLE64 (tUByte *m); // Little Endian tUInt32 getLE32 (tUByte *m); tUInt16 getLE16 (tUByte *m); tUInt64 getBE64 (tUByte *m); // Big Endian tUInt32 getBE32 (tUByte *m); tUInt16 getBE16 (tUByte *m); /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ tUInt64 getNBO64 (tUInt64 v); tUInt32 getNBO32 (tUInt32 v); tUInt16 getNBO16 (tUInt16 v); tUInt64 getLE64 (tUInt64 v); tUInt32 getLE32 (tUInt32 v); tUInt16 getLE16 (tUInt16 v); tUInt64 getBE64 (tUInt64 v); tUInt32 getBE32 (tUInt32 v); tUInt16 getBE16 (tUInt16 v); /*===========================================================================*\ \*===========================================================================*/ void setPtr (tUByte *m, void *d); void set64 (tUByte *m, tUInt64 d); void set32 (tUByte *m, tUInt32 d); void set16 (tUByte *m, tUInt16 d); void set8 (tUByte *m, tUByte d); /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ void setNBO64 (tUByte *m, tUInt64 d); void setNBO32 (tUByte *m, tUInt32 d); void setNBO16 (tUByte *m, tUInt16 d); void setLE64 (tUByte *m, tUInt64 d); void setLE32 (tUByte *m, tUInt32 d); void setLE16 (tUByte *m, tUInt16 d); void setBE64 (tUByte *m, tUInt64 d); void setBE32 (tUByte *m, tUInt32 d); void setBE16 (tUByte *m, tUInt16 d); /*===========================================================================*\ \*===========================================================================*/ inline void *getPtr (tUByte *m) { #ifdef C_PLATFORM_64 return (void *)get64 (m); #else return (void *)get32 (m); #endif } inline tUInt64 get64 (tUByte *m) { tUInt64 value; s_memcpy (&value, m, sizeof (value)); return value; } inline tUInt32 get32 (tUByte *m) { tUInt32 value; s_memcpy (&value, m, sizeof (value)); return value; } inline tUInt16 get16 (tUByte *m) { tUInt16 value; s_memcpy (&value, m, sizeof (value)); return value; } inline tUByte get8 (tUByte *m) { return *m; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tUInt64 getNBO64 (tUByte *m) { return getBE64 (m); } inline tUInt32 getNBO32 (tUByte *m) { return getBE32 (m); } inline tUInt16 getNBO16 (tUByte *m) { return getBE16 (m); } /*---------------------------------------------------------------------------*\ Implementation for little endian computers \*---------------------------------------------------------------------------*/ inline tUInt64 getLE64 (tUByte *m) { return (((tUInt64)getLE32 (m + sizeof (tUInt32))) << 32) | (tUInt32)getLE32 (m); } inline tUInt32 getLE32 (tUByte *m) { return (((tUInt32)getLE16 (m + sizeof (tUInt16))) << 16) | (tUInt32)getLE16 (m); } inline tUInt16 getLE16 (tUByte *m) { return (tUInt16)((((tUInt16)m[1]) << 8) | (tUInt16)m[0]); } inline tUInt64 getBE64 (tUByte *m) { return (((tUInt64)getBE32 (m)) << 32) | (tUInt32)getBE32 (m + sizeof (tUInt32)); } inline tUInt32 getBE32 (tUByte *m) { return (((tUInt32)getBE16 (m)) << 16) | (tUInt32)getBE16 (m + sizeof (tUInt16)); } inline tUInt16 getBE16 (tUByte *m) { return (tUInt16)((((tUInt16)m[0]) << 8) | (tUInt16)m[1]); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tUInt64 getNBO64 (tUInt64 v) { return getNBO64 ((tUByte *)&v); } inline tUInt32 getNBO32 (tUInt32 v) { return getNBO32 ((tUByte *)&v); } inline tUInt16 getNBO16 (tUInt16 v) { return getNBO16 ((tUByte *)&v); } inline tUInt64 getLE64 (tUInt64 v) { return getLE64 ((tUByte *)&v); } inline tUInt32 getLE32 (tUInt32 v) { return getLE32 ((tUByte *)&v); } inline tUInt16 getLE16 (tUInt16 v) { return getLE16 ((tUByte *)&v); } inline tUInt64 getBE64 (tUInt64 v) { return getBE64 ((tUByte *)&v); } inline tUInt32 getBE32 (tUInt32 v) { return getBE32 ((tUByte *)&v); } inline tUInt16 getBE16 (tUInt16 v) { return getBE16 ((tUByte *)&v); } /*===========================================================================*\ \*===========================================================================*/ inline void setPtr (tUByte *m, void *d) { //assert (m != 0); #ifdef C_PLATFORM_64 set64 (m, (tUInt64)d); #else set32 (m, (tUInt32)d); #endif } inline void set64 (tUByte *m, tUInt64 d) { //assert (m != 0); s_memcpy (m, &d, sizeof (tUInt64)); } inline void set32 (tUByte *m, tUInt32 d) { //assert (m != 0); s_memcpy (m, &d, sizeof (tUInt32)); } inline void set16 (tUByte *m, tUInt16 d) { //assert (m != 0); s_memcpy (m, &d, sizeof (tUInt16)); } inline void set8 (tUByte *m, tUByte d) { //assert (m != 0); *m = d; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline void setNBO64 (tUByte *m, tUInt64 d) { setBE64 (m, d); } inline void setNBO32 (tUByte *m, tUInt32 d) { setBE32 (m, d); } inline void setNBO16 (tUByte *m, tUInt16 d) { setBE16 (m, d); } /*---------------------------------------------------------------------------*\ Implementation for little endian computers \*---------------------------------------------------------------------------*/ inline void setLE64 (tUByte *m, tUInt64 d) { setLE32 (m, (tUInt32)d); setLE32 (m + sizeof (tUInt32), (tUInt32)(d >> 32)); } inline void setLE32 (tUByte *m, tUInt32 d) { setLE16 (m, (tUInt16)d); setLE16 (m + sizeof (tUInt16), (tUInt16)(d >> 16)); } inline void setLE16 (tUByte *m, tUInt16 d) { m[0] = (tUByte)(d & 0xFF); m[1] = (tUByte)(d >> 8); } inline void setBE64 (tUByte *m, tUInt64 d) { setBE32 (m, (tUInt32)(d >> 16)); setBE32 (m + sizeof (tUInt32), (tUInt32)d); } inline void setBE32 (tUByte *m, tUInt32 d) { setBE16 (m, (tUInt16)(d >> 16)); setBE16 (m + sizeof (tUInt16), (tUInt16)d); } inline void setBE16 (tUByte *m, tUInt16 d) { m[0] = (tUByte)(d >> 8); m[1] = (tUByte)(d & 0xFF); } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/DatBlock.h0000644000175000017500000000674410470310070020035 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _DATBLOCK_H_ #define _DATBLOCK_H_ #include "DataPack.h" /*===========================================================================*\ \*===========================================================================*/ class CDataPacketBlocks : public CDataPacket { public: CDataPacketBlocks (tUInt BlockSize = 0); void SetBlockSize (tUInt BlockSize); void Init (CDataPacket *pPacket); void Init (tUByte *pPointer, tUInt Len, void *FirstHandle = 0); void FirstBlock (void); tBool NextBlock (void); tBool IsLastBlock (void); private: tUByte *m_RealPointer; tUInt m_RealMaxLen; tUInt m_RealLen; tUInt m_Delta; tUInt m_Offset; }; /*===========================================================================*\ CDataPacketBlocks - inline functions \*===========================================================================*/ inline CDataPacketBlocks::CDataPacketBlocks (tUInt BlockSize) : m_Delta (BlockSize), m_Offset (0), m_RealPointer (0), m_RealMaxLen (0), m_RealLen (0) {} inline void CDataPacketBlocks::SetBlockSize (tUInt BlockSize) { m_Delta = BlockSize; FirstBlock(); } inline void CDataPacketBlocks::Init (CDataPacket *pPacket) { // assert (pPacket != 0); m_RealPointer = pPacket->GetPointer(); m_RealMaxLen = pPacket->GetMaxLen(); m_RealLen = pPacket->GetLen(); for (tUInt i = DATA_PACKET_HANDLE_COUNT; i > 0;) { i--; SetHandle (pPacket->GetHandle (i), i); } FirstBlock(); } inline void CDataPacketBlocks::Init (tUByte *pPointer, tUInt Len, void *FirstHandle) { m_RealPointer = pPointer; m_RealMaxLen = Len; m_RealLen = Len; SetHandle (FirstHandle); FirstBlock(); } inline void CDataPacketBlocks::FirstBlock (void) { SetPointer (m_RealPointer); m_Offset = 0; if (m_RealLen > m_Delta) { SetMaxLen (m_Delta); SetLen (m_Delta); } else { SetMaxLen (m_RealMaxLen); SetLen (m_RealLen); } SetPos (0); } inline tBool CDataPacketBlocks::NextBlock (void) { m_Offset += m_Delta; if (m_RealLen <= m_Offset) { FirstBlock(); return vFalse; } SetPointer (m_RealPointer + m_Offset); if (m_RealLen <= m_Offset + m_Delta) { SetMaxLen (m_RealMaxLen - m_Offset); SetLen (m_RealLen - m_Offset); } SetPos (0); return vTrue; } inline tBool CDataPacketBlocks::IsLastBlock (void) { return (m_RealLen <= m_Offset + m_Delta) ? vTrue : vFalse; } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/StdList.h0000644000175000017500000000761110470310070017732 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _STDLIST_H_ #define _STDLIST_H_ #include "aTypes.h" #include "Protect.h" /*===========================================================================*\ \*===========================================================================*/ class CListElement { protected: virtual ~CListElement (void) {} // this virtual functions have to be implemented only if sorting is needed virtual tCompare Compare (void *RefCompData); // return: RefCompData [tCompare] this virtual void *GetRefCompData (void); private: CListElement *m_pLow; CListElement *m_pHigh; friend class CStandardList; }; /*===========================================================================*\ \*===========================================================================*/ class CStandardList : private CListElement { public: typedef tResult (*ctFindFunc) (CListElement *pElement, void *RefData); CStandardList (tBool AutoSort = vFalse); virtual ~CStandardList (void); tBool IsEmpty (void); tUInt CountElements (void); // Low = in the lower direction | High = in the higher direction // pCur == 0 => Low: pCur = highest Element, High: pCur = lowest Element // return vFalse => normal, everything okay // vTrue => equal Element already exist. new Element was added // Low = After, High = Before the equal Element tBool AddLow (CListElement *pNew, CListElement *pCur = 0); tBool AddHigh (CListElement *pNew, CListElement *pCur = 0); tBool GetLow (void *ppGet, CListElement *pCur = 0); tBool GetHigh (void *ppGet, CListElement *pCur = 0); // pCur is not included in the search! tResult FindLow (ctFindFunc func, void *RefData = 0, void *ppFind = 0, CListElement *pCur = 0); tResult FindHigh (ctFindFunc func, void *RefData = 0, void *ppFind = 0, CListElement *pCur = 0); tResult FindLow (void *RefCompData, void *ppFind = 0, CListElement *pCur = 0); tResult FindHigh (void *RefCompData, void *ppFind = 0, CListElement *pCur = 0); void Remove (CListElement *pCur); void RemoveAndDeleteAll (void); //void SortNow (void); // not implemented now! private: Protect_Define (m_hProtect); tUInt m_count; tBool m_AutoSort; }; /*===========================================================================*\ CListElement - inline functions \*===========================================================================*/ inline tCompare CListElement::Compare (void *) { return vEqual; } inline void *CListElement::GetRefCompData (void) { return 0; } /*===========================================================================*\ CStandardList - inline Functions \*===========================================================================*/ inline tBool CStandardList::IsEmpty (void) { return (m_count == 0); } inline tUInt CStandardList::CountElements (void) { return m_count; } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/DbgFile.cpp0000644000175000017500000000422510470310070020171 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "ExtFuncs.h" #if defined (DEBUG_FILE_NAME) && (USE_DEBUG_INFO_CLASS > 0) #include "DbgFile.h" #include /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ static FILE *hFile = 0; /*===========================================================================*\ \*===========================================================================*/ unsigned DebugFileOpen (void) { DebugFileClose(); hFile = fopen (DEBUG_FILE_NAME, "w"); return (hFile != 0); } /*===========================================================================*\ \*===========================================================================*/ void DebugFileClose (void) { if (hFile) { fclose (hFile); hFile = 0; } } /*===========================================================================*\ \*===========================================================================*/ void DebugFilePrint (char *string) { if (hFile) { fprintf (hFile, string); fflush (hFile); } else { printf (string); } } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/LoopTime.h0000644000175000017500000000370310470310070020072 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _LOOPTIME_H_ #define _LOOPTIME_H_ #include "CBTimer.h" /*===========================================================================*\ \*===========================================================================*/ typedef tHandle thLoopTimer; tBool LoopTimer_Create (thLoopTimer *pTimer); void LoopTimer_Destroy (thLoopTimer *pTimer); tBool LoopTimer_Start (thLoopTimer timer, tUInt msecs, tCallBackTimerFunc cbfunc, void *handle1 = 0, void *handle2 = 0); void LoopTimer_Change (thLoopTimer timer, tCallBackTimerFunc cbfunc, void *handle1 = 0, void *handle2 = 0); void LoopTimer_Stop (thLoopTimer timer); /*===========================================================================*\ \*===========================================================================*/ #ifdef USE_TIMER_POOL tUInt LoopTimerPool_Alloc (tUInt count); // return successfull allocated Timers void LoopTimerPool_Free (tUInt count = 0); #endif /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/CDbgIDS.cpp0000644000175000017500000001112610470310070020032 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "CDbgIDS.h" #include "aStrPrt.h" #include "ExtFuncs.h" #include "dbgSTD.h" #include /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ CDbgIDynString::CDbgIDynString (void) { //DbgIPrintStr ("DynString-Konstruktor ! "); length = lastlength = 0; maxlength = DBGDYNSTRING_STARTMAXLENGTH; memset (startbuffer, 0, DBGDYNSTRING_STARTMAXLENGTH); buffer = &startbuffer[0]; //buffer = new char [DBGDYNSTRING_STARTMAXLENGTH]; //DbgIPrintStr ("After new char "); //if (buffer) { // maxlength = DBGDYNSTRING_STARTMAXLENGTH; //} } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ CDbgIDynString::~CDbgIDynString (void) { if (buffer != startbuffer) { delete [] buffer; } buffer = 0; maxlength = length = lastlength = 0; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ int CDbgIDynString::AddTo (tUInt tabsize, const char *format, ...) { va_list param; va_start (param, format); int fret = vAddTo (tabsize, format, param); va_end (param); return fret; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ int CDbgIDynString::vAddTo (tUInt tabsize, const char *format, va_list param) { if (!maxlength || !buffer) { return -1; } int newlen = a_vsnprintf_tab (buffer + length, maxlength - length, format, param, tabsize); //if (newlen <= 0) { // char *newbuf = new char [maxlength * 2]; // if (newbuf) { // strcpy (newbuf, buffer); // if (buffer != startbuffer) { // delete [] buffer; // } // buffer = newbuf; // newlen = a_vsnprintf_tab (buffer + length, maxlength - length, format, param, tabsize); // } //} if (newlen > 0) { lastlength = length; length += newlen; } return newlen; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ char *CDbgIDynString::GetLastEntry (void) { //DbgIAssert (maxlength != 0); //DbgIAssert (buffer != 0); //DbgIAssert (length < maxlength); //DbgIAssert (lastlength <= length); if (!length || (lastlength == length) || !maxlength || !buffer) { return 0; } buffer[length] = '\0'; length = lastlength; return (buffer + length); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ char *CDbgIDynString::GetAll (void) { //DbgIAssert (maxlength != 0); //DbgIAssert (buffer != 0); //DbgIAssert (length < maxlength); //DbgIAssert (lastlength <= length); if (!length || !maxlength || !buffer) { return 0; } buffer[length] = '\0'; length = lastlength = 0; return buffer; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ void CDbgIDynString::Delete (void) { //DbgIAssert (maxlength != 0); //DbgIAssert (buffer != 0); //DbgIAssert (length < maxlength); //DbgIAssert (lastlength <= length); length = lastlength = 0; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ capi4hylafax-svn/src/standard/PathName.h0000644000175000017500000000770110470310070020041 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _PATHNAME_H_ #define _PATHNAME_H_ #include "CString.h" #ifndef CPATHNAME_DELIMITER #define CPATHNAME_DELIMITER '/' #endif /*===========================================================================*\ \*===========================================================================*/ class CPathName : public CDynamicString { public: CPathName (void); CPathName (tFormatChar *GlobalPathName); CPathName (CDynamicString *GlobalPathName); tBool SetGlobal (CDynamicString *PathName); tBool SetGlobal (tFormatChar *PathName, tSize len = 0); tBool SetRelative (CDynamicString *RelPathName); tBool SetRelative (tFormatChar *RelPathName, tSize len = 0); tUInt UpperPath (tUInt levels = 1); // return: the remaining levels (=> 0 always means success) void SetDelimiter (tChar delimiter); private: tChar m_Delimiter; }; /*===========================================================================*\ CPathName - inline functions \*===========================================================================*/ inline CPathName::CPathName (void) : m_Delimiter (CPATHNAME_DELIMITER) { } inline CPathName::CPathName (tFormatChar *GlobalPathName) : CDynamicString (GlobalPathName), m_Delimiter (CPATHNAME_DELIMITER) { } inline CPathName::CPathName (CDynamicString *GlobalPathName) : CDynamicString (GlobalPathName), m_Delimiter (CPATHNAME_DELIMITER) { } inline tBool CPathName::SetGlobal (CDynamicString *PathName) { return Set (PathName); } inline tBool CPathName::SetGlobal (tFormatChar *PathName, tSize len) { return Set (PathName, len); } inline tBool CPathName::SetRelative (CDynamicString *RelPathName) { //dassert (RelPathName != 0); if (IsEmpty() == vFalse) { if (GetLastChar() == m_Delimiter) { if (RelPathName->GetChar (0) == m_Delimiter) { // delete one of both delimiters CutLen (1); } } else if ( (RelPathName->GetChar (0) != m_Delimiter) && (Append (&m_Delimiter, 1) == vFalse)) { return vFalse; } } return Append (RelPathName); } inline tBool CPathName::SetRelative (tFormatChar *RelPathName, tSize len) { //dassert (RelPathName != 0); if (IsEmpty() == vFalse) { if (GetLastChar() == m_Delimiter) { if (*RelPathName == m_Delimiter) { // delete one of both delimiters CutLen (1); } } else if ( (*RelPathName != m_Delimiter) && (Append (&m_Delimiter, 1) == vFalse)) { return vFalse; } } return Append (RelPathName, len); } inline tUInt CPathName::UpperPath (tUInt levels) { for (; levels > 0; levels--) { tSize pos = FindLastChar (m_Delimiter); if (pos == MAXVAL_tUInt) { break; } SetLen (pos); } return levels; } inline void CPathName::SetDelimiter (tChar delimiter) { m_Delimiter = delimiter; } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/aStrPrt.h0000644000175000017500000000637610470310070017752 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _ASTRPRT_H_ #define _ASTRPRT_H_ #include #include "aTypes.h" /*===========================================================================*\ vsnprintf Speichert eine formatierte Ausgabe im buffer mit maximal maxcount Zeichen (inklusive abschliessende '\0') Aufbau wie _vsnprintf (stdio.h) mit Besonderheiten im format: %b: "Binäre Ausgabe". Ist der "char"-Parameter 0 wird FALSE ausgegeben, ansonsten TRUE. Wenn nicht genug Platz ist oder die Precision auf 1 eingestellt wurde verkürzt sich die Ausgabe auf 'T' und 'F'. %t: Einschub nach '\n' Zur Zeit werden folgende "Format Specificationen nicht unterstützt: - Die Prefixe: F, N, h, I - Die Typen: f, e, E, g, G, n - Precision: .[Zahl], da auch keine Float's unterstützt! Der Prefix 'l' bzw. 'L' wird nicht von %b, %t, %c, %p unterstützt. buffer: buffer != 0 maxcount: maxcount > 0 format: format != 0 / "Format-String" (s.z.B. printf und oben) argptr: argptr != 0 return: Anzahl der in Buffer geschriebenen Zeichen (ohne '\0') Ist Anzahl < 0 trat ein Fehler auf (normalerweise maxcount zu klein). Inhalt von buffer ist dann undefiniert \*===========================================================================*/ tSInt a_vsnprintf_tab (char *buffer, tUInt maxcount, const char *format, va_list argptr, tUInt tabsize); tSInt a_vsnprintf (char *buffer, tUInt maxcount, const char *format, va_list argptr); tSInt a_snprintf (char *buffer, tUInt maxcount, const char *format, ...); /*===========================================================================*\ \*===========================================================================*/ #ifdef USE_64TO32BIT_DIVISION void Special64BitDiv (tUInt64 *pValue64, tUByte divisor); // Important: 0x02 <= divisor <= 0x10 !!!! // Function with split a 64Bit Division in multiple 32bit operations. // This is needed from the printf's for %d, %x in some 32Bit enviroments // if the linker returns function __aulldiv is missing. #else inline void Special64BitDiv (tUInt64 *pValue64, tUByte divisor) { (*pValue64) /= divisor; } #endif /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/DynQueue.h0000644000175000017500000000274210470310070020103 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _DYNQUEUE_H_ #define _DYNQUEUE_H_ #include "StdQueue.h" /*===========================================================================*\ \*===========================================================================*/ class CDynamicQueue : public CStandardQueue { public: CDynamicQueue (tUInt StartCountOfItems, tUInt SizeOfItem) : CStandardQueue (StartCountOfItems, SizeOfItem) {} tBool Put (void *dataIn); tBool PutInFront (void *dataIn); }; /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/PtrList.h0000644000175000017500000001570510470310070017750 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _PTRLIST_H_ #define _PTRLIST_H_ #include "aTypes.h" /*===========================================================================*\ \*===========================================================================*/ class CPointerListElement { public: typedef tResult (*ctFindFunc) (CPointerListElement *pElement, void *RefData); CPointerListElement (void); virtual ~CPointerListElement (void); CPointerListElement *GetNext (void); CPointerListElement *GetPrev (void); void AddAfter (CPointerListElement *pElement); void AddBefore (CPointerListElement *pElement); void Exchange (CPointerListElement *pElement); void RemoveFromList (void); CPointerListElement *RemoveAfter (void); CPointerListElement *RemoveBefore (void); tResult FindFwd (ctFindFunc func, void *RefData, CPointerListElement **ppFoundElement = 0); // the search begin at GetNext(); tResult FindRev (ctFindFunc func, void *RefData, CPointerListElement **ppFoundElement = 0); // the search begin at GetPrev(); private: void InternalRemove (void); CPointerListElement *pNext; CPointerListElement *pPrev; }; /*===========================================================================*\ \*===========================================================================*/ class CPointerList { public: typedef tResult (*ctFindFunc) (CPointerListElement *pElement, void *RefData); CPointerList (void); virtual ~CPointerList (void); tBool IsEmpty (void); tUInt CountElements (void); CPointerListElement *GetFirst (void); CPointerListElement *GetLast (void); void AddFirst (CPointerListElement *pElement); void AddLast (CPointerListElement *pElement); CPointerListElement *RemoveFirst (void); CPointerListElement *RemoveLast (void); void RemoveAndDeleteAll (void); tResult FindFwd (ctFindFunc func, void *RefData, CPointerListElement **ppFoundElement = 0); // the search begin at GetFirst(); tResult FindRev (ctFindFunc func, void *RefData, CPointerListElement **ppFoundElement = 0); // the search begin at GetLast(); private: CPointerListElement Head; CPointerListElement Tail; }; /*===========================================================================*\ inline Functions for CPointerListElement \*===========================================================================*/ #include "dbgSTD.h" inline CPointerListElement::CPointerListElement (void) : pNext (0), pPrev (0) { dhead ("CPointerListElement-Constructor", DCON_CPointerList); } inline CPointerListElement *CPointerListElement::GetNext (void) { dhead ("CPointerListElement::GetNext", DCON_CPointerList); dassert (pNext != 0); // the last element is for list managing only CPointerListElement *fret = pNext; RETURN ('x', (fret->pNext) ? fret : 0); } inline CPointerListElement *CPointerListElement::GetPrev (void) { dhead ("CPointerListElement::GetPrev", DCON_CPointerList); dassert (pPrev != 0); // the first element is for list managing only CPointerListElement *fret = pPrev; RETURN ('x',(fret->pPrev) ? fret : 0); } inline void CPointerListElement::Exchange (CPointerListElement *pElement) { dhead ("CPointerListElement::Exchange", DCON_CPointerList); dassert (pElement != 0); AddBefore (pElement); RemoveFromList(); } inline void CPointerListElement::RemoveFromList (void) { dhead ("CPointerListElement::RemoveFromList", DCON_CPointerList); dparams ("%x", this); InternalRemove(); } inline CPointerListElement *CPointerListElement::RemoveAfter (void) { dhead ("CPointerListElement::RemoveAfter", DCON_CPointerList); CPointerListElement *fret = 0; if (pNext && pNext->pNext) { fret = pNext; fret->InternalRemove(); } RETURN ('x', fret); } inline CPointerListElement *CPointerListElement::RemoveBefore (void) { dhead ("CPointerListElement::RemoveBefore", DCON_CPointerList); CPointerListElement *fret = 0; if (pPrev && pPrev->pPrev) { fret = pPrev; fret->InternalRemove(); } RETURN ('x', fret); } /*===========================================================================*\ inline Functions for CPointerList \*===========================================================================*/ inline CPointerList::CPointerList (void) { dhead ("CPointerList-Constructor", DCON_CPointerList); // initialize the list Head.AddAfter (&Tail); } inline tBool CPointerList::IsEmpty (void) { dhead ("CPointerList::IsEmpty", DCON_CPointerList); return (Head.GetNext() == 0) ? vTrue : vFalse; } inline CPointerListElement *CPointerList::GetFirst (void) { dhead ("CPointerList::GetFirst", DCON_CPointerList); return Head.GetNext(); } inline CPointerListElement *CPointerList::GetLast (void) { dhead ("CPointerList::GetLast", DCON_CPointerList); return Tail.GetPrev(); } inline void CPointerList::AddFirst (CPointerListElement *pElement) { dhead ("CPointerList::AddFirst", DCON_CPointerList); dparams ("%x", pElement); Head.AddAfter (pElement); } inline void CPointerList::AddLast (CPointerListElement *pElement) { dhead ("CPointerList::AddLast", DCON_CPointerList); dparams ("%x", pElement); Tail.AddBefore (pElement); } inline CPointerListElement *CPointerList::RemoveFirst (void) { dhead ("CPointerList::RemoveFirst", DCON_CPointerList); return Head.RemoveAfter(); } inline CPointerListElement *CPointerList::RemoveLast (void) { dhead ("CPointerList::RemoveLast", DCON_CPointerList); return Tail.RemoveBefore(); } inline tResult CPointerList::FindFwd (ctFindFunc func, void *RefData, CPointerListElement **ppFoundElement) { dhead ("CPointerList::FindFwd", DCON_CPointerList); return Head.FindFwd (func, RefData, ppFoundElement); } inline tResult CPointerList::FindRev (ctFindFunc func, void *RefData, CPointerListElement **ppFoundElement) { dhead ("CPointerList::FindRev", DCON_CPointerList); return Tail.FindRev (func, RefData, ppFoundElement); } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/ByteQueu.h0000644000175000017500000001023210470310070020100 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _BYTEQUEU_H_ #define _BYTEQUEU_H_ #include "aTypes.h" #include "Protect.h" /*===========================================================================*\ CStandardByteQueue \*===========================================================================*/ class CStandardByteQueue { public: CStandardByteQueue (tUInt maxQueueSize, tBool PartFillAllow = vFalse); virtual ~CStandardByteQueue (void); virtual tUInt Put (tUByte *dataIn, tUInt length); virtual tBool PutByte (tUByte byteIn); virtual tUInt PutInFront (tUByte *dataIn, tUInt length); tUInt Get (tUByte *dataOut, tUInt maxLength); void Clear (void); tUInt Show (tUByte *data, tUInt maxLength, tUInt OffsetFromEnd = 0); tUByte ShowByte (tUInt OffsetFromEnd = 0); tUInt Fill (tUByte fillByte, tUInt length = 0); // length = 0 => fill whole queue tUInt Remove (tUInt maxLength); tBool IsEmpty (void); tBool IsFull (void); tUInt UsedSize (void); tUInt FreeSize (void); tUInt MaxSize (void); void SetPartFill (tBool PartFillAllow); tBool Resize (tUInt newMaxQueueSize); private: Protect_Define (hProtectPut); Protect_Define (hProtectGet); tUByte *buffer; tUInt maxCount; tUInt head; tUInt tail; tBool bPartFill; }; /*===========================================================================*\ inline Functionen \*===========================================================================*/ inline tBool CStandardByteQueue::IsEmpty (void) { return (head == tail) ? vTrue : vFalse; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tBool CStandardByteQueue::IsFull (void) { tUInt dHead = head + 1; tUInt dTail = tail; if (dHead >= maxCount) { dHead = 0; } return (dHead == dTail) ? vTrue : vFalse; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tUInt CStandardByteQueue::UsedSize (void) { tUInt dHead = head; tUInt dTail = tail; if (dHead < dTail) { dHead += maxCount; } return (dHead - dTail); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tUInt CStandardByteQueue::FreeSize (void) { if (!maxCount) { return 0; } tUInt dHead = head; tUInt dTail = tail; if (dHead >= dTail) { dTail += maxCount; } return (dTail - dHead - 1); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tUInt CStandardByteQueue::MaxSize (void) { return (maxCount) ? (maxCount - 1) : 0; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline void CStandardByteQueue::SetPartFill (tBool PartFillAllow) { bPartFill = PartFillAllow; } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/DataPool.h0000644000175000017500000002514410470310070020050 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _DATAPOOL_H_ #define _DATAPOOL_H_ #include "DataPack.h" #include "Protect.h" #include "dbgSTD.h" /*===========================================================================*\ \*===========================================================================*/ class CDataPacketQueue : public CBasicDataPacketQueue { public: CDataPacketQueue (void); virtual ~CDataPacketQueue (void); tBool Init (void); void Put (CDataPacket *pPacket); void PutInFront (CDataPacket *pPacket); CDataPacket *Get (void); CDataPacket *QueueOut (void); // hängt die kompletten Daten aus der Queue aus CDataPacket *ShowFirst (void); CDataPacket *ShowLast (void); tBool IsEmpty (void); tUInt CountPackets (void); CDataPacket *RecvPacket (void); void ReturnPacket (CDataPacket *pPacket, tSInfo info); private: Protect_Define (m_hProtect); CDataPacket *m_First; CDataPacket *m_Last; }; /*===========================================================================*\ \*===========================================================================*/ class CDataPacketPool : public CBasicDataPacketQueue { public: CDataPacketPool (void); virtual ~CDataPacketPool (void); tBool Init (void); CDataPacket *Fetch (void); void Fill (CDataPacket *pPacket); void DeleteAll (void); tBool IsEmpty (void); tUInt CountPackets (void); CDataPacket *RecvPacket (void); void ReturnPacket (CDataPacket *pPacket, tSInfo info); private: Protect_Define (m_hProtect); CDataPacket *m_Head; }; /*===========================================================================*\ \*===========================================================================*/ class CDataPacketPoolStore : public CDataPacketPool { public: CDataPacketPoolStore (tUInt PacketMaxLen = 0); void SetPacketMaxLen (tUInt PacketMaxLen); tUInt GetPacketMaxLen (void); tBool Init (tUInt StartCount); CDataPacket *FetchOrNew (void); private: tUInt m_PacketMaxLen; }; /*===========================================================================*\ \*===========================================================================*/ class CDataPacketPoolReference : public CDataPacketPool { public: tBool Init (tUInt StartCount); CDataPacket *FetchOrNew (void); }; /*===========================================================================*\ CDataPacketQueue - inline functions \*===========================================================================*/ inline CDataPacketQueue::CDataPacketQueue (void) : m_First (0), m_Last (0) { dhead ("CDataPacketQueue-Constructor", DCON_CDataPacket); Protect_InitHandle (&m_hProtect); Protect_Create (&m_hProtect); } inline tBool CDataPacketQueue::Init (void) { dhead ("CDataPacketQueue::Init", DCON_CDataPacket); return (Protect_IsCreated (m_hProtect) || Protect_Create (&m_hProtect)) ? vTrue : vFalse; } inline CDataPacketQueue::~CDataPacketQueue (void) { dhead ("CDataPacketQueue-Destructor", DCON_CDataPacket); dwarning (IsEmpty() == vTrue); CDataPacket *pDel; while ((pDel = Get()) != 0) { delete pDel; } Protect_Destroy (&m_hProtect); } inline void CDataPacketQueue::Put (CDataPacket *pPacket) { dhead ("CDataPacketQueue::Put", DCON_CDataPacket); dassert (pPacket != 0); pPacket->SetNextPacket (0); Protect_BeginWrite (m_hProtect); if (m_Last) { m_Last->SetNextPacket (pPacket); } else { dassert (m_First == 0); m_First = pPacket; } m_Last = pPacket; Protect_EndWrite (m_hProtect); } inline void CDataPacketQueue::PutInFront (CDataPacket *pPacket) { dhead ("CDataPacketQueue::PutInFront", DCON_CDataPacket); dassert (pPacket != 0); Protect_BeginWrite (m_hProtect); pPacket->SetNextPacket (m_First); m_First = pPacket; if (!m_Last) { dassert (pPacket->GetNextPacket() == 0); m_Last = m_First; } Protect_EndWrite (m_hProtect); } inline CDataPacket *CDataPacketQueue::Get (void) { dhead ("CDataPacketQueue::Get", DCON_CDataPacket); CDataPacket *fret = 0; Protect_BeginWrite (m_hProtect); if (m_First) { fret = m_First; m_First = m_First->GetNextPacket(); if (m_First == 0) { m_Last = 0; } fret->SetNextPacket (0); } Protect_EndWrite (m_hProtect); return fret; } inline CDataPacket *CDataPacketQueue::QueueOut (void) { dhead ("CDataPacketQueue::QueueOut", DCON_CDataPacket); Protect_BeginWrite (m_hProtect); CDataPacket *fret = m_First; m_First = m_Last = 0; Protect_EndWrite (m_hProtect); return fret; } inline CDataPacket *CDataPacketQueue::ShowFirst (void) { return m_First; } inline CDataPacket *CDataPacketQueue::ShowLast (void) { return m_Last; } inline tBool CDataPacketQueue::IsEmpty (void) { dhead ("CDataPacketQueue::IsEmpty", DCON_CDataPacket); return (m_First) ? vFalse : vTrue; } inline tUInt CDataPacketQueue::CountPackets (void) { tUInt count = 0; Protect_BeginRead (m_hProtect); for (CDataPacket *pLauf = m_First; pLauf != 0; pLauf = pLauf->GetNextPacket(), count++) ; Protect_EndRead (m_hProtect); return count; } inline CDataPacket *CDataPacketQueue::RecvPacket (void) { return Get(); } inline void CDataPacketQueue::ReturnPacket (CDataPacket *pPacket, tSInfo) { Put (pPacket); } /*===========================================================================*\ CDataPacketPool - inline functions \*===========================================================================*/ inline CDataPacketPool::CDataPacketPool (void) : m_Head (0) { dhead ("CDataPacketPool-Constructor", DCON_CDataPacket); Protect_InitHandle (&m_hProtect); Protect_Create (&m_hProtect); } inline CDataPacketPool::~CDataPacketPool (void) { dhead ("CDataPacketPool-Destructor", DCON_CDataPacket); DeleteAll(); Protect_Destroy (&m_hProtect); } inline tBool CDataPacketPool::Init (void) { dhead ("CDataPacketPool::Init", DCON_CDataPacket); return (Protect_IsCreated (m_hProtect) || Protect_Create (&m_hProtect)) ? vTrue : vFalse; } inline CDataPacket *CDataPacketPool::Fetch (void) { dhead ("CDataPacketPool::Fetch", DCON_CDataPacket); CDataPacket *fret = 0; Protect_BeginWrite (m_hProtect); if (m_Head) { fret = m_Head; m_Head = m_Head->GetNextPacket(); fret->SetNextPacket (0); } Protect_EndWrite (m_hProtect); return fret; } inline void CDataPacketPool::Fill (CDataPacket *pPacket) { dhead ("CDataPacketPool::Fill", DCON_CDataPacket); // assert (pPacket != 0); Protect_BeginWrite (m_hProtect); pPacket->SetNextPacket (m_Head); m_Head = pPacket; Protect_EndWrite (m_hProtect); } inline void CDataPacketPool::DeleteAll (void) { dhead ("CDataPacketPool::DeleteAll", DCON_CDataPacket); CDataPacket *pDel; while ((pDel = Fetch()) != 0) { delete pDel; } } inline tBool CDataPacketPool::IsEmpty (void) { dhead ("CDataPacketPool::IsEmpty", DCON_CDataPacket); return (m_Head) ? vFalse : vTrue; } inline tUInt CDataPacketPool::CountPackets (void) { tUInt count = 0; Protect_BeginRead (m_hProtect); for (CDataPacket *pLauf = m_Head; pLauf != 0; pLauf = pLauf->GetNextPacket(), count++) ; Protect_EndRead (m_hProtect); return count; } inline CDataPacket *CDataPacketPool::RecvPacket (void) { return Fetch(); } inline void CDataPacketPool::ReturnPacket (CDataPacket *pPacket, tSInfo) { Fill (pPacket); } /*===========================================================================*\ CDataPacketPoolStore - inline functions \*===========================================================================*/ inline CDataPacketPoolStore::CDataPacketPoolStore (tUInt PacketMaxLen) : m_PacketMaxLen (PacketMaxLen) { } inline void CDataPacketPoolStore::SetPacketMaxLen (tUInt PacketMaxLen) { m_PacketMaxLen = PacketMaxLen; } inline tUInt CDataPacketPoolStore::GetPacketMaxLen (void) { return m_PacketMaxLen; } inline tBool CDataPacketPoolStore::Init (tUInt StartCount) { if (CDataPacketPool::Init() == vFalse) { return vFalse; } for (; StartCount > 0; StartCount--) { CDataPacket *newone = new CDataPacketStore (m_PacketMaxLen); if (!newone || (newone->GetMaxLen() < m_PacketMaxLen)) { delete newone; DeleteAll(); return vFalse; } newone->SetPacketQueue (this); Fill (newone); } return vTrue; } inline CDataPacket *CDataPacketPoolStore::FetchOrNew (void) { CDataPacket *fret = Fetch(); if (!fret) { fret = new CDataPacketStore (m_PacketMaxLen); if (!fret || (fret->GetMaxLen() < m_PacketMaxLen)) { delete fret; fret = 0; } else { fret->SetPacketQueue (this); } } return fret; } /*===========================================================================*\ CDataPacketPoolRef - inline functions \*===========================================================================*/ inline tBool CDataPacketPoolReference::Init (tUInt StartCount) { for (; StartCount > 0; StartCount--) { CDataPacket *newone = new CDataPacketReference; if (!newone) { DeleteAll(); return vFalse; } newone->SetPacketQueue (this); Fill (newone); } return vTrue; } inline CDataPacket *CDataPacketPoolReference::FetchOrNew (void) { CDataPacket *fret = Fetch(); if (!fret) { fret = new CDataPacketReference; if (fret) { fret->SetPacketQueue (this); } } return fret; } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/DataList.h0000644000175000017500000000733310470310070020052 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _DATALIST_H_ #define _DATALIST_H_ #include "DataPack.h" /*===========================================================================*\ \*===========================================================================*/ class CDataPacketList { public: CDataPacketList (void); virtual ~CDataPacketList (void); tBool IsEmpty (void); CDataPacket *GetFirst (void); CDataPacket *GetLast (void); CDataPacket *GetNum (tUInt number); void AddFirst (CDataPacket *pPacket); void AddLast (CDataPacket *pPacket); CDataPacket *RemoveFirst (void); void RemoveAndDeleteAll (void); private: CDataPacket *m_pFirst; CDataPacket *m_pLast; }; /*===========================================================================*\ \*===========================================================================*/ inline CDataPacketList::CDataPacketList (void) : m_pFirst (0), m_pLast (0) { } inline CDataPacketList::~CDataPacketList (void) { RemoveAndDeleteAll(); } inline tBool CDataPacketList::IsEmpty (void) { return (m_pFirst == 0); } inline CDataPacket *CDataPacketList::GetFirst (void) { return m_pFirst; } inline CDataPacket *CDataPacketList::GetLast (void) { return m_pLast; } inline CDataPacket *CDataPacketList::GetNum (tUInt number) { CDataPacket *pPacket = m_pFirst; for (; (pPacket != 0) && (number > 0); number--, pPacket = pPacket->GetNextPacket()) { // nothing to do in this loop } return pPacket; } inline void CDataPacketList::AddFirst (CDataPacket *pPacket) { // dassert (pPacket != 0); // dassert (pPacket->GetNextPacket() == 0); if (!m_pFirst) { // dassert (m_pLast == 0); m_pLast = pPacket; } else { pPacket->SetNextPacket (m_pFirst); } m_pFirst = pPacket; } inline void CDataPacketList::AddLast (CDataPacket *pPacket) { // dassert (pPacket != 0); // dassert (pPacket->GetNextPacket() == 0); if (!m_pLast) { // dassert (m_pFirst == 0); m_pFirst = pPacket; } else { // dassert (m_pLast->GetNextPacket() == 0); m_pLast->SetNextPacket (pPacket); } m_pLast = pPacket; } inline CDataPacket *CDataPacketList::RemoveFirst (void) { CDataPacket *pRemPack = m_pFirst; if (m_pFirst) { m_pFirst = m_pFirst->GetNextPacket(); if (!m_pFirst) { // dassert (m_pLast == pRemPacket); m_pLast = 0; } else { pRemPacket->SetNextPacket (0); } } return pRemPack; } inline void CDataPacketList::RemoveAndDeleteAll (void) { CDataPacket *pDelPacket while (m_pFirst) { pDelPacket = m_pFirst; m_pFirst = m_pFirst->GetNextPacket(); delete pDelPacket; } m_pLast = 0; } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/dbgSTD.h0000644000175000017500000000316410470310070017452 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _DBGSTD_H_ #define _DBGSTD_H_ #include "DbgInfo.h" /*===========================================================================*\ \*===========================================================================*/ extern tUInt DCON_StringFuncs; extern tUInt DCON_CDynamicString; extern tUInt DCON_CStandardByteQueue; extern tUInt DCON_CStandardQueue; extern tUInt DCON_CStandardArray; extern tUInt DCON_CDataPacket; extern tUInt DCON_CDynamicStore; extern tUInt DCON_CPointerList; extern tUInt DCON_CStandardList; extern tUInt DCON_CBasicTimerSupport; extern tUInt DCON_ConfigParser; extern tUInt DCON_ConfigParserAssi; /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/aStdLib.cpp0000644000175000017500000002237210470310070020222 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "aStdLib.h" #include "aString.h" #include "CString.h" #include "DataPack.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ static char DigitForStrings[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; /*===========================================================================*\ \*===========================================================================*/ tUByte a_count1bits (tUInt32 value) { tUByte fret = 0; for (; value > 0; value >>= 1) { if (value & 0x1) { fret++; } } return fret; } tUByte a_count1bits (tUInt64 value) { tUByte fret = 0; #ifdef USE_64TO32BIT_DIVISION fret = a_count1bits (*(tUInt32 *)&value) + a_count1bits (*(((tUInt32 *)&value) + 1)); #else for (; value > 0; value >>= 1) { if (value & 0x1) { fret++; } } #endif return fret; } /*===========================================================================*\ \*===========================================================================*/ tSInt a_atol (char *string) { tSInt value = 0; tSInt sign = 1; //ASSERT (string != 0); while (*string == ' ') { string++; } switch (*string) { case '-': sign = -1; // kein break!! case '+': string++; break; } for (; ((*string != '\0') && (*string >= '0') && (*string <= '9')); string++) { value = value * 10 + *string - '0'; } return value * sign; } /*===========================================================================*\ \*===========================================================================*/ tSInt a_strtoln (tChar *nptr, tChar **endptr, tSize maxlength, tSInt base) { tSInt value = 0; tSInt sign = 1; tChar figure; //ASSERT (nptr != 0); //ASSERT ((base >= 2) && (base <= 16)); //ASSERT (maxlength != 0); while ((*nptr == ' ')) { nptr++; } switch (*nptr) { case '-': sign = -1; // no break!! case '+': nptr++; break; } for (; ((*nptr != '\0') && (maxlength)); nptr++, maxlength--) { figure = (tChar)(*nptr - '0'); if (figure >= ('A'-'0')) { figure = (tChar)(figure - ((figure >= 'a'-'0') ? 'a'-'0'-10 : 'A'-'0'-10)); } if (figure >= base) { break; } value = value * base + figure; } if (endptr) { *endptr = nptr; } return value * sign; } /*===========================================================================*\ \*===========================================================================*/ tSInt a_strtoln (tWiChar *nptr, tWiChar **endptr, tSize maxlength, tSInt base) { tSInt value = 0; tSInt sign = 1; tWiChar figure; //ASSERT (nptr != 0); //ASSERT ((base >= 2) && (base <= 16)); //ASSERT (maxlength != 0); while ((*nptr == ' ')) { nptr++; } switch (*nptr) { case '-': sign = -1; // no break!! case '+': nptr++; break; } for (; ((*nptr != '\0') && (maxlength)); nptr++, maxlength--) { figure = (tWiChar)(*nptr - '0'); if (figure >= ('A'-'0')) { figure = (tWiChar)(figure - ((figure >= 'a'-'0') ? 'a'-'0'-10 : 'A'-'0'-10)); } if (figure >= base) { break; } value = value * base + figure; } if (endptr) { *endptr = nptr; } return value * sign; } /*===========================================================================*\ \*===========================================================================*/ tUInt a_ltoan (tSInt value, char *string, tSize maxlen, tSInt radix) { tUInt uvalue; char buffer[sizeof (tULong) * 8]; tUInt bufpos = sizeof (buffer) - 1; char prechar = '\0'; // ASSERT (string != 0); // ASSERT ((radix <= 16) && (radix >= -16) && (radix != 0) && (radix != 1) && (radix != -1)); // ASSERT (maxlen > 1); if (radix < 0) { radix *= -1; if (value < 0) { value *= -1; prechar = '-'; maxlen--; } } uvalue = (tUInt) value; while (uvalue >= (tUInt)radix) { buffer[bufpos--] = DigitForStrings[uvalue % radix]; uvalue /= radix; } buffer[bufpos] = DigitForStrings[uvalue % radix]; bufpos = sizeof (buffer) - bufpos; if (maxlen <= bufpos) { // Platz fr String zu klein *string = '\0'; return 0; } // Konvertierung in den String kopieren if (prechar) { *string++ = prechar; } s_memcpy (string, buffer + sizeof (buffer) - bufpos, bufpos); string[bufpos] = '\0'; return bufpos + ((prechar) ? 1 : 0); } /*===========================================================================*\ \*===========================================================================*/ char *a_strupr (char *pString) { if (pString) { char *lauf; for (lauf = pString; *lauf != '\0'; lauf++) { if ((*lauf >= 'a') && (*lauf <= 'z')) { *lauf -= ('a' - 'A'); } } } return pString; } /*===========================================================================*\ \*===========================================================================*/ tUInt a_pointer2string (void *pointer, tChar *string) { tULong p = (tULong) pointer; tChar *fmt = ((sizeof (p) > 4) ? (tChar *)" . : . " : (tChar *)" : "); // must be symmetric! tUInt i = s_strlen (fmt); string[i] = '\0'; string--; for (; i > 0; i--, fmt++) { if (*fmt == ' ') { string [i] = DigitForStrings[p % 0x10]; p /= 0x10; } else { string [i] = *fmt; } } return (sizeof (p) > 4) ? 19 : 9; } /*===========================================================================*\ \*===========================================================================*/ tUInt a_pointer2string (void *pointer, tWiChar *string) { tULong p = (tULong) pointer; tWiChar *fmt = (sizeof (p) > 4) ? L" . : . " : L" : "; // must be symmetric! tUInt i = s_strlen (fmt); string[i] = '\0'; string--; for (; i > 0; i--, fmt++) { if (*fmt == ' ') { string [i] = DigitForStrings[p % 0x10]; p /= 0x10; } else { string [i] = *fmt; } } return (sizeof (p) > 4) ? 19 : 9; } /*===========================================================================*\ \*===========================================================================*/ static tSByte a_hex2bin_conv (tStringChar ch) { switch (ch) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': return ch - '0'; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': return ch - 'A' + 10; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': return ch - 'a' + 10; } return -1; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ tBool a_hex2bin (CConstString *pHexString, CDataPacket *pBinPacket) { //dassert (pHexString != 0); //dassert (pBinPacket != 0); tString str = pHexString->GetPointer(); tUByte *bin = pBinPacket->GetLenPointer(); tSByte val1 = -1; tSByte val2; //dassert (bin != 0); for (tSize len = pHexString->GetLen(); len > 0; len--, str++) { val2 = a_hex2bin_conv (*str); if (val2 >= 0) { if (val1 == -1) { val1 = val2; } else { if (!pBinPacket->GetFreeLen()) { if (infoError (pBinPacket->Resize (pBinPacket->GetMaxLen() + (len / 2)))) { return vFalse; } } *bin = (val1 << 4) + val2; val1 = -1; bin++; pBinPacket->IncLen(); } } } return vTrue; } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/standard/Protect.h0000644000175000017500000000521210470310070017757 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _PROTECT_H_ #define _PROTECT_H_ #include "aTypes.h" /*===========================================================================*\ \*===========================================================================*/ #ifdef DONT_USE_PROTECT_FEATURE #define Protect_Define(name) #define Protect_DefineInit(name) #define Protect_InitHandle(p) #define Protect_IsCreated(p) vTrue #define Protect_Create(p) vTrue #define Protect_Destroy(p) #define Protect_BeginRead(p) #define Protect_EndRead(p) #define Protect_BeginWrite(p) #define Protect_EndWrite(p) /*===========================================================================*\ \*===========================================================================*/ #else // DONT_USE_PROTECT_FEATURE typedef tHandle thProtect; #define Protect_Define(name) thProtect name #define Protect_DefineInit(name) thProtect name = vIllegalHandle void Protect_InitHandle (thProtect *pProtect); tBool Protect_IsCreated (thProtect Protect); tBool Protect_Create (thProtect *pProtect); void Protect_Destroy (thProtect *pProtect); void Protect_BeginRead (thProtect protect); void Protect_EndRead (thProtect protect); void Protect_BeginWrite (thProtect protect); void Protect_EndWrite (thProtect protect); /*===========================================================================*\ \*===========================================================================*/ inline void Protect_InitHandle (thProtect *pProtect) { *pProtect = vIllegalHandle; } inline tBool Protect_IsCreated (thProtect Protect) { return (Protect != vIllegalHandle); } /*===========================================================================*\ \*===========================================================================*/ #endif // DONT_USE_PROTECT_FEATURE #endif capi4hylafax-svn/src/standard/msTimer.h0000644000175000017500000000360510470310070017763 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _MSTIMER_H_ #define _MSTIMER_H_ #include "CBTimer.h" /*===========================================================================*\ \*===========================================================================*/ typedef tHandle thmsTimer; tBool msTimer_Create (thmsTimer *pTimer); void msTimer_Destroy (thmsTimer *pTimer); tBool msTimer_Call (thmsTimer timer, tUInt msecs, tCallBackTimerFunc cbfunc, void *handle1 = 0, void *handle2 = 0); tBool msTimer_Cancel (thmsTimer timer); // vFalse = cancel failed = timer is signaling or has signaled /*===========================================================================*\ \*===========================================================================*/ #ifdef USE_TIMER_POOL tUInt msTimerPool_Alloc (tUInt count); // return successfull allocated Timers void msTimerPool_Free (tUInt count = 0); #endif /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/SortList.h0000644000175000017500000001176610470310070020135 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _SORTLIST_H_ #define _SORTLIST_H_ #include "PtrList.h" /*===========================================================================*\ \*===========================================================================*/ class CSortPListElement : protected CPointerListElement { public: CSortPListElement *GetLower (void); CSortPListElement *GetHigher (void); void RemoveFromList (void); CSortPListElement *Add (CSortPListElement *pElement); // return: 0 : okay // != 0 : an equal element was found, pElement is added to the list // the equal element is removed from list and is the return value CSortPListElement *Find (void *FindData); virtual tCompare Compare (void *RefCompData) = 0; // RefCompData is [tCompare] with class own's RefCompData virtual void *GetRefCompData (void) = 0; friend class CSortPointerList; }; /*===========================================================================*\ \*===========================================================================*/ class CSortPointerList : protected CPointerList { public: tBool IsEmpty (void); tUInt CountElements (void); CSortPListElement *GetHighest (void); CSortPListElement *GetLowest (void); CSortPListElement *AddFromHigh (CSortPListElement *pElement); CSortPListElement *AddFromLow (CSortPListElement *pElement); // Search for the correct place begin at lowest or highest element // return: 0 : okay // != 0 : an equal element was found, pElement is added to the list // equal element ist removed from list and is the return value CSortPListElement *FindHigher (ctFindFunc func, void *RefData); CSortPListElement *FindLower (ctFindFunc func, void *RefData); CSortPListElement *FindHigher (void *FindData); // started by GetLowest() CSortPListElement *FindLower (void *FindData); // started by GetHighest() void RemoveAndDeleteAll (void); }; /*===========================================================================*\ inline functions from CSortPListElement \*===========================================================================*/ inline CSortPListElement *CSortPListElement::GetLower (void) { return (CSortPListElement *)CPointerListElement::GetPrev(); } inline CSortPListElement *CSortPListElement::GetHigher (void) { return (CSortPListElement *)CPointerListElement::GetNext(); } inline void CSortPListElement::RemoveFromList (void) { CPointerListElement::RemoveFromList(); } /*===========================================================================*\ inline functions from CSortPointerList \*===========================================================================*/ inline tBool CSortPointerList::IsEmpty (void) { return CPointerList::IsEmpty(); } inline tUInt CSortPointerList::CountElements (void) { return CPointerList::CountElements(); } inline CSortPListElement *CSortPointerList::GetHighest (void) { return (CSortPListElement *)CPointerList::GetLast(); } inline CSortPListElement *CSortPointerList::GetLowest (void) { return (CSortPListElement *)CPointerList::GetFirst(); } inline CSortPListElement *CSortPointerList::AddFromHigh (CSortPListElement *pElement) { CSortPListElement *pH = GetHighest(); if (pH) { return pH->Add (pElement); } AddFirst (pElement); return 0; } inline CSortPListElement *CSortPointerList::AddFromLow (CSortPListElement *pElement) { CSortPListElement *pH = GetLowest(); if (pH) { return pH->Add (pElement); } AddLast (pElement); return 0; } inline CSortPListElement *CSortPointerList::FindHigher (ctFindFunc func, void *RefData) { return (CSortPListElement *)CPointerList::FindFwd (func, RefData); } inline CSortPListElement *CSortPointerList::FindLower (ctFindFunc func, void *RefData) { return (CSortPListElement *)CPointerList::FindRev (func, RefData); } inline void CSortPointerList::RemoveAndDeleteAll (void) { CPointerList::RemoveAndDeleteAll(); } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/MultiStr.h0000644000175000017500000000411410470310070020122 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _MULTISTR_H_ #define _MULTISTR_H_ #include "CString.h" #include "PtrList.h" /*===========================================================================*\ \*===========================================================================*/ class COneMultiString : public CDynamicString, public CPointerListElement { public: COneMultiString (void) {} COneMultiString (tFormatChar *string, tUInt len = 0) : CDynamicString (string, len) {} COneMultiString *GetNext (void) { return (COneMultiString *)CPointerListElement::GetNext(); } COneMultiString *GetPrev (void) { return (COneMultiString *)CPointerListElement::GetPrev(); } }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class CMultiString : public CPointerList { public: COneMultiString *GetFirst (void) { return (COneMultiString *)CPointerList::GetFirst(); } COneMultiString *GetLast (void) { return (COneMultiString *)CPointerList::GetLast(); } }; /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/DynArray.h0000644000175000017500000000301210470310070020064 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _DYNARRAY_H_ #define _DYNARRAY_H_ #include "StdArray.h" /*===========================================================================*\ \*===========================================================================*/ class CDynamicArray : public CStandardArray { public: CDynamicArray (tUInt StartCountOfItems, tUInt SizeOfItem) : CStandardArray (StartCountOfItems, SizeOfItem) {} tBool Append (void *dataIn, tUInt *pos = 0); tBool Ins (tUInt pos, void *dataIn); }; /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/aStrPrt.cpp0000644000175000017500000004267510470310070020307 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "aStrPrt.h" #include "aStdLib.h" #include "aString.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define PRINTFLAGS_ACTIVE 0x001 // Placeholder found #define PRINTFLAGS_READY 0x002 // Placeholder fully insert #define PRINTFLAGS_MINUS 0x004 // Output left oriented #define PRINTFLAGS_PLUS 0x008 // Use sign '+' or '-' #define PRINTFLAGS_ZERO 0x010 // Fill with leading zeros #define PRINTFLAGS_BLANK 0x020 // Use sign '-' or ' ' #define PRINTFLAGS_HASH 0x040 // Show 0 or 0x before numbers #define PRINTFLAGS_LARGE 0x080 // Placeholder is in LARGE-format #define PRINTFLAGS_SHORT 0x100 // Placeholder is in SHORT-format #define PRINTFLAGS_FAR 0x200 // Placeholder is a FAR-pointer #define PRINTFLAGS_NEAR 0x400 // Placeholder is a NEAR-pointer #define PRINTFLAGS_QUESTION 0x800 // Sizeof Char specified before string /*===========================================================================*\ internal functions for "vsnprintf" ! \*===========================================================================*/ tUInt ltoanX (tSInt64 value, char *string, tUInt maxlen, tSByte radix, tUInt width, tUInt flags) { static tUChar DigitForStrings[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; tUInt64 uvalue; tUChar prechar[3]; tUChar buffer[sizeof (tSInt64) * 8]; tUInt precharlen = 0; tUInt bufpos = sizeof (buffer) - 1; // ASSERT (string != 0); // ASSERT ((radix <= 16) && (radix >= -16) && (radix != 0) && (radix != 1) && (radix != -1)); // ASSERT (maxlen > 1); if (value < 0) { if (radix < 0) { value *= -1; prechar[precharlen++] = '-'; } } else { if (flags & PRINTFLAGS_PLUS) { prechar[precharlen++] = '+'; } else if (flags & PRINTFLAGS_BLANK) { prechar[precharlen++] = ' '; } } if (radix < 0) { radix *= -1; } if (flags & PRINTFLAGS_HASH) { switch (radix) { case 8: prechar[precharlen++] = '0'; break; case 16: prechar[precharlen++] = '0'; prechar[precharlen++] = 'x'; break; } } uvalue = (tUInt64) value; tUInt64 orgval; while (uvalue >= (tUInt64)radix) { orgval = uvalue; //uvalue /= radix; Special64BitDiv (&uvalue, (tUByte)radix); buffer[bufpos--] = DigitForStrings[(tUByte)(orgval - uvalue * radix)]; } buffer[bufpos] = DigitForStrings[uvalue]; uvalue = bufpos; bufpos = sizeof (buffer) - bufpos + precharlen; if (maxlen <= bufpos) { *string = '0'; return 0; } if ((width > bufpos) && !(flags & PRINTFLAGS_MINUS)) { width -= bufpos; s_memset (string, ((flags & PRINTFLAGS_ZERO) ? '0' : ' '), width); string += width; } else { width = 0; } if (precharlen) { s_memcpy (string, prechar, precharlen); } s_memcpy (string + precharlen, buffer + uvalue, bufpos - precharlen); string[bufpos] = '\0'; return bufpos + width; } /*===========================================================================*\ \*===========================================================================*/ tSInt a_vsnprintf_tab (char *buffer, tUInt maxcount, const char *format, va_list argptr, tUInt tabsize) { tUInt PrtFlags = 0; // Possible Flags for "placeholder" tUInt PrtWidth = 0; // Width of "placeholder" tSInt PrtPreci = -2; // Precision of "placeholder" tUInt PrtValue = 0; // Returnvalue of convert function const char *savepos = format; char *argchar = 0; char tabchar = ' '; tUInt count = maxcount; // free place in buffer tUInt ErrorFound = 0; while ((count > 1) && (*format != 0) && (!ErrorFound)) { if (PrtFlags) { /*----- exams placeholders (%...) -----*/ switch (*format) { /*----- FLAGS -----*/ case '-': PrtFlags |= PRINTFLAGS_MINUS; break; case '+': PrtFlags |= PRINTFLAGS_PLUS; break; case ' ': PrtFlags |= PRINTFLAGS_BLANK; break; case '#': PrtFlags |= PRINTFLAGS_HASH; break; case '?': PrtFlags |= PRINTFLAGS_QUESTION; break; case 'l': case 'L': PrtFlags |= PRINTFLAGS_LARGE; break; case 'h': PrtFlags |= PRINTFLAGS_SHORT; break; /*----- WIDTH or PRECISION-----*/ case '0': if (PrtPreci == -2) { PrtFlags |= PRINTFLAGS_ZERO; } // kein break ! case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (PrtPreci == -2) { PrtWidth = a_strtol (format, (char **)&format, 10); } else { PrtPreci = a_strtol (format, (char **)&format, 10); } format--; break; case '*': if (PrtPreci == -2) { PrtWidth = va_arg (argptr, unsigned); } else { PrtPreci = va_arg (argptr, unsigned); } break; /*----- TYPE -----*/ case 'b': if ((char)va_arg (argptr, int)) { argchar = "TRUE"; PrtValue = 4; } else { argchar = "FALSE"; PrtValue = 5; } if (PrtPreci == 1) { PrtValue = 1; } if ((PrtWidth > (unsigned)PrtValue) && !(PrtFlags & PRINTFLAGS_MINUS)) { PrtWidth = (PrtWidth - PrtValue >= count) ? count - 1: PrtWidth - PrtValue; s_memset (buffer, ' ', PrtWidth); count -= PrtWidth; buffer += PrtWidth; } if (count > (unsigned)PrtValue) { s_memcpy (buffer, argchar, PrtValue); } else if (count > 1) { /*----- show only 'T'- or 'F' -----*/ *buffer = *argchar; PrtValue = 1; } else { PrtValue = 0; } PrtFlags |= PRINTFLAGS_READY; break; case 't': tabsize = (tUByte)PrtWidth; tabchar = (char)va_arg (argptr, int); PrtWidth = 0; PrtPreci = -2; buffer--; count++; PrtValue = 1; PrtFlags |= PRINTFLAGS_READY; break; case 'd': case 'i': PrtValue = ltoanX ((PrtFlags & PRINTFLAGS_LARGE) ? va_arg (argptr, tSInt64) : va_arg (argptr, tSInt), buffer, count, -10, PrtWidth, PrtFlags); PrtFlags |= PRINTFLAGS_READY; break; case 'u': PrtValue = ltoanX ((PrtFlags & PRINTFLAGS_LARGE) ? va_arg (argptr, tUInt64) : va_arg (argptr, tUInt), buffer, count, 10, PrtWidth, PrtFlags); PrtFlags |= PRINTFLAGS_READY; break; case 'o': PrtValue = ltoanX ((PrtFlags & PRINTFLAGS_LARGE) ? va_arg (argptr, tUInt64) : va_arg (argptr, tUInt), buffer, count, 8, PrtWidth, PrtFlags); PrtFlags |= PRINTFLAGS_READY; break; case 'x': PrtValue = ltoanX ((PrtFlags & PRINTFLAGS_LARGE) ? va_arg (argptr, tUInt64) : va_arg (argptr, tUInt), buffer, count, 0x10, PrtWidth, PrtFlags); PrtFlags |= PRINTFLAGS_READY; break; case 'X': PrtValue = ltoanX ((PrtFlags & PRINTFLAGS_LARGE) ? va_arg (argptr, tUInt64) : va_arg (argptr, tUInt), buffer, count, 0x10, PrtWidth, PrtFlags); if (PrtValue) { a_strupr (buffer); } PrtFlags |= PRINTFLAGS_READY; break; case 'c': if ((PrtFlags & PRINTFLAGS_QUESTION) && (va_arg (argptr, tUInt) > 1)) { PrtFlags |= PRINTFLAGS_LARGE; } if ((PrtWidth > 1) && !(PrtFlags & PRINTFLAGS_MINUS)) { PrtValue = (PrtWidth > count) ? (count - 1) : (PrtWidth - 1); memset (buffer, ' ', PrtValue); } else { PrtValue = 0; } if (count - PrtValue > 1) { buffer[PrtValue] = (char)va_arg (argptr, int); PrtValue++; } PrtFlags |= PRINTFLAGS_READY; break; case 's': if ((PrtFlags & PRINTFLAGS_QUESTION) && (va_arg (argptr, tUInt) > 1)) { PrtFlags |= PRINTFLAGS_LARGE; } argchar = va_arg (argptr, char *); if (!argchar) { PrtFlags &= ~PRINTFLAGS_LARGE; // remove LARGE-FLAG argchar = "[NULL]"; } if (PrtFlags & PRINTFLAGS_LARGE) { PrtValue = 0; while (argchar[PrtValue * 2] != '\0') { PrtValue++; } } else { PrtValue = s_strlen (argchar); } if ((PrtWidth > (unsigned) PrtValue) && !(PrtFlags & PRINTFLAGS_MINUS)) { PrtWidth = (PrtWidth - PrtValue >= count) ? (count - 1) : (PrtWidth - PrtValue); memset (buffer, ' ', PrtWidth); count -= PrtWidth; buffer += PrtWidth; } if ((unsigned) PrtValue >= count) { PrtValue = count - 1; } if (PrtValue) { if (PrtFlags & PRINTFLAGS_LARGE) { for (ErrorFound = 0; PrtValue - ErrorFound > 0; ErrorFound++) { buffer[ErrorFound] = argchar[ErrorFound * 2]; } ErrorFound = 0; } else { s_memcpy (buffer, argchar, PrtValue); } } else { buffer--; count++; PrtValue = 1; } PrtFlags |= PRINTFLAGS_READY; break; case 'p': if ((PrtWidth > 9) && !(PrtFlags & PRINTFLAGS_MINUS)) { PrtWidth = (PrtWidth - 9 >= count) ? count - 1: PrtWidth - 9; memset (buffer, ' ', PrtWidth); count -= PrtWidth; buffer += PrtWidth; } PrtValue = ((sizeof (void *) > 4) ? 19 : 9 ); if (count > (unsigned)PrtValue) { a_pointer2string (va_arg (argptr, void *), buffer); } else { PrtValue = 0; } PrtFlags |= PRINTFLAGS_READY; break; /*----- Found PRECISION -----*/ case '.': if (PrtPreci == -2) { PrtPreci = -1; break; } /*----- no Break! -----*/ /*----- OTHERS: wrong placeholder -----*/ default: PrtValue = (int) (format - savepos + 1); if ((unsigned) PrtValue >= count) { PrtValue = count - 1; } s_strncpy (buffer, savepos, PrtValue); PrtFlags |= PRINTFLAGS_READY; break; } //end: switch (*format) if (PrtFlags & PRINTFLAGS_READY) { // placeholder found if (PrtValue > 0) { if ((PrtPreci >= 0) && ((tUInt)PrtPreci < PrtValue)) { /*----- TODO: wrong!!! -----*/ PrtValue = PrtPreci; } count -= PrtValue; buffer += PrtValue; if ((PrtWidth > (unsigned)PrtValue) && (PrtFlags & PRINTFLAGS_MINUS)) { PrtWidth -= PrtValue; if (PrtWidth >= count) { PrtWidth = count - 1; } count -= PrtWidth; for (; (PrtWidth > 0); PrtWidth--) { *buffer++ = ' '; } } } else { ErrorFound = 1; } PrtFlags = 0; PrtWidth = 0; PrtPreci = -2; PrtValue = 0; } } else if (*format == '%') { //ASSERT (PrtFlags == 0); savepos = format; if (*(format + 1) == '%') { count--; *buffer++ = *format++; } else { PrtValue = 0; PrtWidth = 0; PrtPreci = -2; PrtFlags = PRINTFLAGS_ACTIVE; } } else { count--; *buffer++ = *format; if ((*format == '\n') && (tabsize > 0) && (tabsize < count) && (tabchar > 0)) { memset (buffer, tabchar, tabsize); buffer += tabsize; count -= tabsize; } } format++; } //end: while *buffer = '\0'; if (ErrorFound) { return -1; } return (maxcount - count); } /*===========================================================================*\ \*===========================================================================*/ tSInt a_vsnprintf (char *buffer, tUInt maxcount, const char *format, va_list argptr) { return a_vsnprintf_tab (buffer, maxcount, format, argptr, 0); } /*===========================================================================*\ \*===========================================================================*/ tSInt a_snprintf (char *buffer, tUInt maxcount, const char *format, ...) { tSInt fret; va_list arg_ptr; va_start (arg_ptr, format); fret = a_vsnprintf_tab (buffer, maxcount, format, arg_ptr, 0); va_end (arg_ptr); return fret; } /*===========================================================================*\ \*===========================================================================*/ #ifdef USE_64TO32BIT_DIVISION static struct { tUInt32 wert; tUInt32 rest; } Special64BitDivArray[15] = { { 0x100000000 / 0x02, 0 }, { 0x100000000 / 0x03, 1 }, { 0x100000000 / 0x04, 0 }, { 0x100000000 / 0x05, 1 }, { 0x100000000 / 0x06, 4 }, { 0x100000000 / 0x07, 4 }, { 0x100000000 / 0x08, 0 }, { 0x100000000 / 0x09, 4 }, { 0x100000000 / 0x0a, 6 }, { 0x100000000 / 0x0b, 4 }, { 0x100000000 / 0x0c, 4 }, { 0x100000000 / 0x0d, 9 }, { 0x100000000 / 0x0e, 4 }, { 0x100000000 / 0x0f, 1 }, { 0x100000000 / 0x10, 0 } }; void Special64BitDiv (tUInt64 *pValue64, tUByte divisor) { // dassert (divisor >= 0x02); // dassert (divisor <= 0x10); //if (*pValue64 >= 0x100000000) { tUInt32 *pValue = ((tUInt32 *)pValue64) + 1; tUInt32 highVal = *pValue; tUInt32 lowVal; *pValue /= divisor; highVal -= (*pValue) * divisor; pValue--; lowVal = *pValue; *pValue /= divisor; lowVal -= (*pValue) * divisor; *pValue += highVal * Special64BitDivArray[divisor - 2].wert; lowVal += highVal * Special64BitDivArray[divisor - 2].rest; *pValue += lowVal / divisor; //} else { // *(tUInt32 *)pValue64 /= divisor; //} } #endif /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/standard/DynQueue.cpp0000644000175000017500000000423010470310070020430 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "DynQueue.h" #include "dbgSTD.h" /*===========================================================================*\ CDynamicQueue::Put \*===========================================================================*/ tBool CDynamicQueue::Put (void *dataIn) { dhead ("CDynamicQueue::Put", DCON_CStandardQueue); if (!FreeItems()) { Resize ((MaxItems() >= (MAXVAL_tUInt / (ItemSize() * 2))) ? (MAXVAL_tUInt / ItemSize()) : ((MaxItems() * 2) + 1)); } return CStandardQueue::Put (dataIn); } /*===========================================================================*\ CDynamicQueue::PutInFront \*===========================================================================*/ tBool CDynamicQueue::PutInFront (void *dataIn) { dhead ("CDynamicQueue::PutInFront", DCON_CStandardQueue); if (!FreeItems()) { Resize ((MaxItems() >= (MAXVAL_tUInt / (ItemSize() * 2))) ? (MAXVAL_tUInt / ItemSize()) : ((MaxItems() * 2) + 1)); } return CStandardQueue::PutInFront (dataIn); } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/standard/PtrList.cpp0000644000175000017500000001166310470310070020302 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "PtrList.h" #include "dbgSTD.h" /*===========================================================================*\ \*===========================================================================*/ CPointerListElement::~CPointerListElement (void) { dhead ("CPointerListElement-Destructor", DCON_CPointerList); if (pNext && pPrev) { // It crashes if RemoveFromList is called for "Head" or "Tail" RemoveFromList(); } } void CPointerListElement::AddAfter (CPointerListElement *pElement) { dhead ("CPointerListElement::AddAfter", DCON_CPointerList); dparams ("%x", pElement); dassert (pElement != 0); dassert (pElement->pNext == 0); dassert (pElement->pPrev == 0); pElement->pPrev = this; if (pNext) { pNext->pPrev = pElement; pElement->pNext = pNext; } pNext = pElement; } void CPointerListElement::AddBefore (CPointerListElement *pElement) { dhead ("CPointerListElement::AddBefore", DCON_CPointerList); dparams ("%x", pElement); dassert (pElement != 0); dassert (pElement->pNext == 0); dassert (pElement->pPrev == 0); pElement->pNext = this; dassert (pPrev != 0); pPrev->pNext = pElement; pElement->pPrev = pPrev; pPrev = pElement; } tResult CPointerListElement::FindFwd (CPointerListElement::ctFindFunc func, void *RefData, CPointerListElement **ppFoundElement) { dhead ("CPointerListElement::FindFwd", DCON_CPointerList); tResult fret; for (CPointerListElement *pLauf = GetNext(); (pLauf != 0); pLauf = pLauf->GetNext()) { fret = func (pLauf, RefData); switch (fret) { case vYes: case vCancel: case vError: if (ppFoundElement) { *ppFoundElement = pLauf; } return fret; default: dassert (0); // no break! case vNo: // Nothing to do break; } } if (ppFoundElement) { *ppFoundElement = 0; } return vNo; } tResult CPointerListElement::FindRev (CPointerListElement::ctFindFunc func, void *RefData, CPointerListElement **ppFoundElement) { dhead ("CPointerListElement::FindRev", DCON_CPointerList); tResult fret; for (CPointerListElement *pLauf = GetPrev(); (pLauf != 0); pLauf = pLauf->GetNext()) { fret = func (pLauf, RefData); switch (fret) { case vYes: case vCancel: case vError: if (ppFoundElement) { *ppFoundElement = pLauf; } return fret; default: dassert (0); // no break! case vNo: // Nothing to do break; } } if (ppFoundElement) { *ppFoundElement = 0; } return vNo; } void CPointerListElement::InternalRemove (void) { dhead ("CPointerListElement::InternalRemove", DCON_CPointerList); if (pPrev != 0) { dassert (pNext != 0); dassert (pPrev->pNext == this); dassert (pNext->pPrev == this); pPrev->pNext = pNext; pNext->pPrev = pPrev; pNext = 0; pPrev = 0; } else { dassert (pNext == 0); } } /*===========================================================================*\ \*===========================================================================*/ CPointerList::~CPointerList (void) { dhead ("CPointerList-Destructor", DCON_CPointerList); RemoveAndDeleteAll(); dassert (CountElements() == 0); } tUInt CPointerList::CountElements (void) { dhead ("CPointerList::CountElements", DCON_CPointerList); tUInt count = 0; for (CPointerListElement *lauf = GetFirst(); lauf != 0; lauf = lauf->GetNext()) { count++; } RETURN ('x', count); } void CPointerList::RemoveAndDeleteAll (void) { dhead ("CPointerList::RemoveAndDeleteAll", DCON_CPointerList); CPointerListElement *pDelItem; while ((pDelItem = GetLast()) != 0) { delete pDelItem; } } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/standard/DbgFile.h0000644000175000017500000000272210470310070017636 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _DBGFILE_H_ #define _DBGFILE_H_ #include "ExtFuncs.h" /*===========================================================================*\ \*===========================================================================*/ #if defined (DEBUG_FILE_NAME) && (USE_DEBUG_INFO_CLASS > 0) extern unsigned DebugFileOpen (void); extern void DebugFileClose (void); extern void DebugFilePrint (char *string); #else #define DebugFileOpen() #define DebugFileClose() #endif /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/aFlags.h0000644000175000017500000001036410470310070017540 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _AFLAGS_H_ #define _AFLAGS_H_ #include "aTypes.h" /*===========================================================================*\ \*===========================================================================*/ inline tUInt32 FlagToBits32 (tUByte Flag) { return (((tUInt32)1) << Flag); } inline tUInt64 FlagToBits64 (tUByte Flag) { #ifdef USE_64TO32BIT_DIVISION if (Flag >= 32) { tUInt64 value = 0; *(((tUInt32 *)&value) + 1) = FlagToBits32 (Flag - 32); return value; } else { return FlagToBits32 (Flag); } #else return (((tUInt64)1) << Flag); #endif } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline void SetBitsAll (tUInt32 *pValue, tUInt32 Bits) { *pValue |= Bits; } inline void SetBitsAll (tUInt64 *pValue, tUInt64 Bits) { *pValue |= Bits; } inline void SetOneFlag (tUInt32 *pValue, tUByte Flag) { SetBitsAll (pValue, FlagToBits32 (Flag)); } inline void SetOneFlag (tUInt64 *pValue, tUByte Flag) { SetBitsAll (pValue, FlagToBits64 (Flag)); } inline void ClearBitsAll (tUInt32 *pValue, tUInt32 Bits) { *pValue &= ~Bits; } inline void ClearBitsAll (tUInt64 *pValue, tUInt64 Bits) { *pValue &= ~Bits; } inline void ClearOneFlag (tUInt32 *pValue, tUByte Flag) { ClearBitsAll (pValue, FlagToBits32 (Flag)); } inline void ClearOneFlag (tUInt64 *pValue, tUByte Flag) { ClearBitsAll (pValue, FlagToBits64 (Flag)); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tUInt32 SetBitsAll (tUInt32 Value, tUInt32 Bits) { return (Value | Bits); } inline tUInt64 SetBitsAll (tUInt64 Value, tUInt64 Bits) { return (Value | Bits); } inline tUInt32 SetOneFlag (tUInt32 Value, tUByte Flag) { return SetBitsAll (Value, FlagToBits32 (Flag)); } inline tUInt64 SetOneFlag (tUInt64 Value, tUByte Flag) { return SetBitsAll (Value, FlagToBits64 (Flag)); } inline tUInt32 ClearBitsAll (tUInt32 Value, tUInt32 Bits) { return (Value & ~Bits); } inline tUInt64 ClearBitsAll (tUInt64 Value, tUInt64 Bits) { return (Value & ~Bits); } inline tUInt32 ClearOneFlag (tUInt32 Value, tUByte Flag) { return ClearBitsAll (Value, FlagToBits32 (Flag)); } inline tUInt64 ClearOneFlag (tUInt64 Value, tUByte Flag) { return ClearBitsAll (Value, FlagToBits64 (Flag)); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tBool CheckBitsAll (tUInt Value, tUInt Bits) { return (Value & Bits) == Bits; } inline tBool CheckBitsOne (tUInt Value, tUInt Bits) { return (Value & Bits) != 0; } inline tBool CheckBitsClrAll (tUInt Value, tUInt Bits) { return (Value & Bits) == 0; } inline tBool CheckBitsClrOne (tUInt Value, tUInt Bits) { return (Value & Bits) != Bits; } inline tBool CheckBitsSetAndClr (tUInt Value, tUInt SetBits, tUInt ClrBits) { return (Value & (SetBits | ClrBits)) == SetBits; } inline tBool CheckOneFlag (tUInt Value, tUByte Flag) { return ((Value >> Flag) & 1) != 0; } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/InfoType.h0000644000175000017500000001014510470310070020075 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _INFOTYPE_H_ #define _INFOTYPE_H_ #include "aTypes.h" /*===========================================================================*\ \*===========================================================================*/ typedef tSInt32 tSInfo; /*===========================================================================*\ \*===========================================================================*/ inline tBool infoSuccess (tSInfo i) { return (i >= 0); } inline tBool infoWarning (tSInfo i) { return (i > 0); } inline tBool infoError (tSInfo i) { return (i < 0); } inline tUInt16 infoType (tSInfo i) { return (tUInt16)((((tUInt32)i) >> 16) & 0x7FFF); } inline tUInt16 infoID (tSInfo i) { return (tUInt16)(i & 0xFFFF); } /*===========================================================================*\ \*===========================================================================*/ #define infoType_General 0x0000 #define infoType_File 0x0001 #define infoType_Capi 0x0002 #define infoType_MSNList 0x0003 #define infoType_Resource 0x0004 #define infoType_Registry 0x0005 #define infoType_WinAppl 0x0006 #define infoType_Packet 0x0007 #define infoType_Filter 0x0008 #define infoType_IniFile 0x0009 #define infoType_Serial 0x000A /*===========================================================================*\ \*===========================================================================*/ #define infoKind_Warning 0 #define infoKind_Error 1 #define CalculateInfoValue(type, kind, id) \ ((tSInfo)((((kind) & 0x1) << 31) + (((type) & 0x7FFF) << 16) + ((id) & 0xFFFF))) /*===========================================================================*\ \*===========================================================================*/ #define i_Okay CalculateInfoValue (infoType_General, infoKind_Warning, 0) #define i_Pending CalculateInfoValue (infoType_General, infoKind_Warning, 1) #define iErr_OutOfMemory CalculateInfoValue (infoType_General, infoKind_Error, 1) #define iErr_QueueFull CalculateInfoValue (infoType_General, infoKind_Error, 2) #define iErr_WrongState CalculateInfoValue (infoType_General, infoKind_Error, 3) /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define iErr_File_NotExist CalculateInfoValue (infoType_File, infoKind_Error, 1) #define iErr_File_OpenFailed CalculateInfoValue (infoType_File, infoKind_Error, 2) #define iErr_File_CreateFailed CalculateInfoValue (infoType_File, infoKind_Error, 3) /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tSInfo MapWinErr2Info (tSInt32 val) { return (val) ? CalculateInfoValue (infoType_WinAppl, infoKind_Error, val) : i_Okay; } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/ByteQueu.cpp0000644000175000017500000003337610470310070020451 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "ByteQueu.h" #include "aString.h" #include "dbgSTD.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define ByteQueue_PutLock 0 #define ByteQueue_GetLock 1 /*===========================================================================*\ CStandardByteQueue - Konstruktor \*===========================================================================*/ CStandardByteQueue::CStandardByteQueue (tUInt maxQueueSize, tBool PartFillAllow) : buffer (0), maxCount (0), head (0), tail (0) { dhead ("CStandardByteQueue-Constructor", DCON_CStandardByteQueue); dassert (maxQueueSize > 0); Protect_InitHandle (&hProtectGet); Protect_InitHandle (&hProtectPut); SetPartFill (PartFillAllow); Resize (maxQueueSize); } /*===========================================================================*\ CStandardByteQueue - Destruktor \*===========================================================================*/ CStandardByteQueue::~CStandardByteQueue (void) { dhead ("CStandardByteQueue-Destructor", DCON_CStandardByteQueue); if (Protect_IsCreated (hProtectPut) && Protect_IsCreated (hProtectGet)) { tUByte *tmpBuf = buffer; Protect_BeginWrite (hProtectPut); Protect_BeginWrite (hProtectGet); maxCount = 0; head = 0; tail = 0; buffer = 0; Protect_EndWrite (hProtectGet); Protect_EndWrite (hProtectPut); delete [] tmpBuf; } else { dassert (maxCount == 0); dassert (buffer == 0); } Protect_Destroy (&hProtectPut); Protect_Destroy (&hProtectGet); } /*===========================================================================*\ CStandardByteQueue::Put \*===========================================================================*/ tUInt CStandardByteQueue::Put (tUByte *dataIn, tUInt length) { dhead ("CStandardByteQueue::Put", DCON_CStandardByteQueue); dparams ("data=%p, len=%x", dataIn, length); dassert (dataIn != 0); dwarning (length != 0); dwarning (maxCount > 1); dwarning (buffer != 0); if (!maxCount) { RETURN ('x', 0); } tUInt tail_free = tail; dprint ("h=%x,t=%x", head, tail); Protect_BeginWrite (hProtectPut); if (tail_free <= head) { tail_free += maxCount; } tail_free -= head + 1; if (length > tail_free) { dprint ("Queue full: in=%x, free=%x!", length, tail_free); length = (bPartFill == vTrue) ? tail_free : 0; } if (length) { if (length + head >= maxCount) { tUInt dif = maxCount - head; s_memcpy (buffer + head, dataIn, dif); head = length - dif; s_memcpy (buffer, dataIn + dif, head); } else { s_memcpy (buffer + head, dataIn, length); head += length; } } Protect_EndWrite (hProtectPut); dprint ("h=%x,t=%x", head, tail); RETURN ('x', length); } /*===========================================================================*\ CStandardByteQueue::PutByte \*===========================================================================*/ tBool CStandardByteQueue::PutByte (tUByte byteIn) { dhead ("CStandardByteQueue::PutByte", DCON_CStandardByteQueue); dparams ("data=%x", byteIn); tUInt tmpTail = tail; if (tmpTail == 0) { tmpTail = maxCount; } dprint ("h=%x,t=%x", head, tail); dassert (head < maxCount); Protect_BeginWrite (hProtectPut); if (tmpTail >= head + 1) { Protect_EndWrite (hProtectPut); RETURN ('x', vFalse); } buffer[head++] = byteIn; if (head >= maxCount) { dassert (head == maxCount); head = 0; } Protect_EndWrite (hProtectPut); dprint ("h=%x,t=%x", head, tail); RETURN ('x', vTrue); } /*===========================================================================*\ CStandardByteQueue::PutInFront \*===========================================================================*/ tUInt CStandardByteQueue::PutInFront (tUByte *dataIn, tUInt length) { dhead ("CStandardByteQueue::PutInFront", DCON_CStandardByteQueue); dparams ("data=%p, len=%x", dataIn, length); dassert (dataIn != 0); dwarning (length != 0); dwarning (maxCount > 1); dwarning (buffer != 0); if (!maxCount) { RETURN ('x', 0); } tUInt free; tUInt offset = 0; dprint ("h=%x,t=%x", head, tail); Protect_BeginWrite (hProtectPut); Protect_BeginWrite (hProtectGet); free = ((tail <= head) ? maxCount : 0) + tail - head - 1; if (length > free) { dprint ("Queue full: in=%x, free=%x!", length, free); offset = length - free; length = (bPartFill == vTrue) ? free : 0; } if (tail < length) { tUInt dif = length - tail; s_memcpy (buffer, dataIn + offset + dif, tail); tail = maxCount - dif; s_memcpy (buffer + tail, dataIn + offset, dif); } else { s_memcpy (buffer + tail - length, dataIn + offset, length); tail -= length; } Protect_EndWrite (hProtectGet); Protect_EndWrite (hProtectPut); dprint ("h=%x,t=%x", head, tail); RETURN ('x', length); } /*===========================================================================*\ CStandardByteQueue::Get \*===========================================================================*/ tUInt CStandardByteQueue::Get (tUByte *dataOut, tUInt maxLength) { dhead ("CStandardByteQueue::Get", DCON_CStandardByteQueue); dparams ("data=%p, len=%x", dataOut, maxLength); dassert (dataOut != 0); dwarning (maxLength > 0); dwarning (maxCount > 1); dwarning (buffer != 0); tUInt head_count = head; dprint ("h=%x,t=%x", head, tail); Protect_BeginWrite (hProtectGet); if (head_count < tail) { head_count += maxCount; } head_count -= tail; if (maxLength > head_count) { dprint ("Not enough data: out=%x, use=%x!", maxLength, head_count); maxLength = (bPartFill == vTrue) ? head_count : 0; } if (maxLength + tail >= maxCount) { tUInt dif = maxCount - tail; s_memcpy (dataOut, buffer + tail, dif); tail = maxLength - dif; s_memcpy (dataOut + dif, buffer, tail); } else { s_memcpy (dataOut, buffer + tail, maxLength); tail += maxLength; } Protect_EndWrite (hProtectGet); dprint ("h=%x,t=%x", head, tail); RETURN ('x', maxLength); } /*===========================================================================*\ CStandardByteQueue::Clear \*===========================================================================*/ void CStandardByteQueue::Clear (void) { dhead ("CStandardByteQueue::Clear", DCON_CStandardByteQueue); dwarning (buffer != 0); Protect_BeginWrite (hProtectPut); Protect_BeginWrite (hProtectGet); head = 0; tail = 0; Protect_EndWrite (hProtectGet); Protect_EndWrite (hProtectPut); } /*===========================================================================*\ CStandardByteQueue::Show \*===========================================================================*/ tUInt CStandardByteQueue::Show (tUByte *data, tUInt maxLength, tUInt OffsetFromEnd) { dhead ("CStandardByteQueue::Show", DCON_CStandardByteQueue); dassert (data != 0); dassert (maxLength > 0); dwarning (maxCount > 1); dwarning (buffer != 0); tUInt head_count = head; Protect_BeginRead (hProtectGet); if (head_count < tail) { head_count += maxCount; } head_count -= tail; if (maxLength + OffsetFromEnd > head_count) { dprint ("Not enough data: out=%x, use=%x!", maxLength, head_count); maxLength = (bPartFill == vTrue) ? head_count : 0; } OffsetFromEnd += tail; if (OffsetFromEnd >= maxCount) { OffsetFromEnd -= maxCount; } if (maxLength + OffsetFromEnd >= maxCount) { tUInt dif = maxCount - OffsetFromEnd; s_memcpy (data, buffer + OffsetFromEnd, dif); s_memcpy (data + dif, buffer, maxLength - dif); } else { s_memcpy (data, buffer + OffsetFromEnd, maxLength); } Protect_EndRead (hProtectGet); RETURN ('x', maxLength); } /*===========================================================================*\ CStandardByteQueue::ShowByte \*===========================================================================*/ tUByte CStandardByteQueue::ShowByte (tUInt OffsetFromEnd) { dhead ("CStandardByteQueue::ShowByte", DCON_CStandardByteQueue); dassert (OffsetFromEnd < maxCount); dwarning (maxCount > 1); tUByte fret; Protect_BeginRead (hProtectGet); OffsetFromEnd += tail; if (OffsetFromEnd >= maxCount) { OffsetFromEnd -= maxCount; } dassert (OffsetFromEnd < head); fret = buffer[OffsetFromEnd]; Protect_EndRead (hProtectGet); RETURN ('x', fret); } /*===========================================================================*\ CStandardByteQueue::Fill \*===========================================================================*/ tUInt CStandardByteQueue::Fill (tUByte fillByte, tUInt length) { dhead ("CStandardByteQueue::Fill", DCON_CStandardByteQueue); dparams ("fill=%c, len=%x", fillByte, length); dwarning (maxCount > 1); dwarning (buffer != 0); if (!maxCount) { RETURN ('x', 0); } tUInt tail_free = tail; dprint ("h=%x,t=%x", head, tail); Protect_BeginWrite (hProtectPut); if (tail_free <= head) { tail_free += maxCount; } tail_free -= head + 1; if (!length) { length = tail_free; } else if (length > tail_free) { dprint ("Queue full: in=%x, free=%x!", length, tail_free); length = (bPartFill == vTrue) ? tail_free : 0; } if (length) { if (length + head >= maxCount) { tUInt dif = maxCount - head; s_strset (buffer + head, fillByte, dif); head = length - dif; s_strset (buffer, fillByte, head); } else { s_strset (buffer + head, fillByte, length); head += length; } } Protect_EndWrite (hProtectPut); dprint ("h=%x,t=%x", head, tail); RETURN ('x', length); } /*===========================================================================*\ CStandardByteQueue::Remove \*===========================================================================*/ tUInt CStandardByteQueue::Remove (tUInt maxLength) { dhead ("CStandardByteQueue::Remove", DCON_CStandardByteQueue); dassert (maxLength > 0); dwarning (maxCount > 1); dwarning (buffer != 0); tUInt head_count = head; dprint ("h=%x,t=%x", head, tail); Protect_BeginWrite (hProtectGet); if (head_count < tail) { head_count += maxCount; } head_count -= tail; if (maxLength > head_count) { dprint ("Not enough data: out=%x, use=%x!", maxLength, head_count); maxLength = (bPartFill == vTrue) ? head_count : 0; } tail += maxLength; if (tail >= maxCount) { tail -= maxCount; dassert (tail < maxCount); } Protect_EndWrite (hProtectGet); dprint ("h=%x,t=%x", head, tail); RETURN ('x', maxLength); } /*===========================================================================*\ CStandardByteQueue::Resize \*===========================================================================*/ tBool CStandardByteQueue::Resize (tUInt newMaxQueueSize) { dhead ("CStandardByteQueue::Resize", DCON_CStandardByteQueue); dparams ("newSize=%x", newMaxQueueSize); dassert (newMaxQueueSize > 0); tBool fret = vFalse; if ( ( (Protect_IsCreated (hProtectPut) == vTrue) || (Protect_Create (&hProtectPut) == vTrue)) && ( (Protect_IsCreated (hProtectGet) == vTrue) || (Protect_Create (&hProtectGet) == vTrue))) { tUByte *newBuf = new tUByte [newMaxQueueSize + 1]; tUByte *tmpBuf = newBuf; if (newBuf) { Protect_BeginWrite (hProtectPut); Protect_BeginWrite (hProtectGet); tUInt count = ((head < tail) ? maxCount : 0) + head - tail; if (count <= newMaxQueueSize) { if (head < tail) { tUInt dif = maxCount - tail; s_memcpy (newBuf, buffer + tail, dif); s_memcpy (newBuf + dif, buffer, head); } else { s_memcpy (newBuf, buffer + tail, head - tail); } tmpBuf = buffer; buffer = newBuf; head = count; tail = 0; maxCount = newMaxQueueSize + 1; fret = vTrue; } Protect_EndWrite (hProtectGet); Protect_EndWrite (hProtectPut); delete [] tmpBuf; } } RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/standard/StdQueue.h0000644000175000017500000000642710470310070020107 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _STDQUEUE_H_ #define _STDQUEUE_H_ #include "aTypes.h" #include "ByteQueu.h" /*===========================================================================*\ CStandardQueue \*===========================================================================*/ class CStandardQueue { public: CStandardQueue (tUInt MaxCountOfItems, tUInt SizeOfItem); virtual ~CStandardQueue (void); virtual tBool Put (void *dataIn); virtual tBool PutInFront (void *dataIn); tBool Get (void *dataOut); void Clear (void); tBool IsEmpty (void); tUInt UsedItems (void); tUInt FreeItems (void); tUInt MaxItems (void); tUInt ItemSize (void); tBool Resize (tUInt newMaxCountOfItems); private: CStandardByteQueue ByteQueue; tUInt maxItems; tUInt sizeItem; }; /*===========================================================================*\ inline functions of CStandardQueue \*===========================================================================*/ inline void CStandardQueue::Clear (void) { ByteQueue.Clear(); } /*===========================================================================*\ \*===========================================================================*/ inline tBool CStandardQueue::IsEmpty (void) { return ByteQueue.IsEmpty(); } /*===========================================================================*\ \*===========================================================================*/ inline tUInt CStandardQueue::UsedItems (void) { return (ByteQueue.UsedSize() / sizeItem); } /*===========================================================================*\ \*===========================================================================*/ inline tUInt CStandardQueue::FreeItems (void) { return (ByteQueue.FreeSize() / sizeItem); } /*===========================================================================*\ \*===========================================================================*/ inline tUInt CStandardQueue::MaxItems (void) { return maxItems; } /*===========================================================================*\ \*===========================================================================*/ inline tUInt CStandardQueue::ItemSize (void) { return sizeItem; } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/DynByteQ.h0000644000175000017500000000350710470310070020043 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _DYNBYTEQ_H_ #define _DYNBYTEQ_H_ #include "ByteQueu.h" /*===========================================================================*\ \*===========================================================================*/ class CDynamicByteQueue : public CStandardByteQueue { public: CDynamicByteQueue (tUInt startQueueSize, tBool PartFillAllow = vFalse); tUInt Put (tUByte *dataIn, tUInt length); tUInt PutInFront (tUByte *dataIn, tUInt length); }; /*===========================================================================*\ inline function \*===========================================================================*/ inline CDynamicByteQueue::CDynamicByteQueue (tUInt startQueueSize, tBool PartFillAllow) : CStandardByteQueue (startQueueSize, PartFillAllow) { /*----- Nothing to Do! -----*/ } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/DbgInfo.cpp0000644000175000017500000005655710470310070020224 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include #include "DbgInfo.h" #include "CDbgIDS.h" #include "aStrPrt.h" #include "aString.h" #include "ExtFuncs.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define DEBUGINFO_PRINTBUF_SIZE 100 #define dwrite_MAX_CHAR_LENGTH 150 /*===========================================================================*\ \*===========================================================================*/ #if (USE_DEBUG_INFO_CLASS > _USE_DEBUG_INFO_CLASS_NONE) /*===========================================================================*\ \*===========================================================================*/ static tBool BreakPointsAreActive = vFalse; void dActivateBreakPoint (tBool activate) { BreakPointsAreActive = activate; } /*===========================================================================*\ \*===========================================================================*/ void dwriteErr (unsigned DL, char *format, ...) { if (DL >= Dbg_Level_Errors) { char string[dwrite_MAX_CHAR_LENGTH]; va_list param; va_start (param, format); s_strcpy (string, DbgIPrintLinePrefix); if (a_vsnprintf (string + DbgIPrintLinePrefixLen, dwrite_MAX_CHAR_LENGTH - DbgIPrintLinePrefixLen, format, param) >= 0) { DbgIPrintStr (string); } va_end (param); } } void dwriteWrn (unsigned DL, char *format, ...) { if (DL >= Dbg_Level_Infos) { char string[dwrite_MAX_CHAR_LENGTH]; va_list param; va_start (param, format); s_strcpy (string, DbgIPrintLinePrefix); if (a_vsnprintf (string + DbgIPrintLinePrefixLen, dwrite_MAX_CHAR_LENGTH - DbgIPrintLinePrefixLen, format, param) >= 0) { DbgIPrintStr (string); } va_end (param); } } void dwriteLog (unsigned DL, char *format, ...) { if (DL >= Dbg_Level_Logs) { char string[dwrite_MAX_CHAR_LENGTH]; va_list param; va_start (param, format); s_strcpy (string, DbgIPrintLinePrefix); if (a_vsnprintf (string + DbgIPrintLinePrefixLen, dwrite_MAX_CHAR_LENGTH - DbgIPrintLinePrefixLen, format, param) >= 0) { DbgIPrintStr (string); } va_end (param); } } void dwriteS (unsigned DL, char *format, ...) { if (DL >= Dbg_Level_Short) { char string[dwrite_MAX_CHAR_LENGTH]; va_list param; va_start (param, format); s_strcpy (string, DbgIPrintLinePrefix); if (a_vsnprintf (string + DbgIPrintLinePrefixLen, dwrite_MAX_CHAR_LENGTH - DbgIPrintLinePrefixLen, format, param) >= 0) { DbgIPrintStr (string); } va_end (param); } } void dwriteE (unsigned DL, char *format, ...) { if (DL >= Dbg_Level_Entry) { char string[dwrite_MAX_CHAR_LENGTH]; va_list param; va_start (param, format); s_strcpy (string, DbgIPrintLinePrefix); if (a_vsnprintf (string + DbgIPrintLinePrefixLen, dwrite_MAX_CHAR_LENGTH - DbgIPrintLinePrefixLen, format, param) >= 0) { DbgIPrintStr (string); } va_end (param); } } void dwriteI (unsigned DL, char *format, ...) { if (DL >= Dbg_Level_Internal) { char string[dwrite_MAX_CHAR_LENGTH]; va_list param; va_start (param, format); s_strcpy (string, DbgIPrintLinePrefix); if (a_vsnprintf (string + DbgIPrintLinePrefixLen, dwrite_MAX_CHAR_LENGTH - DbgIPrintLinePrefixLen, format, param) >= 0) { DbgIPrintStr (string); } va_end (param); } } #endif /*===========================================================================*\ \*===========================================================================*/ #if (USE_DEBUG_INFO_CLASS == _USE_DEBUG_INFO_CLASS_EMULATION) void dparams (const char *format, ...) { va_list param; va_start (param, format); char output[DBGDYNSTRING_STARTMAXLENGTH]; if (a_vsnprintf(output, DBGDYNSTRING_STARTMAXLENGTH, format, param) >= 0) { DbgIPrintFull (PARAMETERS_BEGIN "%s" PARAMETERS_END, output); } else { DbgIPrintFull ("\ndparams: buffer to small\n"); } va_end (param); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ void dprintBuf (const void *data, unsigned length) { if (data && length) { unsigned i; unsigned j; unsigned laufbuffree; char outstring[DEBUGINFO_PRINTBUF_SIZE]; char *laufbuf; unsigned char *databuf; for (i = 0; i < length; i += 0x10) { a_snprintf (outstring, DEBUGINFO_PRINTBUF_SIZE, "\n%05x: ", (i & 0xFFFFF)); laufbuffree = DEBUGINFO_PRINTBUF_SIZE - 8; laufbuf = outstring + 8; databuf = (((unsigned char *)data) + i); for (j = 0; j < 0x10; j++) { if (i + j < length) { if (j && (j % 4 == 0)) { DbgIAssert (laufbuffree >= 5); a_snprintf (laufbuf, laufbuffree, "' %02x ", *databuf); laufbuffree -= 5; laufbuf += 5; } else { DbgIAssert (laufbuffree >= 3); a_snprintf (laufbuf, laufbuffree, "%02x ", *databuf); laufbuf += 3; } databuf++; } else { if (j % 4 == 0) { DbgIAssert (laufbuffree >= 5); a_snprintf (laufbuf, laufbuffree, " "); laufbuf += 5; } else { DbgIAssert (laufbuffree >= 3); a_snprintf (laufbuf, laufbuffree, " "); laufbuf += 3; } } } DbgIAssert (laufbuffree >= 20); *(laufbuf++) = '|'; *(laufbuf++) = ' '; databuf = (((unsigned char *)data) + i); for (j = 0; ((j < 0x10) && (i + j < length)); j++, laufbuf++, databuf++) { *laufbuf = (*databuf < 32) ? '.' : *databuf; } *(laufbuf++) = ' '; *laufbuf = '\0'; DbgIPrintFull ("%s", outstring); } DbgIPrintFull ("\n"); } else { DbgIPrintFull ("DATA: (p=%x, l=%x)\n", data, length); } } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ int dinfo (const int expression, const char *format, ...) { int fret = 0; if (!expression) { va_list param; va_start (param, format); char output[DBGDYNSTRING_STARTMAXLENGTH]; fret = a_vsnprintf(output, DBGDYNSTRING_STARTMAXLENGTH, format, param); if (fret >= 0) { DbgIPrintFull ("[info: %s]\n", output); } va_end (param); } return fret; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ unsigned DbgIPrintValue (unsigned val, const char *sval, const char *filename, const unsigned int line) { DbgIPrintFull ("Call of '%s' in %s(%d) returns %x.\n", sval, filename, line, val); return val; } /*===========================================================================*\ \*===========================================================================*/ #elif (USE_DEBUG_INFO_CLASS >= _USE_DEBUG_INFO_CLASS_NORMAL) static unsigned IndentSpaces = 0; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ CDebugInfo::CDebugInfo(char *FuncName, unsigned DebugLevel, unsigned PrintLevel, char *_FileName, unsigned _LineNumber) { RetValue.format = 0; debuglevel = DebugLevel; if (DebugLevel > Dbg_Level_Nothing) { spaces = IndentSpaces; IndentSpaces += DEBUG_INDENT_WIDTH; name = FuncName; linenumber = _LineNumber; printlevel = PrintLevel; filename = _FileName; for (; *_FileName != '\0'; _FileName++) { if ((*_FileName == '\\') || (*_FileName == '/')) { filename = _FileName + 1; } } if (printlevel & Prt_Level_NameAtFuncStart) { if (debuglevel == Dbg_Level_Short) { RememberOutput (NAMEFORSHORT_BEGIN "%s%s", DbgIPrintLinePrefix, name); DbgPrintIntern(); } else if (debuglevel >= Dbg_Level_Entry) { if (printlevel & Prt_Level_FileNameAtStart) { RememberOutput ("%*t" NAMEATFUNCSTART_BEGIN "%s%s in %s(%d)" NAMEATFUNCSTART_END, spaces, ' ', DbgIPrintLinePrefix, name, filename, linenumber); } else { RememberOutput ("%*t" NAMEATFUNCSTART_BEGIN "%s%s" NAMEATFUNCSTART_END, spaces, ' ', DbgIPrintLinePrefix, name); } DbgPrintIntern(); } } } else { name = 0; filename = 0; linenumber = 0; printlevel = 0; spaces = 0; } } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ CDebugInfo::~CDebugInfo (void) { /*----- Ende der Funktion ausgeben -----*/ if (debuglevel == Dbg_Level_Short) { RememberOutput (NAMEFORSHORT_END, name); DbgPrintIntern(); } else if ((debuglevel >= Dbg_Level_Entry) && (printlevel & Prt_Level_NameAtFuncStart)) { if ((debuglevel >= Dbg_Level_Entry) && (RetValue.format != '\0')) { char ParamOutput[sizeof(NAMEATFUNCEND_BEGIN) + sizeof(NAMEATFUNCEND_END) + sizeof(RETURNVALUE_BEGIN) + sizeof(RETURNVALUE_END) + 8] = "%*t" NAMEATFUNCEND_BEGIN RETURNVALUE_BEGIN "%." RETURNVALUE_END "%s%*t" NAMEATFUNCEND_END; ParamOutput[sizeof(NAMEATFUNCEND_BEGIN) + sizeof(RETURNVALUE_BEGIN) + 2] = RetValue.format; RememberOutput (ParamOutput, spaces, ' ', RetValue.p, name, spaces - DEBUG_INDENT_WIDTH, ' '); } else { RememberOutput ("%*t" NAMEATFUNCEND_BEGIN "%s%*t" NAMEATFUNCEND_END, spaces, ' ', name, spaces - DEBUG_INDENT_WIDTH, ' '); } DbgPrintIntern(); } if (debuglevel > Dbg_Level_Nothing) { IndentSpaces -= DEBUG_INDENT_WIDTH; } /*----- Speicherplatz aufräumen -----*/ name = 0; filename = 0; linenumber = 0; debuglevel = printlevel = 0; spaces = 0; RetValue.format = 0; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ void CDebugInfo::print (const char *format, ...) { if ((name == 0) || (debuglevel < Dbg_Level_Internal)) return; va_list param; va_start (param, format); vRememberOutput (format, param); DbgPrintIntern (); va_end (param); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ void CDebugInfo::printBuf (const void *data, unsigned length) { if (data && length && (debuglevel >= Dbg_Level_Internal)) { unsigned i = 0; unsigned j; unsigned laufbuffree; char outstring[DEBUGINFO_PRINTBUF_SIZE]; char *laufbuf; unsigned char *databuf; for (;;) { a_snprintf (outstring, DEBUGINFO_PRINTBUF_SIZE, "\n%05x: ", (i & 0xFFFFF)); laufbuffree = DEBUGINFO_PRINTBUF_SIZE - 8; laufbuf = outstring + 8; databuf = (((unsigned char *)data) + i); for (j = 0; j < 0x10; j++) { if (i + j < length) { if (j && (j % 4 == 0)) { DbgIAssert (laufbuffree >= 5); a_snprintf (laufbuf, laufbuffree, "' %02x ", *databuf); laufbuffree -= 5; laufbuf += 5; } else { DbgIAssert (laufbuffree >= 3); a_snprintf (laufbuf, laufbuffree, "%02x ", *databuf); laufbuf += 3; } databuf++; } else { if (j % 4 == 0) { DbgIAssert (laufbuffree >= 5); a_snprintf (laufbuf, laufbuffree, " "); laufbuf += 5; } else { DbgIAssert (laufbuffree >= 3); a_snprintf (laufbuf, laufbuffree, " "); laufbuf += 3; } } } DbgIAssert (laufbuffree >= 20); *(laufbuf++) = '|'; *(laufbuf++) = ' '; databuf = (((unsigned char *)data) + i); for (j = 0; ((j < 0x10) && (i + j < length)); j++, laufbuf++, databuf++) { *laufbuf = (*databuf < 32) ? '.' : *databuf; } *(laufbuf++) = ' '; *laufbuf = '\0'; i += 0x10; if (i >= length) { break; } RememberOutput ("%s", outstring); DbgPrintIntern(); } RememberOutput ("%s\n", outstring); DbgPrintIntern(); } else if (debuglevel >= Dbg_Level_Internal) { RememberOutput ("DATA: (p=%x, l=%x)\n", data, length); DbgPrintIntern(); } } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ unsigned CDebugInfo::printValue (unsigned val, const char *sval, const unsigned int line) { //RememberOutput ("VALUE: '%s' in %s(%d) = %x\n", sval, filename, line, val); if ( (debuglevel >= Dbg_Level_Internal) || ((val != 0) && (debuglevel >= Dbg_Level_Short))) { RememberOutput ("VALUE: '%s' = %x\n", sval, filename, line, val); DbgPrintIntern(); } return val; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ void CDebugInfo::printWrn (const char *format, ...) { if ((name == 0)|| (debuglevel < Dbg_Level_Infos)) return; va_list param; va_start (param, format); if (printlevel & Prt_Level_FileNameAtInfo) { RememberOutput ("%s[NOTE(%s in %s(%d+)): ", DbgIPrintLinePrefix, name, filename, linenumber); vRememberOutput (format, param); RememberOutput ("]\n"); } else { RememberOutput ("%s[NOTE(%s): ", DbgIPrintLinePrefix, name); vRememberOutput (format, param); RememberOutput ("]\n"); } DbgPrintIntern(); va_end (param); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ void CDebugInfo::printErr (const char *format, ...) { if ((name == 0) || (debuglevel < Dbg_Level_Errors)) return; va_list param; va_start (param, format); if (printlevel & Prt_Level_FileNameAtInfo) { RememberOutput ("%s[ERROR(%s in %s(%d+)): ", DbgIPrintLinePrefix, name, filename, linenumber); vRememberOutput (format, param); RememberOutput ("]\n"); } else { RememberOutput ("%s[ERROR(%s): ", DbgIPrintLinePrefix, name); vRememberOutput (format, param); RememberOutput ("]\n"); } DbgPrintIntern(); va_end (param); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ void CDebugInfo::assertion (const char *exp, const unsigned int line) { if ((name == 0) || (debuglevel < Dbg_Level_Errors)) return; if (printlevel & Prt_Level_FuncNameAtError) { RememberOutput ("%s[assertion failed: (%s) %s in %s(%d)]\n", DbgIPrintLinePrefix, exp, name, filename, line); } else { RememberOutput ("%s[assertion failed: (%s) in %s(%d)]\n", DbgIPrintLinePrefix, exp, filename, line); } DbgPrintIntern(); if (BreakPointsAreActive) { DbgIBreakPoint(); } } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ void CDebugInfo::assertion (const int expValue, const char *exp, const char *fname, const unsigned int line) { if (expValue || !name || (debuglevel < Dbg_Level_Errors)) return; unsigned last = 0; for (unsigned i = 0; fname[i] != '\0'; i++) { if ((fname[i] == '\\') || (fname[i] =='/')) { last = i + 1; } } fname += last; if (printlevel & Prt_Level_FuncNameAtError) { RememberOutput ("%s[assertion failed: (%s) %s in %s(%d)]\n", DbgIPrintLinePrefix, exp, name, fname, line); } else { RememberOutput ("%s[assertion failed: (%s) in %s(%d)]\n", DbgIPrintLinePrefix, exp, fname, line); } DbgPrintIntern(); if (BreakPointsAreActive) { DbgIBreakPoint(); } } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ void CDebugInfo::warning (const char *exp, const unsigned int line) { if (!name || (debuglevel < Dbg_Level_Infos)) return; if (printlevel & Prt_Level_FuncNameAtError) { RememberOutput ("%s[warning: (%s) %s in %s(%d)]\n", DbgIPrintLinePrefix, exp, name, filename, line); } else { RememberOutput ("%s[warning: (%s) in %s(%d)]\n", DbgIPrintLinePrefix, exp, filename, line); } DbgPrintIntern(); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ void CDebugInfo::warning (const int expValue, const char *exp, const char *fname, const unsigned int line) { if (expValue || !name || (debuglevel < Dbg_Level_Infos)) return; unsigned last = 0; for (unsigned i = 0; fname[i] != '\0'; i++) { if ((fname[i] == '\\') || (fname[i] =='/')) { last = i + 1; } } fname += last; if (printlevel & Prt_Level_FuncNameAtError) { RememberOutput ("%s[warning: (%s) %s in %s(%d)]\n", DbgIPrintLinePrefix, exp, name, fname, line); } else { RememberOutput ("%s[warning: (%s) in %s(%d)]\n", DbgIPrintLinePrefix, exp, fname, line); } DbgPrintIntern(); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ void CDebugInfo::info (const int expression, const char *format, ...) { if (expression || !name || (debuglevel < Dbg_Level_Infos)) return; va_list param; va_start (param, format); if (printlevel & Prt_Level_FileNameAtInfo) { RememberOutput ("%s[info(%s in %s(%d+)): ", DbgIPrintLinePrefix, name, filename, linenumber); vRememberOutput (format, param); RememberOutput ("]\n"); } else { RememberOutput ("%s[info(%s): ", DbgIPrintLinePrefix, name); vRememberOutput (format, param); RememberOutput ("]\n"); } DbgPrintIntern(); va_end (param); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #include void CDebugInfo::PrintParams (const char *format, ...) { if (name == 0) return; va_list param; va_start (param, format); switch (debuglevel) { case Dbg_Level_Short: RememberOutput (PARAMETERS_SHORT_BEGIN); vRememberOutput (format, param); RememberOutput (PARAMETERS_SHORT_END); DbgPrintIntern(); break; case Dbg_Level_Entry: case Dbg_Level_Internal: RememberOutput (PARAMETERS_BEGIN); vRememberOutput (format, param); RememberOutput (PARAMETERS_END); DbgPrintIntern(); break; } va_end (param); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ void CDebugInfo::SetRetVal (const char format, ...) { va_list param; va_start (param, format); RetValue.format = format; // Lieber einen kleine Hack, weil schneller !!! // Es wird sich der speicher-größte Parameter gemerkt und // erst bei der Ausgabe die Fallabfrage gemacht. RetValue.p = va_arg (param, void *); va_end (param); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ void CDebugInfo::ShowAllOutputs (void) { if (!Output.IsEmpty()) { char *outstr = Output.GetAll(); DbgIPrintStr (outstr); } /*----- TODO: Funktionsnamen ausgeben, immer oder wennn nichts in der OutputQueue -----*/ } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ void CDebugInfo::RememberOutput (const char *format, ...) { va_list param; va_start (param, format); vRememberOutput (format, param); va_end (param); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ void CDebugInfo::vRememberOutput (const char *format, va_list param) { if (printlevel & Prt_Level_NameInEveryLine) { Output.AddTo (spaces, NAMEINEVERYLINE_BEGIN "%s" NAMEINEVERYLINE_END, name); } Output.vAddTo (spaces, format, param); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ void CDebugInfo::DbgPrintIntern (void) { DbgIPrintStr (Output.GetAll()); } /*===========================================================================*\ \*===========================================================================*/ #endif /* #elif (USE_DEBUG_INFO_CLASS >= _USE_DEBUG_INFO_CLASS_NORMAL) */ capi4hylafax-svn/src/standard/aTypes.h0000644000175000017500000001232110470310070017603 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _ATYPES_H_ #define _ATYPES_H_ /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #if !defined C_PLATFORM_64 && defined SIZEOF_VOID_P && (SIZEOF_VOID_P == 8) #define C_PLATFORM_64 #endif /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #ifndef ASTRING_DONT_USE_WCHAR #include #endif #if defined HAVE_STDINT_H && HAVE_STDINT_H > 0 #include #else typedef signed char int8_t; typedef short int int16_t; typedef int int32_t; typedef unsigned char uint8_t; typedef unsigned short int uint16_t; typedef unsigned int uint32_t; #ifdef __linux__ #if __WORDSIZE == 64 typedef long int int64_t; typedef unsigned long int uint64_t; #else typedef long long int int64_t; typedef unsigned long long int uint64_t; #endif #else typedef __int64 int64_t; typedef unsigned __int64 uint64_t; #endif // __linux__ #endif // __STDC_VERSION__ /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #ifdef __cplusplus typedef bool tBool; #define vFalse false #define vTrue true #else typedef enum { vFalse = 0, vTrue = 1 } tBool; #endif typedef enum { vMinus = -1, vZero = 0, vPlus = 1 } tSign; typedef enum { vLower = -1, vEqual = 0, vHigher = 1 } tCompare; typedef enum { vError = -2, vCancel = -1, vNo = 0, vYes = 1 } tResult; typedef uint8_t tUChar; typedef int8_t tSChar; typedef tUChar tChar; #ifndef ASTRING_DONT_USE_WCHAR typedef wchar_t tWiChar; #else typedef uint16_t tWiChar; #endif typedef tWiChar tUWiChar; typedef uint8_t tUByte; typedef int8_t tSByte; typedef uint16_t tUInt16; typedef int16_t tSInt16; typedef uint32_t tUInt32; typedef int32_t tSInt32; typedef uint64_t tUInt64; typedef int64_t tSInt64; typedef tUInt16 tUShort; typedef tSInt16 tSShort; typedef tUInt32 tUInt; // default type typedef tSInt32 tSInt; // default signed type // Integer, with size of a pointer #ifdef C_PLATFORM_64 typedef tUInt64 tULong; typedef tSInt64 tSLong; #else typedef tUInt32 tULong; typedef tSInt32 tSLong; #endif typedef tULong tSize; typedef tSLong tOffset; typedef void **tHandle; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define vIllegalHandle 0 #define MAXVAL_tChar ((tChar) -1) #define MAXVAL_tUChar ((tUChar) -1) #define MAXVAL_tSChar ((tSChar) ((MAXVAL_tUChar - 1) / 2)) #define MINVAL_tSChar ((tSChar) - MAXVAL_tSChar - 1) #define MAXVAL_tWiChar ((tWiChar) -1) #define MAXVAL_tUWiChar ((tUWiChar) -1) #define MAXVAL_tUByte ((tUByte) -1) #define MAXVAL_tSByte ((tSByte) ((MAXVAL_tUByte - 1) / 2)) #define MINVAL_tSByte ((tSByte) - MAXVAL_tSByte - 1) #define MAXVAL_tUInt16 ((tUInt16) -1) #define MAXVAL_tSInt16 ((tSInt16) ((MAXVAL_tUInt16 - 1) / 2)) #define MINVAL_tSInt16 ((tSShort) - MAXVAL_tSInt16 - 1) #define MAXVAL_tUInt32 ((tUInt32) -1) #define MAXVAL_tSInt32 ((tSInt32) ((MAXVAL_tUInt32 - 1) / 2)) #define MINVAL_tSInt32 ((tSInt32) - MAXVAL_tSInt32 - 1) #define MAXVAL_tUInt64 ((tUInt64) -1) #define MAXVAL_tSInt64 ((tSInt64) ((MAXVAL_tUInt64 - 1) / 2)) #define MINVAL_tSInt64 ((tSInt64) - MAXVAL_tSInt64 - 1) #define MAXVAL_tUShort ((tUShort) -1) #define MAXVAL_tSShort ((tSShort) ((MAXVAL_tUShort - 1) / 2)) #define MINVAL_tSShort ((tSShort) - MAXVAL_tSShort - 1) #define MAXVAL_tUInt ((tUInt) -1) #define MAXVAL_tSInt ((tSInt) ((MAXVAL_tUInt - 1) / 2)) #define MINVAL_tSInt ((tSInt) - MAXVAL_tSInt - 1) #define MAXVAL_tULong ((tULong) -1) #define MAXVAL_tSLong ((tSLong) ((MAXVAL_tULong - 1) / 2)) #define MINVAL_tSLong ((tSLong) - MAXVAL_tSLong - 1) #define MAXVAL_tSize ((tSize) -1) #define MAXVAL_tOffset ((tOffset) ((MAXVAL_tSize - 1) / 2)) #define MINVAL_tOffset ((tOffset) - MAXVAL_tOffset - 1) #endif capi4hylafax-svn/src/standard/FilePars.h0000644000175000017500000000274210470310070020051 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _FILEPARS_H_ #define _FILEPARS_H_ #include "ConfPars.h" #include /*===========================================================================*\ \*===========================================================================*/ class CConfigFileParser : public CConfigGrammarParser { public: tSInfo ParseFile (tUChar *FileName); tSInfo ParseFile (FILE *FileHandle); virtual void LineCodingError (tUInt /*LineNr*/, CDynamicString * /*LineStr*/) {} }; /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/DataPack.h0000644000175000017500000003051410470310070020012 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _DATAPACK_H_ #define _DATAPACK_H_ #include "aTypes.h" #include "aString.h" #include "InfoType.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #ifndef DATA_PACKET_HANDLE_COUNT #define DATA_PACKET_HANDLE_COUNT 1 // have to be 1 or greater!!! #endif #define iWrn_Pack_DestFull CalculateInfoValue (infoType_Packet, infoKind_Warning, 1) #define iWrn_Pack_BothFull CalculateInfoValue (infoType_Packet, infoKind_Warning, 1) #define iErr_Pack_NotAllowed CalculateInfoValue (infoType_Packet, infoKind_Error, 1) #define iErr_Pack_LenToSmall CalculateInfoValue (infoType_Packet, infoKind_Error, 2) /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ union tHUnion { void *p; tChar *c; tHandle h; tUByte b; tUInt32 u; tSInt32 s; tUInt16 u16; tSInt16 s16; #ifdef C_PLATFORM_64 tUInt64 u64; tSInt64 s64; tHUnion (tUInt64 v) { u64 = v; } tHUnion (tSInt64 v) { s64 = v; } #endif tHUnion (void) { p = (void *)0; } tHUnion (void *v) { p = v; } tHUnion (tChar *v) { c = v; } tHUnion (tHandle v) { h = v; } tHUnion (tUByte v) { b = v; } tHUnion (tUInt32 v) { u = v; } tHUnion (tSInt32 v) { s = v; } tHUnion (tUInt16 v) { u16 = v; } tHUnion (tSInt16 v) { s16 = v; } }; /*===========================================================================*\ \*===========================================================================*/ class CBasicDataPacketQueue { public: virtual ~CBasicDataPacketQueue (void) {} virtual class CDataPacket *RecvPacket (void) = 0; virtual void ReturnPacket (class CDataPacket *pPacket, tSInfo info) = 0; }; /*===========================================================================*\ \*===========================================================================*/ class CDataPacket { public: CDataPacket (void); virtual ~CDataPacket (void) {} // Pointer tUByte *GetPointer (void); tUByte *GetPointer (tSize offset); tUByte *GetPosPointer (void); tUByte *GetLenPointer (void); // Length tSize GetLen (void); tSize GetFreeLen (void); tSize GetMaxLen (void); void SetLen (tSize len); void SetLenToMax (void); void AddLen (tOffset len); void SubLen (tOffset len); void IncLen (void); void DecLen (void); tBool LenIsMax (void); tBool IsEmpty (void); // Position tSize GetPos (void); tSize DiffPosToLen (void); tSize DiffPosToMaxLen (void); tBool SetPos (tSize pos); void SetPosToLen (void); tBool AddPos (tSize pos); tBool PosIsLen (void); tBool PosIsMax (void); // Handle tHUnion GetHandle (tUInt number = 0); // number < DATA_PACKET_HANDLE_COUNT void SetHandle (tHUnion handle, tUInt number = 0); // number < DATA_PACKET_HANDLE_COUNT // Queue CDataPacket *GetNextPacket (void); void SetNextPacket (CDataPacket *pPacket); void ReturnPacket (tSInfo info = i_Okay); void SetPacketQueue (CBasicDataPacketQueue *pQueue); // Copy tSInfo Copy (CDataPacket *pPacket); // return: i_Okay, iWrn_Pack_DestFull, iWrn_Pack_BothFull // Resize virtual tSInfo Resize (tSize NewMaxLen); protected: void SetPointer (tUByte *DataPointer); void SetMaxLen (tSize MaxLen); private: CBasicDataPacketQueue *m_pQueue; CDataPacket *m_pNext; tUByte *m_Pointer; tSize m_MaxLen; tSize m_Len; tSize m_Pos; tHUnion m_Handle[DATA_PACKET_HANDLE_COUNT]; }; /*===========================================================================*\ \*===========================================================================*/ class CDataPacketStore : public CDataPacket { public: CDataPacketStore (void) {} CDataPacketStore (tSize MaxLen); ~CDataPacketStore (void); tSInfo Resize (tSize NewMaxLen); }; class CDataPacketReference : public CDataPacket { public: CDataPacketReference (void) {} CDataPacketReference (tUByte *pPointer, tSize MaxLen, tSize Len = 0, tHUnion FirstHandle = 0); void InitToMax (tUByte *pPointer, tSize Len); void InitToMax (tUByte *pPointer, tSize Len, tHUnion FirstHandle); void InitAll (tUByte *pPointer, tSize MaxLen, tSize Len = 0); void InitAll (tUByte *pPointer, tSize MaxLen, tHUnion FirstHandle); void InitAll (tUByte *pPointer, tSize MaxLen, tSize Len, tHUnion FirstHandle); }; /*===========================================================================*\ CDataPacket - inline functions \*===========================================================================*/ inline CDataPacket::CDataPacket (void) : m_pQueue (0), m_pNext (0), m_Pointer (0), m_MaxLen (0), m_Len (0), m_Pos (0) { s_memzero (m_Handle, DATA_PACKET_HANDLE_COUNT * sizeof (tHUnion)); } inline tUByte *CDataPacket::GetPointer (void) { return m_Pointer; } inline tUByte *CDataPacket::GetPointer (tSize offset) { return m_Pointer + offset; } inline tUByte *CDataPacket::GetPosPointer (void) { return (m_Pos < m_MaxLen) ? GetPointer (m_Pos) : 0; } inline tUByte *CDataPacket::GetLenPointer (void) { return GetPointer (m_Len); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tSize CDataPacket::GetLen (void) { return m_Len; } inline tSize CDataPacket::GetFreeLen (void) { return m_MaxLen - m_Len; } inline tSize CDataPacket::GetMaxLen (void) { return m_MaxLen; } inline void CDataPacket::SetLen (tSize len) { // assert (len <= MaxLen); m_Len = len; if (m_Pos > len) { SetPosToLen(); } } inline void CDataPacket::SetLenToMax (void) { m_Len = m_MaxLen; } inline void CDataPacket::AddLen (tOffset len) { // assert (len + m_Len <= MaxLen); m_Len += len; } inline void CDataPacket::SubLen (tOffset len) { // assert (m_Len >= len); m_Len -= len; if (m_Pos > m_Len) { SetPosToLen(); } } inline void CDataPacket::IncLen (void) { // assert (m_Len + 1<= MaxLen); m_Len++; } inline void CDataPacket::DecLen (void) { // assert (m_Len > 0); m_Len--; } inline tBool CDataPacket::LenIsMax (void) { return (m_MaxLen == m_Len) ? vTrue : vFalse; } inline tBool CDataPacket::IsEmpty (void) { return (m_Len == 0); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tSize CDataPacket::GetPos (void) { return m_Pos; } inline tSize CDataPacket::DiffPosToLen (void) { return m_Len - m_Pos; } inline tSize CDataPacket::DiffPosToMaxLen (void) { return m_MaxLen - m_Pos; } inline tBool CDataPacket::SetPos (tSize pos) { if (pos < m_Len) { m_Pos = pos; return vTrue; } SetPosToLen(); return vFalse; } inline void CDataPacket::SetPosToLen (void) { m_Pos = m_Len; } inline tBool CDataPacket::AddPos (tSize pos) { m_Pos += pos; if (m_Pos <= m_Len) { return vTrue; } SetPosToLen(); return vFalse; } inline tBool CDataPacket::PosIsLen (void) { return (m_Pos == m_Len); } inline tBool CDataPacket::PosIsMax (void) { return (m_Pos == m_MaxLen); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tHUnion CDataPacket::GetHandle (tUInt number) { return m_Handle[number]; } inline void CDataPacket::SetHandle (tHUnion handle, tUInt number) { m_Handle[number] = handle; } inline CDataPacket *CDataPacket::GetNextPacket (void) { return m_pNext; } inline void CDataPacket::SetNextPacket (CDataPacket *pPacket) { m_pNext = pPacket; } inline void CDataPacket::ReturnPacket (tSInfo info) { // assert (m_pQueue != 0); m_pQueue->ReturnPacket (this, info); } inline void CDataPacket::SetPacketQueue (CBasicDataPacketQueue *pQueue) { m_pQueue = pQueue; } inline tSInfo CDataPacket::Copy (CDataPacket *pPacket) { // assert (pPacket != 0); tSize l1 = GetFreeLen(); tSize l2 = pPacket->DiffPosToLen(); tSInfo fret; switch (a_compare (l1, l2)) { default: // dassert (0); // no break! case vEqual: fret = iWrn_Pack_BothFull; break; case vLower: fret = iWrn_Pack_DestFull; break; case vHigher: l1 = l2; fret = i_Okay; break; } s_memcpy (GetLenPointer(), pPacket->GetPosPointer(), l1); AddLen (l1); pPacket->AddPos (l1); return fret; } inline tSInfo CDataPacket::Resize (tSize) { return iErr_Pack_NotAllowed; } inline void CDataPacket::SetPointer (tUByte *DataPointer) { m_Pointer = DataPointer; } inline void CDataPacket::SetMaxLen (tSize MaxLen) { m_MaxLen = MaxLen; if (m_Len > MaxLen) { SetLen (MaxLen); } } /*===========================================================================*\ Other CDataPacket Classes \*===========================================================================*/ inline CDataPacketStore::CDataPacketStore (tSize MaxLen) { // dassert (MaxLen > 0); tUByte *Buffer = new tUByte [MaxLen]; if (Buffer) { SetPointer (Buffer); SetMaxLen (MaxLen); } } inline CDataPacketStore::~CDataPacketStore (void) { tUByte *Buffer = GetPointer(); SetPointer (0); delete [] Buffer; } inline tSInfo CDataPacketStore::Resize (tSize NewMaxLen) { if (NewMaxLen < GetLen()) { return iErr_Pack_LenToSmall; } tUByte *Buffer = 0; if (NewMaxLen) { Buffer = new tUByte [NewMaxLen]; if (!Buffer) { return iErr_OutOfMemory; } } tUByte *oldBuf = GetPointer(); // dassert ((GetLen() == 0) || (oldBuf != 0)); s_memcpy (oldBuf, Buffer, GetLen()); SetPointer (Buffer); SetMaxLen (NewMaxLen); delete [] oldBuf; return i_Okay; } inline CDataPacketReference::CDataPacketReference (tUByte *pPointer, tSize MaxLen, tSize Len, tHUnion FirstHandle) { // dassert (DATA_PACKET_HANDLE_COUNT >= 1); InitAll (pPointer, MaxLen, Len, FirstHandle); } inline void CDataPacketReference::InitToMax (tUByte *pPointer, tSize Len) { InitAll (pPointer, Len, Len); } inline void CDataPacketReference::InitToMax (tUByte *pPointer, tSize Len, tHUnion FirstHandle) { // dassert (DATA_PACKET_HANDLE_COUNT >= 1); InitAll (pPointer, Len, Len, FirstHandle); } inline void CDataPacketReference::InitAll (tUByte *pPointer, tSize MaxLen, tSize Len) { SetPointer (pPointer); SetMaxLen (MaxLen); SetPos (0); SetLen (Len); } inline void CDataPacketReference::InitAll (tUByte *pPointer, tSize MaxLen, tHUnion FirstHandle) { // dassert (DATA_PACKET_HANDLE_COUNT >= 1); SetPointer (pPointer); SetMaxLen (MaxLen); SetPos (0); SetLen (0); SetHandle (FirstHandle); } inline void CDataPacketReference::InitAll (tUByte *pPointer, tSize MaxLen, tSize Len, tHUnion FirstHandle) { // dassert (DATA_PACKET_HANDLE_COUNT >= 1); SetPointer (pPointer); SetMaxLen (MaxLen); SetPos (0); SetLen (Len); SetHandle (FirstHandle); } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/CString.h0000644000175000017500000002413010470310070017710 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _CSTRING_H_ #define _CSTRING_H_ #include "aTypes.h" #include "aString.h" #include /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define CSTRING_RESIZE_ALLOCATE_OFFSET 100 #ifdef CSTRING_CHAR_IS_WIDE_CHAR typedef tWiChar tStringChar; #else typedef tChar tStringChar; #endif typedef tStringChar *tString; typedef char tFormatChar; /*===========================================================================*\ \*===========================================================================*/ class CConstString { public: CConstString (tString string, tUInt len = 0); // string have to be null terminated! len ist not tested! virtual ~CConstString (void) {} tBool IsEmpty (void); tUInt GetLen (void); // GetLen & Get(Max)Size return multiples of tStringChar! tUInt GetSize (void); tUInt GetMaxSize (void); tString GetPointer (void); tBool ErrorDetected (void); protected: CConstString (void); tUInt check_strlen (const tChar *string); tUInt check_strlen (const tWiChar *string); tUInt check_strlen (const char *string); tString pntr; tUInt curLen; tUInt maxSize; tBool detectError; }; /*===========================================================================*\ \*===========================================================================*/ class CDynamicString : public CConstString { public: CDynamicString (void) {} CDynamicString (tFormatChar *string, tUInt len = 0); CDynamicString (CConstString *pcstr); CDynamicString (tUInt startSize); virtual ~CDynamicString (void); tBool Set (tString string, tUInt len = 0); tBool Set (tFormatChar *string, tUInt len = 0); tBool Set (CConstString *pcstr); tBool Append (tString string, tUInt len = 0); tBool Append (tFormatChar *string, tUInt len = 0); tBool Append (CConstString *pcstr); tBool Change (tString string, tUInt startPos, tUInt len = 0); tBool Change (tFormatChar *string, tUInt startPos, tUInt len = 0); tBool Change (CConstString *pcstr, tUInt startPos, tUInt len = 0); tBool Insert (tString string, tUInt startPos, tUInt len = 0); tBool Insert (tFormatChar *string, tUInt startPos, tUInt len = 0); tBool Insert (CConstString *pcstr, tUInt startPos, tUInt len = 0); tBool Fill (tStringChar fillChar, tUInt len, tUInt startPos = 0); tBool FillAppend (tStringChar fillChar, tUInt len); tSInt Print (tFormatChar *format, ...); tSInt vPrint (tFormatChar *format, va_list argptr); tSInt PrintAppend (tFormatChar *format, ...); tSInt vPrintAppend (tFormatChar *format, va_list argptr); tCompare Compare (tString string, tUInt len = 0); tBool IsIdentical (tString string, tUInt len = 0); void Get (tString string, tUInt len = 0, tUInt startPos = 0); tStringChar GetChar (tUInt pos); tStringChar GetLastChar (void); tUInt FindChar (tStringChar ch, tUInt startpos = 0); // not found => return = MAXVAL_tSize tUInt FindLastChar (tStringChar ch); // not found => return = MAXVAL_tSize void SetLen (tUInt newLen); void CutLen (tUInt cutLen); // Result: newlen = oldLen - cutLen void OverwriteLen (tUInt newLen); // = SetLen without len check => dangerous void Remove (tUInt startPos, tUInt len); void RemoveChars (tString RemoveChars, tUInt startPos = 0, tUInt len = 0); void RemoveAll (void); tBool Resize (tUInt newMaxSize); private: tSInt i_vPrintAppend (tFormatChar *format, va_list argptr, tUInt tabsize, tStringChar tabchar); tUInt i_Print_ltoa (tFormatChar **pBuffer, tUInt64 value, tSByte radix, tUInt *pWidth, tUInt pFlags); tBool DynExpand (tUInt newMaxSize); }; /*===========================================================================*\ inline fuctions from CConstString \*===========================================================================*/ inline CConstString::CConstString (void) : pntr (0), curLen (0), maxSize (0), detectError (vFalse) { } inline tBool CConstString::IsEmpty (void) { return (curLen == 0); } inline tUInt CConstString::GetLen (void) { return curLen; } inline tUInt CConstString::GetSize (void) { return (GetLen()) ? curLen + 1 : 0; } inline tUInt CConstString::GetMaxSize (void) { return maxSize; } inline tString CConstString::GetPointer (void) { return (GetLen()) ? pntr : 0; } inline tBool CConstString::ErrorDetected (void) { if (detectError == vFalse) { return vFalse; } detectError = vFalse; return vTrue; } /*===========================================================================*\ inline fuctions from CDynamicString \*===========================================================================*/ inline tBool CDynamicString::Set (tString string, tUInt len) { RemoveAll(); return Append (string, len); } inline tBool CDynamicString::Set (tFormatChar *string, tUInt len) { RemoveAll(); return Append (string, len); } inline tBool CDynamicString::Set (CConstString *pcstr) { if (pcstr->GetLen()) { return Set (pcstr->GetPointer(), pcstr->GetLen()); } RemoveAll(); return vTrue; } inline tBool CDynamicString::Append (tString string, tUInt len) { return Change (string, GetLen(), len); } inline tBool CDynamicString::Append (tFormatChar *string, tUInt len) { return Change (string, GetLen(), len); } inline tBool CDynamicString::Append (CConstString *pcstr) { return (pcstr->GetLen()) ? Change (pcstr->GetPointer(), GetLen(), pcstr->GetLen()) : vTrue; } inline tBool CDynamicString::Change (CConstString *pcstr, tUInt startPos, tUInt len) { return (pcstr->GetLen()) ? Change (pcstr->GetPointer(), startPos, (len) ? len : pcstr->GetLen()) : vTrue; } inline tBool CDynamicString::Insert (CConstString *pcstr, tUInt startPos, tUInt len) { return (pcstr->GetLen()) ? Insert (pcstr->GetPointer(), startPos, (len) ? len : pcstr->GetLen()) : vTrue; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tBool CDynamicString::FillAppend (tStringChar fillChar, tUInt len) { return Fill (fillChar, len, GetLen()); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tSInt CDynamicString::Print (tFormatChar *format, ...) { va_list arg_ptr; va_start (arg_ptr, format); tUInt fret = vPrint (format, arg_ptr); va_end (arg_ptr); return fret; } inline tSInt CDynamicString::vPrint (tFormatChar *format, va_list argptr) { RemoveAll(); return vPrintAppend (format, argptr); } inline tSInt CDynamicString::PrintAppend (tFormatChar *format, ...) { va_list arg_ptr; va_start (arg_ptr, format); tUInt fret = vPrintAppend (format, arg_ptr); va_end (arg_ptr); return fret; } inline tSInt CDynamicString::vPrintAppend (tFormatChar *format, va_list argptr) { return i_vPrintAppend (format, argptr, 0, 0); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tBool CDynamicString::IsIdentical (tString string, tUInt len) { if (!len) { len = check_strlen (string); } return ((len == GetLen()) && (s_strcmp (string, pntr) == vEqual)) ? vTrue : vFalse; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tStringChar CDynamicString::GetChar (tUInt pos) { //assert (pos < GetLen()); //assert (pntr != 0); return (pos < GetLen()) ? pntr[pos] : '\0'; } inline tStringChar CDynamicString::GetLastChar (void) { //assert (GetLen() > 0); //assert (pntr != 0); return GetLen() ? pntr[GetLen() - 1] : 0; } inline void CDynamicString::SetLen (tUInt newLen) { // assert (pntr != 0); // warning (newLen > curLen); if (curLen > newLen) { curLen = newLen; pntr[curLen] = '\0'; } } inline void CDynamicString::CutLen (tUInt cutLen) { // assert (pntr != 0); // warning (cutLen > curLen); if (curLen) { if (curLen > cutLen) { curLen -= cutLen; } else { curLen = 0; } pntr[curLen] = '\0'; } } inline void CDynamicString::OverwriteLen (tUInt newLen) { curLen = newLen; } inline void CDynamicString::RemoveAll (void) { if (curLen) { // assert (pntr != 0); curLen = 0; pntr[0] = '\0'; } } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tBool CDynamicString::DynExpand (tUInt newMaxSize) { return Resize ((GetMaxSize() + CSTRING_RESIZE_ALLOCATE_OFFSET > newMaxSize) ? GetMaxSize() + CSTRING_RESIZE_ALLOCATE_OFFSET : newMaxSize); } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/SecTimer.h0000644000175000017500000000446510470310070020063 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _SECTIMER_H_ #define _SECTIMER_H_ #include "CBTimer.h" /*===========================================================================*\ \*===========================================================================*/ typedef tHandle thSecTimer; tBool SecTimer_Create (thSecTimer *pTimer); void SecTimer_Destroy (thSecTimer *pTimer); tBool SecTimer_Call (thSecTimer timer, tUInt secs, tCallBackTimerFunc cbfunc, void *handle1 = 0, void *handle2 = 0); tBool SecTimer_Cancel (thSecTimer timer); // vFalse = cancel failed = timer is signaling or has signaled /*===========================================================================*\ \*===========================================================================*/ #ifdef SEC_TIMER_USE_MS_TIMER #include "msTimer.h" inline tBool SecTimer_Create (thSecTimer *pTimer) { return msTimer_Create (pTimer); } inline void SecTimer_Destroy (thSecTimer *pTimer) { msTimer_Destroy (pTimer); } inline tBool SecTimer_Call (thSecTimer timer, tUInt secs, tCallBackTimerFunc cbfunc, void *handle1, void *handle2) { // TODO: Ist Typ tUInt vielleicht nicht etwas zu klein?? return msTimer_Call (timer, secs * 1000, cbfunc, handle1, handle2); } inline tBool SecTimer_Cancel (thSecTimer timer) { return msTimer_Cancel (timer); } #endif /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/LinePars.h0000644000175000017500000000417210470310070020060 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _LINEPARS_H_ #define _LINEPARS_H_ #include "MultiStr.h" /*===========================================================================*\ \*===========================================================================*/ tBool ParseConfigLine (CDynamicString *StrLine, CMultiString *WordList); // return = vFalse => MemoryFull! // an item of wordlist is from type CConfigParserString /*===========================================================================*\ \*===========================================================================*/ class CConfigLineParser { public: virtual ~CConfigLineParser (void) {}; tBool ParseLine (CDynamicString *StrLine); CMultiString *GetWordList (void); private: CMultiString WordList; }; /*===========================================================================*\ inline functions \*===========================================================================*/ inline tBool CConfigLineParser::ParseLine (CDynamicString *StrLine) { return ParseConfigLine (StrLine, &WordList); } inline CMultiString *CConfigLineParser::GetWordList (void) { return &WordList; } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/SortList.cpp0000644000175000017500000001323310470310070020457 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "SortList.h" #include "dbgSTD.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ static tResult Find2HigherCmpFunc (CSortPListElement *pElement, void *RefData) { dhead ("Find2HigherCmpFunc", DCON_CPointerList); dassert (pElement != 0); switch (pElement->Compare (RefData)) { case vHigher: return vNo; case vEqual: return vYes; default: dassert (0); // no break! case vLower: break; } return vCancel; } static tResult Find2LowerCmpFunc (CSortPListElement *pElement, void *RefData) { dhead ("Find2LowerCmpFunc", DCON_CPointerList); dassert (pElement != 0); switch (pElement->Compare (RefData)) { case vLower: return vNo; case vEqual: return vYes; default: dassert (0); // no break! case vHigher: break; } return vCancel; } /*===========================================================================*\ \*===========================================================================*/ CSortPListElement *CSortPListElement::Add (CSortPListElement *pElement) { dhead ("CSortPListElement::Add", DCON_CPointerList); dassert (pElement != 0); void (CPointerListElement:: *addOne) (CPointerListElement *) = 0; CSortPListElement *(CSortPListElement:: *nextOne) (void) = 0; tCompare comp; tCompare direction = vEqual; CSortPListElement *pLauf; CSortPListElement *pLast = this; void *CompData = pElement->GetRefCompData(); switch (Compare (CompData)) { case vLower: direction = vLower; nextOne = &CSortPListElement::GetLower; addOne = &CSortPListElement::AddBefore; break; case vHigher: direction = vHigher; nextOne = &CSortPListElement::GetHigher; addOne = &CSortPListElement::AddAfter; break; case vEqual: // it isn't allowed to add two identical Elements to the List // add the new one and return the identical item, so the user can handle this Exchange (pElement); return this; } dassert (nextOne != 0); dassert (addOne != 0); dassert (direction != vEqual); pLauf = (this->*nextOne)(); // find the place where to add the new element while (pLauf != 0) { comp = pLauf->Compare (CompData); if (comp != direction) { if (comp == vEqual) { // it isn't allowed to add two identical Elements to the List // add the new one and return the identical item, so the user can handle this pLauf->Exchange (pElement); return pLauf; } break; } pLast = pLauf; pLauf = (pLauf->*nextOne)(); } (pLast->*addOne) (pElement); return 0; } /*===========================================================================*\ \*===========================================================================*/ CSortPListElement *CSortPListElement::Find (void *FindData) { dhead ("CSortPListElement::Find", DCON_CPointerList); CPointerListElement *pFound = this; switch (Compare (FindData)) { case vLower: if (FindRev ((ctFindFunc)Find2LowerCmpFunc, FindData, &pFound) != vYes) { pFound = 0; } else { dassert (pFound != 0); } break; case vHigher: if (FindFwd ((ctFindFunc)Find2HigherCmpFunc, FindData, &pFound) != vYes) { pFound = 0; } else { dassert (pFound != 0); } break; case vEqual: // nothing to do break; } RETURN ('x', (CSortPListElement *)pFound); } /*===========================================================================*\ \*===========================================================================*/ CSortPListElement *CSortPointerList::FindHigher (void *CompData) { dhead ("CSortPointerList::FindHigher", DCON_CPointerList); CPointerListElement *pFound; if (FindFwd ((ctFindFunc)Find2HigherCmpFunc, CompData, &pFound) != vYes) { pFound = 0; } return (CSortPListElement *)pFound; } /*===========================================================================*\ \*===========================================================================*/ CSortPListElement *CSortPointerList::FindLower (void *CompData) { dhead ("CSortPointerList::FindLower", DCON_CPointerList); CPointerListElement *pFound; if (FindRev ((ctFindFunc)Find2LowerCmpFunc, CompData, &pFound) != vYes) { pFound = 0; } return (CSortPListElement *)pFound; } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/standard/aStdLib.h0000644000175000017500000001070310470310070017662 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _ASTDLIB_H_ #define _ASTDLIB_H_ #include "aTypes.h" /*===========================================================================*\ \*===========================================================================*/ tUInt a_max (tUInt a, tUInt b); tUInt a_min (tUInt a, tUInt b); /*===========================================================================*\ \*===========================================================================*/ tSign a_getsign (tSInt32 value); tSign a_getsign (tSInt64 value); tCompare a_compare (tUInt32 value1, tUInt32 value2); tCompare a_compare (tUInt64 value1, tUInt64 value2); tUByte a_count1bits (tUInt32 value); tUByte a_count1bits (tUInt64 value); /*===========================================================================*\ \*===========================================================================*/ tSInt a_atol (char *string); tSInt a_strtoln (const char *nptr, char **endptr, tSize maxlength, tSInt base); tSInt a_strtoln (tChar *nptr, tChar **endptr, tSize maxlength, tSInt base); tSInt a_strtoln (tWiChar *nptr, tWiChar **endptr, tSize maxlength, tSInt base); tSInt a_strtol (const char *nptr, char **endptr, tSInt base); tSInt a_strtol (tChar *nptr, tChar **endptr, tSInt base); tSInt a_strtol (tWiChar *nptr, tWiChar **endptr, tSInt base); tUInt a_ltoan (tSInt value, char *string, tSize maxlen, tSInt radix); char *a_strupr (char *string); /*===========================================================================*\ \*===========================================================================*/ tUInt a_pointer2string (void *pointer, char *string); tUInt a_pointer2string (void *pointer, tChar *string); tUInt a_pointer2string (void *pointer, tWiChar *string); /*===========================================================================*\ \*===========================================================================*/ tBool a_hex2bin (class CConstString *pHexString, class CDataPacket *pBinPacket); // vFalse => pBinPacket to small and Resize failed /*===========================================================================*\ inline functions \*===========================================================================*/ inline tUInt a_max (tUInt a, tUInt b) { return (a > b) ? a : b; } inline tUInt a_min (tUInt a, tUInt b) { return (a < b) ? a : b; } inline tSign a_getsign (tSInt32 value) { return (!value) ? vZero : (value > 0) ? vPlus : vMinus; } inline tSign a_getsign (tSInt64 value) { return (!value) ? vZero : (value > 0) ? vPlus : vMinus; } inline tCompare a_compare (tUInt32 value1, tUInt32 value2) { return (value1 == value2) ? vEqual : (value1 > value2) ? vHigher : vLower; } inline tCompare a_compare (tUInt64 value1, tUInt64 value2) { return (value1 == value2) ? vEqual : (value1 > value2) ? vHigher : vLower; } inline tSInt a_strtoln (const char *nptr, char **endptr, tSize maxlength, tSInt base) { return a_strtoln ((tChar *)nptr, (tChar **)endptr, maxlength, base); } inline tSInt a_strtol (const char *nptr, char **endptr, tSInt base) { return a_strtoln (nptr, endptr, MAXVAL_tUInt, base); } inline tSInt a_strtol (tChar *nptr, tChar **endptr, tSInt base) { return a_strtoln (nptr, endptr, MAXVAL_tUInt, base); } inline tSInt a_strtol (tWiChar *nptr, tWiChar **endptr, tSInt base) { return a_strtoln (nptr, endptr, MAXVAL_tUInt, base); } inline tUInt a_pointer2string (void *pointer, char *string) { return a_pointer2string (pointer, (tChar *)string); } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/standard/Makefile.am0000644000175000017500000000524310470310070020226 0ustar mastermaster## Process this file with automake to produce Makefile.in AUTOMAKE_OPTIONS = foreign CLEANFILES = *~ comperr MAINTAINERCLEANFILES = Makefile.in noinst_HEADERS = aFlags.h \ aStdLib.h \ aStrPrt.h \ aTypes.h \ aString.h \ ByteQueu.h \ CBTimer.h \ CDbgIDS.h \ CEvent.h \ ConfAssi.h \ ConfPars.h \ CString.h \ DataList.h \ DataPack.h \ DataPool.h \ DatBlock.h \ DbgFile.h \ DbgInfo.h \ dbgSTD.h \ DynArray.h \ DynByteQ.h \ DynQueue.h \ DynStore.h \ Eventing.h \ ExtFuncs.h \ FilePars.h \ InfoType.h \ LinePars.h \ MultiStr.h \ osmem.h \ PathName.h \ Protect.h \ ProtClas.h \ PtrList.h \ SecTimer.h \ SemaFunc.h \ SortList.h \ StdArray.h \ StdQueue.h noinst_LIBRARIES = libstandard.a libstandard_a_SOURCES = aStdLib.cpp \ aString.cpp \ aStrPrt.cpp \ ByteQueu.cpp \ CBTimer.cpp \ CDbgIDS.cpp \ ConfAssi.cpp \ ConfPars.cpp \ CString.cpp \ DbgFile.cpp \ DbgInfo.cpp \ DynArray.cpp \ DynByteQ.cpp \ DynQueue.cpp \ DynStore.cpp \ FilePars.cpp \ LinePars.cpp \ PtrList.cpp \ SortList.cpp \ StdArray.cpp \ StdQueue.cpp capi4hylafax-svn/src/scripts/0000755000175000017500000000000010470310071016056 5ustar mastermastercapi4hylafax-svn/src/scripts/depcomp0000755000175000017500000003710010470310071017434 0ustar mastermaster#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2005-07-09.11 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mecanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: capi4hylafax-svn/src/scripts/missing0000755000175000017500000002540610470310071017464 0ustar mastermaster#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2005-06-08.21 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case "$1" in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: capi4hylafax-svn/src/scripts/config.guess0000755000175000017500000012744010470310071020406 0ustar mastermaster#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-05-27' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown if [ "${UNAME_SYSTEM}" = "Linux" ] ; then eval $set_cc_for_build cat << EOF > $dummy.c #include #ifdef __UCLIBC__ # ifdef __UCLIBC_CONFIG_VERSION__ LIBC=uclibc __UCLIBC_CONFIG_VERSION__ # else LIBC=uclibc # endif #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'` fi # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; amd64:OpenBSD:*:*) echo x86_64-unknown-openbsd${UNAME_RELEASE} exit ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit ;; cats:OpenBSD:*:*) echo arm-unknown-openbsd${UNAME_RELEASE} exit ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit ;; luna88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit ;; sgi:OpenBSD:*:*) echo mips64-unknown-openbsd${UNAME_RELEASE} exit ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then # avoid double evaluation of $set_cc_for_build test -n "$CC_FOR_BUILD" || eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo cris-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo frv-unknown-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-${LIBC}coff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld" exit ;; esac if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in *86) UNAME_PROCESSOR=i686 ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: capi4hylafax-svn/src/scripts/config.sub0000755000175000017500000007632310470310071020054 0ustar mastermaster#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-06-02' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx | dvp \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64r5900 | mips64r5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | ms1 \ | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m32c) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64r5900-* | mips64r5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | ms1-* \ | msp430-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; m32c-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mipsEE* | ee | ps2) basic_machine=mips64r5900el-scei case $os in -linux*) ;; *) os=-elf ;; esac ;; iop) basic_machine=mipsel-scei os=-irx ;; dvp) basic_machine=dvp-scei os=-elf ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* | -skyos* \ | -irx* ) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: capi4hylafax-svn/src/scripts/ltmain.sh0000644000175000017500000056236010470310071017712 0ustar mastermaster# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. basename="s,^.*/,,g" # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # define SED for historic ltconfig's generated by Libtool 1.3 test -z "$SED" && SED=sed # The name of this program: progname=`echo "$progpath" | $SED $basename` modename="$progname" # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool VERSION=1.5.18 TIMESTAMP=" (1.1220.2.246 2005/05/16 10:00:18)" # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Same for EGREP, and just to be sure, do LTCC as well if test "X$EGREP" = X ; then EGREP=egrep fi if test "X$LTCC" = X ; then LTCC=${CC-gcc} fi # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" quote_scanset='[[~#^*{};<>?'"'"' ]' if test -z "$max_cmd_len"; then i=0 testring="ABCD" new_result= # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while (test "X"`$SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \ = "XX$testring") >/dev/null 2>&1 && new_result=`expr "X$testring" : ".*" 2>&1` && max_cmd_len="$new_result" && test "$i" != 17 # 1/2 MB should be enough do i=`expr $i + 1` testring="$testring$testring" done testring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. max_cmd_len=`expr $max_cmd_len \/ 2` fi ##################################### # Shell function definitions: # This seems to be the best place for them # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` if test "X$win32_nmres" = "Ximport" ; then win32_libid_type="x86 archive import" else win32_libid_type="x86 archive static" fi fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $echo $win32_libid_type } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do case $arg in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. case $arg in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done # user sometimes does CC=-gcc so we need to match that to 'gcc' trimedcc=`echo ${CC} | $SED -e "s/${host}-//g"` # and sometimes libtool has CC=-gcc but user does CC=gcc extendcc=${host}-${CC} case "$@ " in "cc "* | " cc "* | "${host}-cc "* | " ${host}-cc "*|\ "gcc "* | " gcc "* | "${host}-gcc "* | " ${host}-gcc "*) tagname=CC break ;; "$trimedcc "* | " $trimedcc "* | "`$echo $trimedcc` "* | " `$echo $trimedcc` "*|\ "$extendcc "* | " $extendcc "* | "`$echo $extendcc` "* | " `$echo $extendcc` "*|\ " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit $EXIT_FAILURE # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 exit $EXIT_FAILURE fi } # func_extract_archives gentop oldlib ... func_extract_archives () { my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" my_status="" $show "${rm}r $my_gentop" $run ${rm}r "$my_gentop" $show "$mkdir $my_gentop" $run $mkdir "$my_gentop" my_status=$? if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then exit $my_status fi for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` my_xdir="$my_gentop/$my_xlib" $show "${rm}r $my_xdir" $run ${rm}r "$my_xdir" $show "$mkdir $my_xdir" $run $mkdir "$my_xdir" status=$? if test "$status" -ne 0 && test ! -d "$my_xdir"; then exit $status fi case $host in *-darwin*) $show "Extracting $my_xabs" # Do not bother doing anything if just a dry run if test -z "$run"; then darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` if test -n "$darwin_arches"; then darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= $show "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we have a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` lipo -create -output "$darwin_file" $darwin_files done # $darwin_filelist ${rm}r unfat-$$ cd "$darwin_orig_dir" else cd "$darwin_orig_dir" func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches fi # $run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # End of Shell function definitions ##################################### # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Parse our command line options once, thoroughly. while test "$#" -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit $EXIT_FAILURE ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" $echo $echo "Copyright (C) 2005 Free Software Foundation, Inc." $echo "This is free software; see the source for copying conditions. There is NO" $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit $? ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # Now print the configurations for the tags. for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done exit $? ;; --debug) $echo "$progname: enabling shell trace mode" set -x preserve_args="$preserve_args $arg" ;; --dry-run | -n) run=: ;; --features) $echo "host: $host" if test "$build_libtool_libs" = yes; then $echo "enable shared libraries" else $echo "disable shared libraries" fi if test "$build_old_libs" = yes; then $echo "enable static libraries" else $echo "disable static libraries" fi exit $? ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag preserve_args="$preserve_args --tag" ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= for arg do case "$arg_mode" in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit $EXIT_FAILURE fi arg_mode=target continue ;; -static | -prefer-pic | -prefer-non-pic) later="$later $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$base_compile $lastarg" continue ;; * ) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, and some SunOS ksh mistreat backslash-escaping # in scan sets (worked around with variable expansion), # and furthermore cannot handle '|' '&' '(' ')' in scan sets # at all, so we specify them separately. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit $EXIT_FAILURE ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit $EXIT_FAILURE ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; *.java) xform=java ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit $EXIT_FAILURE ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` case $qlibobj in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") qlibobj="\"$qlibobj\"" ;; esac if test "X$libobj" != "X$qlibobj"; then $echo "$modename: libobj name \`$libobj' may not contain shell special characters." exit $EXIT_FAILURE fi objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir= else xdir=$xdir/ fi lobj=${xdir}$objdir/$objname if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi $run $rm $removelist trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$srcfile" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi $echo "$srcfile" > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` case $qsrcfile in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") qsrcfile="\"$qsrcfile\"" ;; esac $run $rm "$libobj" "${libobj}T" # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the PIC object to the libtool object file. test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi fi build_libtool_libs=no build_old_libs=yes prefer_static_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift case $arg in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit $EXIT_FAILURE fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat $save_arg` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi done else $echo "$modename: link input file \`$save_arg' does not exist" exit $EXIT_FAILURE fi arg=$save_arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; shrext) shrext_cmds="$arg" prev= continue ;; darwin_framework) compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" prev= continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit $EXIT_FAILURE fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=darwin_framework compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 exit $EXIT_FAILURE fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-mingw* | *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. -model) compile_command="$compile_command $arg" compiler_flags="$compiler_flags $arg" finalize_command="$finalize_command $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -module) module=yes continue ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m* pass through architecture-specific compiler args for GCC -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") arg="\"$arg\"" ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" if test "$with_gcc" = "yes" ; then compiler_flags="$compiler_flags $arg" fi continue ;; -shrext) prev=shrext continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; -Kthread | -mthreads | -mt | -pthread | -pthreads | -threads | -qthreaded | -kthread ) compiler_flags="$compiler_flags $arg" continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? if test "$status" -ne 0 && test ! -d "$output_objdir"; then exit $status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit $EXIT_FAILURE ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` if eval $echo \"$deplib\" 2>/dev/null \ | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $echo $echo "*** Warning: Trying to link with static lib archive $deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because the file extensions .$libext of this argument makes me believe" $echo "*** that it is just a static archive that I should not used here." else $echo $echo "*** Warning: Linking the shared library $output against the" $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit $EXIT_FAILURE fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $dir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on # some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`$echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5* ) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo $echo "** And there doesn't seem to be a static archive available" $echo "** The link will probably fail, sorry" else add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit $EXIT_FAILURE fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $echo $echo "*** Warning: This system can not link to static lib archive $lib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $echo "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else convenience="$convenience $dir/$old_library" old_convenience="$old_convenience $dir/$old_library" deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, # but need to link against shared eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$path/$depdepl" ; then depdepl="$path/$depdepl" fi # do not add paths which are already there case " $newlib_search_path " in *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac fi path="" ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$depdepl $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit $EXIT_FAILURE else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor - 1` age="$number_minor" revision="$number_minor" ;; esac ;; no) current="$2" revision="$3" age="$4" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) major=`expr $current - $age + 1` case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" ;; osf) major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done if test -n "$removelist"; then $show "${rm}r $removelist" $run ${rm}r $removelist fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. for path in $notinst_path; do lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done # It is ok to link against an archive when # building a shared library. if $AR -t $potlib > /dev/null 2>&1; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval $echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | grep . >/dev/null; then $echo if test "X$deplibs_check_method" = "Xnone"; then $echo "*** Warning: inter-library dependencies are not supported in this platform." else $echo "*** Warning: inter-library dependencies are not known to be supported." fi $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $echo $echo "*** Warning: libtool could not satisfy all declared inter-library" $echo "*** dependencies of module $libname. Therefore, libtool will create" $echo "*** a static module, that should work as long as the dlopening" $echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $echo "*** The inter-library dependencies that have been dropped here will be" $echo "*** automatically added whenever a program is linked with this library" $echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $echo $echo "*** Since this library must not contain undefined symbols," $echo "*** because either the platform does not support them or" $echo "*** it was explicitly requested with -no-undefined," $echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "using reloadable object file for export list..." skipped_export=: fi done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise. $echo "creating reloadable object files..." # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$echo "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= delfiles= last_robj= k=1 output=$output_objdir/$output_la-${k}.$objext # Loop over the list of objects to be linked. for obj in $save_libobjs do eval test_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || { len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext k=`expr $k + 1` output=$output_objdir/$output_la-${k}.$objext objlist=$obj len=1 fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadable object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit $EXIT_FAILURE fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $run eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; esac compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' else $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ " case $host in *cygwin* | *mingw* ) $echo >> "$output_objdir/$dlsyms" "\ /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs */ struct { " ;; * ) $echo >> "$output_objdir/$dlsyms" "\ const struct { " ;; esac $echo >> "$output_objdir/$dlsyms" "\ const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit $EXIT_FAILURE ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) cwrappersource=`$echo ${objdir}/lt-${outputname}.c` cwrapper=`$echo ${output}.exe` $rm $cwrappersource $cwrapper trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cat > $cwrappersource <> $cwrappersource<<"EOF" #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef DIR_SEPARATOR #define DIR_SEPARATOR '/' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) #define HAVE_DOS_BASED_FILE_SYSTEM #ifndef DIR_SEPARATOR_2 #define DIR_SEPARATOR_2 '\\' #endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); char * basename (const char *name); char * fnqualify(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup ((char *) basename (argv[0])); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" newargz[1] = fnqualify(argv[0]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } char * basename (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha (name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return (char *) base; } char * fnqualify(const char *path) { size_t size; char *p; char tmp[LT_PATHMAX + 1]; assert(path != NULL); /* Is it qualified already? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha (path[0]) && path[1] == ':') return xstrdup (path); #endif if (IS_DIR_SEPARATOR (path[0])) return xstrdup (path); /* prepend the current directory */ /* doesn't handle '~' */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ p = XMALLOC(char, size); sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); return p; } char * strendzap(char *str, const char *pat) { size_t len, patlen; assert(str != NULL); assert(pat != NULL); len = strlen(str); patlen = strlen(pat); if (patlen <= len) { str += len - patlen; if (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" $echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit $EXIT_FAILURE fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \$progdir/\$program \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit $EXIT_FAILURE fi else # The program doesn't exist. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit $EXIT_FAILURE fi fi\ " chmod +x $output fi exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "copying selected object files to avoid basename conflicts..." if test -z "$gentop"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi fi save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase counter=`expr $counter + 1` case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" $run ln "$obj" "$gentop/$newobj" || $run cp "$obj" "$gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi if test "X$EGREP" = X ; then EGREP=egrep fi # We do not want portage's install root ($D) present. Check only for # this if the .la is being installed. if test "$installed" = yes && test "$D"; then eval mynewdependency_lib=`echo "$libdir/$name" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` else mynewdependency_lib="$libdir/$name" fi # Do not add duplicates if test "$mynewdependency_lib"; then my_little_ninja_foo_1=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"` if test -z "$my_little_ninja_foo_1"; then newdependency_libs="$newdependency_libs $mynewdependency_lib" fi fi ;; *) if test "$installed" = yes; then # Rather use S=WORKDIR if our version of portage supports it. # This is because some ebuild (gcc) do not use $S as buildroot. if test "$PWORKDIR"; then S="$PWORKDIR" fi # We do not want portage's build root ($S) present. my_little_ninja_foo_2=`echo $deplib |$EGREP -e "$S"` if test -n "$my_little_ninja_foo_2" && test "$S"; then mynewdependency_lib="" # We do not want portage's install root ($D) present. my_little_ninja_foo_3=`echo $deplib |$EGREP -e "$D"` elif test -n "$my_little_ninja_foo_3" && test "$D"; then eval mynewdependency_lib=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` else mynewdependency_lib="$deplib" fi else mynewdependency_lib="$deplib" fi # Do not add duplicates if test "$mynewdependency_lib"; then my_little_ninja_foo_4=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"` if test -z "$my_little_ninja_foo_4"; then newdependency_libs="$newdependency_libs $mynewdependency_lib" fi fi ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac # Do not add duplicates if test "$installed" = yes && test "$D"; then install_libdir=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` fi $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit $EXIT_SUCCESS ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg="$nonopt" fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest="$arg" continue fi case $arg in -d) isdir=yes ;; -f) prev="-f" ;; -g) prev="-g" ;; -m) prev="-m" ;; -o) prev="-o" ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest="$arg" continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Strip any trailing slash from the destination. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit $EXIT_FAILURE fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit $EXIT_FAILURE fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # To insure that "foo" is sourced, and not "foo.exe", # finese the cygwin/MSYS system by explicitly sourcing "foo." # which disallows the automatic-append-.exe behavior. case $build in *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; *) wrapperdot=${wrapper} ;; esac # If there is no directory component, then add one. case $file in */* | *\\*) . ${wrapperdot} ;; *) . ./${wrapperdot} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit $EXIT_FAILURE fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # To insure that "foo" is sourced, and not "foo.exe", # finese the cygwin/MSYS system by explicitly sourcing "foo." # which disallows the automatic-append-.exe behavior. case $build in *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; *) wrapperdot=${wrapper} ;; esac # If there is no directory component, then add one. case $file in */* | *\\*) . ${wrapperdot} ;; *) . ./${wrapperdot} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir="/tmp" test -n "$TMPDIR" && tmpdir="$TMPDIR" tmpdir="$tmpdir/libtool-$$" save_umask=`umask` umask 0077 if $mkdir "$tmpdir"; then umask $save_umask else umask $save_umask $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyways case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS $echo "----------------------------------------------------------------------" $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" done $echo $echo "If you ever happen to want to link against installed libraries" $echo "in a given directory, LIBDIR, you must either use libtool, and" $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" $echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" $echo " during execution" fi if test -n "$runpath_var"; then $echo " - add LIBDIR to the \`$runpath_var' environment variable" $echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "----------------------------------------------------------------------" exit $EXIT_SUCCESS ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit $EXIT_FAILURE fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit $EXIT_FAILURE fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit $EXIT_SUCCESS fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" if test "$mode" = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. fi fi ;; *.lo) # Possibly a libtool object, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" \ && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit $EXIT_FAILURE fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE. Report bugs to ." exit $EXIT_SUCCESS ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit $? # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: capi4hylafax-svn/src/scripts/install-sh0000755000175000017500000002202110470310071020057 0ustar mastermaster#!/bin/sh # install - install a program, script, or datafile scriptversion=2005-05-14.22 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit $?;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit $?;; *) # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. test -n "$dir_arg$dstarg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then mkdircmd=: chmodcmd= else mkdircmd=$mkdirprog fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` shift IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test -d "$pathcomp" || exit fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $mkdircmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. $doit $cpprog "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit 1; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit 0 } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: capi4hylafax-svn/src/faxsend/0000755000175000017500000000000010470310071016017 5ustar mastermastercapi4hylafax-svn/src/faxsend/sendmain.cpp0000644000175000017500000004523710470310071020334 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include #include #include #include #include #include #include "faxsend.h" #include "ConfAssi.h" #include "FilePars.h" #include "DynQueue.h" #include "aString.h" #include "PrctlDmp.h" #include "DbgFile.h" #include "osImport.h" #include "misc.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ static sem_t syncsema; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ static void FinishFunc (void) { sem_post (&syncsema); } /*===========================================================================*\ \*===========================================================================*/ static void WriteQFile (tChar *QFileName, tUInt commID, tUInt HylafaxExitState, CFaxSend *fs, char **statustext) { dhead ("WriteQFile", DCON_CFaxSend); dassert (QFileName != 0); CDynamicQueue textQ (60, sizeof (char *)); char text[4 * MAX_STRING_SIZE]; char *ne; tSInt triescount; tUInt dialortry = 1; *statustext = ""; FILE *qf = fopen ((char *)QFileName, "r+"); if (!qf) { return; } switch (fs->exitState) { case 255: *statustext = "Sending job"; dialortry = 0; break; case 0: dialortry = 2; break; case 1: *statustext = "Can't open fax file."; break; case 2: *statustext = "CAPI not installed or active."; break; case 3: *statustext = "Error in communication to CAPI."; break; case 4: *statustext = "The telephone number is busy or temporary not available."; break; case 5: *statustext = "Protocol error layer 1: Mostly your ISDN cable is not inserted."; break; case 6: *statustext = "Can't build up B-Channel."; break; case 7: dialortry = 2; *statustext = "Connection build up, but data transfer wasn't possible."; break; case 8: *statustext = "Fax polling property could not be negotiated."; break; case 9: *statustext = "PollRcvd script could not be started. Fax was completely received."; break; case 10: *statustext = "An error occured while trying to establish the connection."; break; case 11: *statustext = "Can't initialize conversion filters."; break; case 12: dialortry = 2; *statustext = "An error occured during the fax transfer."; break; case 13: *statustext = "Wrong command line or help parameter was specified."; break; default: case 15: *statustext = "Very hard error."; break; } // we asume that we can always get a whole line with fgets while (!feof (qf) && fgets (text, sizeof (text), qf)) { if (!*text) { continue; } ne = strchr (text, ':'); if (!ne || (ne == text)) { continue; } *ne = '\0'; if (strcasecmp ("returned", text) == 0) { dprint ("found returned "); sprintf (ne + 1, "%u\n", HylafaxExitState); } else if (strcasecmp ("status", text) == 0) { dprint ("found status "); sprintf (ne + 1, "%s\n", *statustext); } else if (commID && (strcasecmp ("commid", text) == 0)) { dprint ("found commid "); sprintf (ne + 1, "%09u\n", commID); } else if (strcasecmp ("npages", text) == 0) { dprint ("found npages "); sprintf (ne + 1, "%u\n", fs->GetPageCount()); } else if ((dialortry == 1) && ((strcasecmp ("ndials", text) == 0) || (strcasecmp ("totdials", text) == 0))) { dprint ("found _dials "); triescount = atol (ne + 1) + 1; if (triescount <= 0) { dprintErr ("negative Value "); triescount = 1; } sprintf (ne + 1, "%u\n", triescount); } else if ((dialortry == 2) && ((strcasecmp ("ntries", text) == 0) || (strcasecmp ("tottries", text) == 0))) { dprint ("found _tries "); triescount = atol (ne + 1) + 1; if (triescount <= 0) { dprintErr ("negative Value "); triescount = 1; } sprintf (ne + 1, "%u\n", triescount); } else if (strcasecmp ("signalrate", text) == 0) { dprint ("found signalrate "); sprintf (ne + 1, "%d\n", fs->GetBaudRate()); } else if (strcasecmp ("dataformat", text) == 0) { dprint ("found dataformat "); sprintf (ne + 1, "1-D MR\n"); // SFF includes 1-D MR (Huffman) data } *ne = ':'; ne = new char[strlen (text) + 1]; if (ne) { strcpy (ne, text); if (textQ.Put (&ne) == vFalse) { delete [] ne; } } } fseek (qf, 0, SEEK_SET); ftruncate (fileno (qf), 0); while (textQ.Get (&ne) == vTrue) { dassert (ne != 0); fprintf (qf, ne); delete [] ne; } fclose (qf); } /*===========================================================================*\ \*===========================================================================*/ static void OneSendSession (CFaxSend *pFS, tUInt Resolution, tUInt JobID, tUInt *pCommID, CDynamicString *pTelNumber, CDynamicString *pPollStr, CMultiString *pFileList) { dhead ("OneSendSession", DCON_CFaxSend); dassert (pFS != 0); dassert (pTelNumber != 0); dassert (pPollStr != 0); dassert (pFileList != 0); if ((pFileList->IsEmpty() == vTrue) && (pPollStr->IsEmpty() == vTrue)) { pFS->WriteLog (LOG_ERR, "No file to send specified! Forgot the format option (-f)?\n\n"); pFS->exitState = 13; return; } if (pTelNumber->IsEmpty() == vFalse) { pTelNumber->SetLen (s_strkeep (pTelNumber->GetPointer(), (tChar *)"+0123456789*#RrMm")); } if (pTelNumber->IsEmpty() == vTrue) { pFS->WriteLog (LOG_ERR, "No telephone number specified!\n\n"); pFS->exitState = 13; return; } if (pFS->Send (pTelNumber, pFileList, Resolution, JobID, pCommID, pPollStr) == i_Okay) { while (sem_wait (&syncsema)) { if (errno != EINTR) { break; } } } dprint ("fs.exitState=%x ", pFS->exitState); pFS->CloseJobFile(); } /*===========================================================================*\ \*===========================================================================*/ static void OneQFileSend (CFaxSend *pFS, char *deviceName, CDynamicString *pQFile) { dhead ("OneQFileSend", DCON_CFaxSend); dassert (pFS != 0); dassert (deviceName != 0); dassert (pQFile != 0); dparams ("%s", pQFile->GetPointer()); CMultiString FaxFileList; CDynamicString TelNumber; CDynamicString JobTag; CDynamicString MailAddr; CDynamicString PollStr; CDynamicString TagLineFormat; tUInt Resolution = 0; tUInt JobID = 0; tUInt commID = 0; tUInt HylaExitState = 1; char *statustext; CConfigFileParser FileParser; switch (FileParser.ParseFile (pQFile->GetPointer())) { case iErr_File_OpenFailed: pFS->WriteLog (LOG_ERR, "Can't open qfile \"%s\".\n", (char *)pQFile->GetPointer()); pFS->exitState = 3; return; case i_Okay: break; case iErr_OutOfMemory: dassert (0); pFS->WriteLog (LOG_ERR, "Running out of memory during reading of qfile!\n"); pFS->exitState = 3; return; default: dassert (0); pFS->WriteLog (LOG_ERR, "Can't read qfile \"%s\"!\n", (char *)pQFile->GetPointer()); pFS->exitState = 3; return; } CConfigParserSection *mainSect = FileParser.GetMainSection(); if (!mainSect) { pFS->WriteLog (LOG_ERR, "Can't find needed information in qfile \"%s\".\n", (char *)pQFile->GetPointer()); pFS->exitState = 3; return; } ConfigAssignment_Item Assignments[] = { { "number", ConfigAssignment_String, &TelNumber }, { "fax", ConfigAssignment_StringList, &FaxFileList }, { "resolution", ConfigAssignment_UInt, &Resolution }, { "jobid", ConfigAssignment_UInt, &JobID }, { "jobtag", ConfigAssignment_String, &JobTag }, { "mailaddr", ConfigAssignment_String, &MailAddr }, { "poll", ConfigAssignment_String, &PollStr }, { "tagline", ConfigAssignment_String, &TagLineFormat }, { 0, ConfigAssignment_UInt, 0 } }; ConfigValuesAssignment (&mainSect->ValueList, &Assignments[0]); // for polling we need the mailaddr if (PollStr.IsEmpty() == vFalse) { PollStr.Set (&MailAddr); if (PollStr.IsEmpty() == vTrue) { PollStr.Set (" ", 1); } } // remove numbers from fax list COneMultiString *pLauf = FaxFileList.GetFirst(); while (pLauf != 0) { dassert (pLauf->GetLen() > 0); switch (pLauf->GetChar (0)) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { COneMultiString *toDel = pLauf; pLauf = pLauf->GetNext(); delete toDel; } break; default: pLauf = pLauf->GetNext(); break; } } // Write "Sending job" into queue file pFS->exitState = 255; WriteQFile (pQFile->GetPointer(), commID, 0, pFS, &statustext); pFS->exitState = 0; pFS->SetTagLine (&TagLineFormat); OneSendSession (pFS, Resolution, JobID, &commID, &TelNumber, &PollStr, &FaxFileList); dprint ("fs.exitState=%x ", pFS->exitState); switch (pFS->exitState) { case 2: case 4: case 5: case 6: case 7: case 10: case 12: // retry HylaExitState = 0; break; case 15: default: // error HylaExitState = 1; break; case 0: // okay HylaExitState = 2; break; case 1: case 3: case 11: // reformat HylaExitState = 3; break; } WriteQFile (pQFile->GetPointer(), commID, HylaExitState, pFS, &statustext); pFS->exitState = HylaExitState; pFS->WriteXferLog (PollStr.IsEmpty() ? "SEND" : "POLL", commID, JobTag.GetPointer(), &JobID, deviceName, &MailAddr, &TelNumber, statustext); dprint ("fs.exitState=%x ", pFS->exitState); pFS->WriteLog (LOG_INFO, "SESSION END\n"); pFS->CloseJobFile(); } /*===========================================================================*\ \*===========================================================================*/ static void usage (char *prgName) { char *name = strrchr (prgName, '/'); if (!name) { name = prgName; } else { name++; } printf ("usage: %s [-f format] [-C cfile] [-c param] [-m dev]\n\t\t " "[-d number] [-P mailadr] [-v] [-V] [file(s)]\n", name); printf ("\t-f Specify the output format. Allowed types are:\n"); printf ("\t HYLAFAX (default), TIFF, SFF, G3\n"); printf ("\t-C Name and path of the config file\n"); printf ("\t-c One Entry from the config-file of type: {value}:{data}\n"); printf ("\t-m Virtual device name only needed for Hylafax. Default: %s\n", DEFAULT_DEVICE_NAME); printf ("\t-P Fax Polling. At the end pollrcvd with \"mailadr\" is called\n"); printf ("\t-L Activate Logging (Filename have to be specified in the config file).\n"); printf ("\t-v Start in verbose mode\n"); printf ("\t-V Show version information\n"); printf ("\tfile(s): Depending on the format(-f) switch.\n"); printf ("\t HYLAFAX: one or more qfile(s)\n"); printf ("\t SFF: one sff file\n"); printf ("\t TIFF: one or more tiff file(s)\n"); } /*===========================================================================*\ \*===========================================================================*/ int main (int argc, char **argv) { DebugFileOpen(); dhead ("CFaxSend-main", DCON_CFaxSend); CFaxSend fs (FinishFunc); if (argc < 2) { usage (argv[0]); return 13; } InitPrctlDumpable(); CDynamicString TelNumber; CMultiString FaxFileList; CDynamicString PollStr; FaxFormatType format = FaxFormat_Hylafax; tUInt Resolution = 0; char *deviceName = DEFAULT_DEVICE_NAME; char *configName = 0; int ch; // find device name while ((ch = getopt (argc, argv, "Hh?VvLlpnf:C:c:d:m:P:")) != -1) { switch (ch) { default: usage (argv[0]); return 13; case 'V': printf ("c2faxsend Version: %s (c) AVM GmbH\n", VERSION); return 13; case 'L': case 'l': case 'p': case 'v': case 'c': break; case 'n': Resolution = 98; break; case 'C': if (optarg && *optarg) { configName = optarg; } break; case 'd': if (optarg && *optarg) { TelNumber.Set (optarg); } break; case 'm': if (optarg && *optarg) { deviceName = optarg; } break; case 'P': if (optarg && *optarg) { dprint ("PollStr=%s ", optarg); PollStr.Set (optarg); } break; case 'f': if (!optarg || !*optarg) { break; } if (strcasecmp (optarg, FORMAT_STRING_HYLAFAX) == 0) { format = FaxFormat_Hylafax; } else if (strcasecmp (optarg, FORMAT_STRING_SFF) == 0) { format = FaxFormat_SFF; } else if (strcasecmp (optarg, FORMAT_STRING_TIFF) == 0) { format = FaxFormat_TIFF; } else if (strcasecmp (optarg, FORMAT_STRING_G3) == 0) { format = FaxFormat_G3; } else { printf ("Wrong format param %s!\n\n", optarg); return 13; } break; } } if (!configName) { configName = DEFAULT_CONFIG_FILE; } if ((optind >= argc) && (PollStr.IsEmpty() == vTrue)) { printf ("No fax file specified!\n"); return 1; } if (fs.Config ((tChar *)configName, deviceName, format, argc, argv) == vFalse) { printf ("Initialisation error!\n"); return 1; } sem_init (&syncsema, 0, 0); switch (format) { case FaxFormat_Hylafax: { COneMultiString *pNewStr; char *kommachar; char *tmpqfname; tUInt len; for (; optind < argc; optind++) { tmpqfname = argv[optind]; while (tmpqfname) { kommachar = strchr (tmpqfname, ','); if (kommachar) { len = kommachar - tmpqfname; kommachar++; } else { len = s_strlen (tmpqfname); } if (len) { pNewStr = new COneMultiString; if (pNewStr) { if (pNewStr->Set (tmpqfname, len) == vTrue) { dprint ("Fax-File=%s ", pNewStr->GetPointer()); FaxFileList.AddLast (pNewStr); } else { delete pNewStr; } } } tmpqfname = kommachar; } } pNewStr = FaxFileList.GetFirst(); while (pNewStr && ((fs.exitState == 0) || (fs.exitState == 2))) { OneQFileSend (&fs, deviceName, pNewStr); pNewStr = pNewStr->GetNext(); } } break; case FaxFormat_SFF: { COneMultiString *pNewStr = new COneMultiString; if (pNewStr) { dprint ("Fax-File=%s ", argv[optind]); if (pNewStr->Set (argv[optind]) == vTrue) { FaxFileList.AddLast (pNewStr); } else { delete pNewStr; } } OneSendSession (&fs, Resolution, 0, 0, &TelNumber, &PollStr, &FaxFileList); } break; case FaxFormat_TIFF: case FaxFormat_G3: { COneMultiString *pNewStr; for (; optind < argc; optind++) { pNewStr = new COneMultiString; if (pNewStr) { dprint ("Fax-File=%s ", argv[optind]); if (pNewStr->Set (argv[optind]) == vTrue) { FaxFileList.AddLast (pNewStr); } else { delete pNewStr; } } } OneSendSession (&fs, Resolution, 0, 0, &TelNumber, &PollStr, &FaxFileList); } break; } sem_destroy (&syncsema); DebugFileClose(); if (fs.exitState == 13) { usage (argv[0]); } return fs.exitState; } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/faxsend/Makefile.in0000644000175000017500000003522510470310071020073 0ustar mastermaster# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = c2faxsend$(EXEEXT) subdir = src/faxsend DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_c2faxsend_OBJECTS = faxsend.$(OBJEXT) sendmain.$(OBJEXT) c2faxsend_OBJECTS = $(am_c2faxsend_OBJECTS) c2faxsend_LDADD = $(LDADD) c2faxsend_DEPENDENCIES = ../capi/libcapi.a ../convert/libconvert.a \ ../linuxdep/liblinuxdep.a ../standard/libstandard.a DEFAULT_INCLUDES = -I. -I$(srcdir) depcomp = $(SHELL) $(top_srcdir)/src/scripts/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(c2faxsend_SOURCES) DIST_SOURCES = $(c2faxsend_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) INSTALL = @INSTALL@ ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ hylafaxbindir = @hylafaxbindir@ hylafaxspooldir = @hylafaxspooldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign CLEANFILES = *~ comperr MAINTAINERCLEANFILES = Makefile.in INCLUDES = -I.. -I$(srcdir)/.. -I$(srcdir)/../standard \ -I$(srcdir)/../capi -I$(srcdir)/../convert \ -I$(srcdir)/../linuxdep LDADD = ../capi/libcapi.a ../convert/libconvert.a ../linuxdep/liblinuxdep.a \ ../standard/libstandard.a noinst_HEADERS = faxsend.h c2faxsend_SOURCES = faxsend.cpp sendmain.cpp all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/faxsend/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/faxsend/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done c2faxsend$(EXEEXT): $(c2faxsend_OBJECTS) $(c2faxsend_DEPENDENCIES) @rm -f c2faxsend$(EXEEXT) $(CXXLINK) $(c2faxsend_LDFLAGS) $(c2faxsend_OBJECTS) $(c2faxsend_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/faxsend.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendmain.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: capi4hylafax-svn/src/faxsend/Makefile.am0000644000175000017500000000117610470310071020060 0ustar mastermaster## Process this file with automake to produce Makefile.in AUTOMAKE_OPTIONS = foreign CLEANFILES = *~ comperr MAINTAINERCLEANFILES = Makefile.in INCLUDES = -I.. -I$(srcdir)/.. -I$(srcdir)/../standard \ -I$(srcdir)/../capi -I$(srcdir)/../convert \ -I$(srcdir)/../linuxdep LDADD = ../capi/libcapi.a ../convert/libconvert.a ../linuxdep/liblinuxdep.a \ ../standard/libstandard.a noinst_HEADERS = faxsend.h bin_PROGRAMS = c2faxsend c2faxsend_SOURCES = faxsend.cpp sendmain.cpp capi4hylafax-svn/src/faxsend/faxsend.cpp0000644000175000017500000007252010470310071020161 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include #include #include #include #include #include #include #include #include #include #include "faxsend.h" #include "osImport.h" #include "ConfAssi.h" #include "FilePars.h" #include "misc.h" /*---------------------------------------------------------------------------*\ from capiutils.h: \*---------------------------------------------------------------------------*/ extern "C" char *capi_info2str(c_word reason); /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define FAX_FILTER_BUFFER_SIZE 1000 #define CAPI_BUFFER_SIZE CAPI_MAX_DATA_SIZE /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ //#define GENERATE_DEBUGSFFDATAFILE #ifdef GENERATE_DEBUGSFFDATAFILE static FILE *DebugSffDataFile = 0; #endif /*===========================================================================*\ \*===========================================================================*/ CFaxSend::CFaxSend (void (*FinishedFunc)(void)) : exitState (0), finishFunc (FinishedFunc), SpoolDir (DEFAULT_SPOOL_DIRECTORY), PollRcvdCmd (HYLAFAX_POLL_CMD), LogFileName (DEFAULT_C4H_LOGFILENAME), LogLevel (0), LogFileMode (DEFAULT_FILE_MODE), SuppressMSN (vFalse), UseFaxCIPValue (0), RecvFileMode (DEFAULT_FILE_MODE), m_commID (0), hLogFile (0), hJobFile (0), enableEcho (vFalse), SendDataInUse (UNIQUE_INIT_VALUE) { dhead ("CFaxSend - Constructor", DCON_CFaxSend); SetOutController (1); SetReceiveID (&TelNumber); } /*===========================================================================*\ \*===========================================================================*/ CFaxSend::~CFaxSend (void) { dhead ("CFaxSend - Destructor", DCON_CFaxSend); CloseSend(); CloseRecv(); CloseJobFile(); if (hLogFile != 0) { fclose (hLogFile); hLogFile = 0; } } /*===========================================================================*\ \*===========================================================================*/ tBool CFaxSend::Config (tChar *confName, char *devName, FaxFormatType faxType, int argc, char **argv) { dhead ("CFaxSend::Config", DCON_CFaxSend); dparams ("%s,%x,%x", confName, faxType, argc); dassert (confName != 0); dassert (devName != 0); dassert (argv != 0); DeviceName.Set (devName); SetFormat (faxType); optind = 1; tUInt RingingTimeVal = 0; tUInt OutController = 1; CConfigFileParser FileParser; CConfigParserSection *mainSect; ConfigAssignment_Item MainAssignments[] = { { "SpoolDir", ConfigAssignment_String, &SpoolDir }, { "PollRcvdCmd", ConfigAssignment_String, &PollRcvdCmd }, { "LogFile", ConfigAssignment_String, &LogFileName }, { "LogFileMode", ConfigAssignment_UInt, &LogFileMode }, { "LogTraceLevel", ConfigAssignment_UInt, &LogLevel }, { 0, ConfigAssignment_UInt, 0 } }; ConfigAssignment_Item Assignments[] = { { "HylafaxDeviceName", ConfigAssignment_String, &DeviceName }, { "FAXNumber", ConfigAssignment_String, &OrgFaxNumber }, { "LocalIdentifier", ConfigAssignment_String, &OrgIdentifier }, { "OutgoingMSN", ConfigAssignment_String, &OutMSN }, { "NumberPrefix", ConfigAssignment_String, &NumberPrefix }, { "NumberPlusReplacer", ConfigAssignment_String, &NumberPlusReplace }, { "OutgoingController", ConfigAssignment_UInt, &OutController }, { "SuppressMSN", ConfigAssignment_UInt, &SuppressMSN }, { "UseISDNFaxService", ConfigAssignment_UInt, &UseFaxCIPValue }, { "RingingDuration", ConfigAssignment_UInt, &RingingTimeVal }, { "RecvFileMode", ConfigAssignment_UInt, &RecvFileMode }, { 0, ConfigAssignment_UInt, 0 } }; printf ("The config file is %s.\n", confName); switch (FileParser.ParseFile (confName)) { case iErr_File_OpenFailed: printf ("Can't open config file \"%s\". Use default values.\n", confName); break; case i_Okay: break; case iErr_OutOfMemory: dassert (0); printf ("Running out of memory during reading of config file!\n"); return vFalse; default: dassert (0); printf ("Can't read config file \"%s\"!\n", confName); return vFalse; } mainSect = FileParser.GetMainSection(); if (!mainSect) { printf ("Not enough Memory for config file parsing!\n"); return vFalse; } ConfigValuesAssignment (&mainSect->ValueList, &MainAssignments[0]); for (CConfigParserSection *laufSect = (CConfigParserSection *)mainSect->SectionList.GetFirst(); laufSect; laufSect = (CConfigParserSection *)laufSect->GetNext()) { if (ConfigValuesTestName (&laufSect->ValueList, &Assignments[0]) != 1) { ConfigValuesAssignment (&laufSect->ValueList, &Assignments[0]); SetOutController (OutController); } } mainSect->ValueList.RemoveAndDeleteAll(); mainSect->SectionList.RemoveAndDeleteAll(); char ch; while ((ch = getopt (argc, argv, "Hh?vLlpnf:C:c:d:m:P:")) != -1) { switch (ch) { case 'c': if (mainSect && optarg && *optarg) { CDynamicString value; value.Set (optarg); if (value.IsEmpty() == vFalse) { FileParser.ParseLine (&value); ConfigValuesAssignment (&mainSect->ValueList, &MainAssignments[0]); ConfigValuesAssignment (&mainSect->ValueList, &Assignments[0]); mainSect->ValueList.RemoveAndDeleteAll(); } } break; case 'v': enableEcho = vTrue; break; case 'L': LogLevel = LOG_TRACE_ALL; break; } } if ( (LogFileName.IsEmpty() == vFalse) && LogLevel) { hLogFile = fopen ((char *)LogFileName.GetPointer(), "a"); dprint ("LogFile=%x-%s ", hLogFile, (char *)LogFileName.GetPointer()); if (hLogFile) { fchmod (fileno (hLogFile), LogFileMode); } } WriteLog (LOG_INFO, "\nC4H-Version " VERSION #ifdef C_PLATFORM_64 " (64Bit).\n\n"); #else " (32Bit).\n\n"); #endif Identifier.Set (&OrgIdentifier); FaxNumber.Set (&OrgFaxNumber); SetRingingTimeout (RingingTimeVal); if (GetFormat() == FaxFormat_Hylafax) { SpoolDir.SetRelative (HYLAFAX_POLL_DIR); // Adjust SpoolDir to correct place } return vTrue; } /*===========================================================================*\ \*===========================================================================*/ void CFaxSend::SetTagLine (CDynamicString *pTagLineFormat) { dhead ("CFaxSend::SetTagLine", DCON_CFaxSend); dassert (pTagLineFormat != 0); // parsing TagLine if (!pTagLineFormat->IsEmpty()) { tUInt pos = pTagLineFormat->FindChar ('|'); if (pos != MAXVAL_tUInt) { // '|' was found! if (pos > 0) { // Ignore empty Identifier Identifier.Set (pTagLineFormat->GetPointer(), pos); } pos++; if (pos < pTagLineFormat->GetLen()) { // Ignore empty FaxNumber FaxNumber.Set (pTagLineFormat->GetPointer() + pos, pTagLineFormat->GetLen() - pos); } } else { Identifier.Set (pTagLineFormat); } } else { Identifier.Set (&OrgIdentifier); FaxNumber.Set (&OrgFaxNumber); } } /*===========================================================================*\ \*===========================================================================*/ tSInfo CFaxSend::Send (CDynamicString *Number, CMultiString *FaxFilesList, tUInt Resolution, tUInt jobID, tUInt *pCommID, CDynamicString *pPollStr) { dhead ("CFaxSend::Send", DCON_CFaxSend); dassert (Number != 0); dparams ("%s,%u,%u", Number->GetPointer(), Resolution, jobID); dassert (FaxFilesList != 0); exitState = 0; // check params for fax polling PollString.RemoveAll(); if (pPollStr && (pPollStr->IsEmpty() == vFalse)) { dassert (pPollStr->IsEmpty() == vFalse); if (PollString.Set (pPollStr) == vFalse) { WriteLog (LOG_ERR, "Memory Error during initialisation.\n"); return iErr_OutOfMemory; } if (PollRcvdCmd.IsEmpty() == vTrue) { // no script specified dwarning (0); WriteLog (LOG_ERR, "Fax polling enabled without a valid PollRcvd script."); exitState = 13; return iErr_IniFile_ParamCombination; } if (FaxFilesList->GetFirst() != 0) { dwarning (0); dprint ("Wrong FaxFile=%s ",FaxFilesList->GetFirst()->GetPointer()); WriteLog (LOG_ERR, "Not allowed to poll and send a Fax within the same connection."); exitState = 13; return iErr_IniFile_ParamCombination; } } else { dassert (FaxFilesList->IsEmpty() == vFalse); } char *ModeText; switch (GetFormat()) { default: { ModeText = "Hylafax"; tUInt commID = GetJobFile(); dassert (pCommID != 0); if (pCommID) { *pCommID = commID; } WriteLog (LOG_INFO, "SESSION BEGIN %09u %s\n", jobID, FaxNumber.GetPointer()); WriteLog (LOG_INFO, "%s FAX: JOB %u DEST %s COMMID %09u\n", PollString.IsEmpty() ? "SEND" : "POLL", jobID, Number->GetPointer(), commID); break; } case FaxFormat_TIFF: ModeText = "TIFF"; break; case FaxFormat_G3: ModeText = "G3"; break; case FaxFormat_SFF: ModeText = "SFF"; break; } TelNumber.ErrorDetected(); TelNumber.Set (&NumberPrefix); if ( (Number->GetChar (0) == '+') && (!NumberPlusReplace.IsEmpty())) { if (Number->GetLen() <= 1) { WriteLog (LOG_ERR, "Telephonenumber to small (only includes '+').\n"); return iErr_OutOfMemory; } TelNumber.Append (&NumberPlusReplace); dassert (Number->GetPointer() != 0); dassert (Number->GetLen() > 1); TelNumber.Append (Number->GetPointer() + 1, Number->GetLen() - 1); } else { TelNumber.Append (Number); } if (TelNumber.ErrorDetected() == vTrue) { WriteLog (LOG_ERR, "Memory Error during initialisation.\n"); return iErr_OutOfMemory; } tSInfo fret = i_Okay; cp_b3configuration_faxext B3Config (b3_faxextopt_highres | b3_faxextopt_jbig, &FaxNumber, &Identifier); cp_ncpi_faxext NCPI (ncpi_faxextopt_highres); WriteLog (LOG_INFO, "Try to connect to fax number %s in %s mode%s on controller %d.\n", TelNumber.GetPointer(), ModeText, PollString.IsEmpty() ? "" : " (polling active)", GetOutController()); if (PollString.IsEmpty()) { fret = OpenSend (FaxFilesList, Resolution); } else { NCPI.Options |= ncpi_faxextopt_poll; // Enable FaxPolling } if (infoError (fret)) { switch (fret) { case iErr_Filter_OpenFailed: exitState = 11; break; case iErr_File_NotExist: exitState = 1; break; } RETURN ('x', fret); } exitState = 10; basicUniqueClear (&SendDataInUse); SetB1Parameters (b1prot_G3Fax); SetB2Parameters (b2prot_G3Fax); SetB3Parameters (b3prot_G3Fax_extended, &B3Config); SetNCPI (&NCPI); SetOwnNumber (&OutMSN, (SuppressMSN) ? CALLNUM_INDICATOR_SUPPRESS : CALLNUM_INDICATOR_DEFAULT); MakeCall (&TelNumber, (UseFaxCIPValue) ? cipvalue_G3Fax : cipvalue_3_1kHzAudio); RETURN ('x', i_Okay); } /*===========================================================================*\ \*===========================================================================*/ void CFaxSend::PageEndReached (tBool /* IsLastPage */) { dhead ("CFaxSend::PageEndReached", DCON_CFaxSend); } /*===========================================================================*\ \*===========================================================================*/ tUInt CFaxSend::GetRecvFileMode (void) { dhead ("CFaxSend::GetRecvFileMode", DCON_CFaxSend); return RecvFileMode; } /*===========================================================================*\ \*===========================================================================*/ CDynamicString *CFaxSend::GetSpoolDir (void) { dhead ("CFaxSend::GetSpoolDir", DCON_CFaxSend); return &SpoolDir; } /*===========================================================================*\ \*===========================================================================*/ void CFaxSend::IncomingCall (c_cipvalue, CConstString *, CConstString *) { dhead ("CFaxSend::IncomingCall", DCON_CFaxSend); // Nothing to do! dwarning (0); AnswerCall (creject_Ignore); } /*===========================================================================*\ \*===========================================================================*/ void CFaxSend::DoConnecting (void) { dhead ("CFaxSend::DoConnecting", DCON_CFaxSend); // Nothing to do! } /*===========================================================================*\ \*===========================================================================*/ void CFaxSend::ConnectProceeding (CConstString *) { dhead ("CFaxSend::ConnectProceeding", DCON_CFaxSend); ConnectionStarted(); } /*===========================================================================*\ \*===========================================================================*/ void CFaxSend::IsConnected (cp_ncpi_all *pNCPI) { dhead ("CFaxSend::IsConnected", DCON_CFaxSend); ConnectLog (pNCPI); exitState = 11; if (PollString.IsEmpty() == vFalse) { if (!pNCPI || !CheckOneFlag (pNCPI->Options, 0x1)) { // Polling could not be enabled => drop WriteLog (LOG_ERR, "Fax polling property could not be negotiated!\n"); exitState = 8; } else if (infoError (OpenRecv())) { WriteLog (LOG_ERR, "Can't create file for the fax!\n"); } else { // fax polling is active. Now wait for data return; } WriteLog (LOG_ERR, "Disconnecting now.\n"); Disconnect (DisconnectKind_Fast); } else { #ifdef GENERATE_DEBUGSFFDATAFILE dassert (DebugSffDataFile == 0); DebugSffDataFile = fopen ("/tmp/c2faxsend_dbgdatafile.sff", "w"); #endif SendData(); } } /*===========================================================================*\ \*===========================================================================*/ void CFaxSend::PutDataComplete (void *hDataID, c_info Reason) { dhead ("CFaxSend::PutDataComplete", DCON_CFaxSend); //dprint ("CFaxSend::PutDataComplete Reason 0x%X (%s).\n", Reason, capi_info2str (Reason)); dprint ("CFaxSend::PutDataComplete PageCount = %d\n", GetPageCount()); dassert (PollString.IsEmpty() == vTrue); delete [] (tUChar *)hDataID; if (Reason != ci_Int_NotConnected) { SendData(); } } /*===========================================================================*\ \*===========================================================================*/ void CFaxSend::GetData (tUByte *Data, tUShort DataLength, tUShort DataHandle) { dhead ("CFaxSend::GetData", DCON_CFaxSend); dassert (PollString.IsEmpty() == vFalse); if (infoError (RecvSFF (Data, DataLength))) { Disconnect (DisconnectKind_Fast); } GetDataComplete (DataHandle); } /*===========================================================================*\ \*===========================================================================*/ void CFaxSend::DisconnectInquiry (c_info Reason, cp_ncpi_all *pNCPI) { dhead ("CFaxSend::DisconnectInquiry", DCON_CFaxSend); dprint ("CFaxSend::DoDisconnecting GetSendState = %d\n", GetSendState()); dwarning (pNCPI != 0); if (pNCPI) { // sync PageCount with the value returned from CAPI dprint ("PageCount=%x/%x ", GetPageCount(), pNCPI->Pages); if (GetFormat() == FaxFormat_SFF) { SetPageCount (pNCPI->Pages); } else if (GetPageCount() != pNCPI->Pages) { dwarning (exitState != 0); dwarning (GetPageCount() > pNCPI->Pages); WriteLog (LOG_ERR, "Only %d from %d pages are transfered!\n", pNCPI->Pages, GetPageCount()); SetPageCount (pNCPI->Pages); if (exitState == 0) { exitState = 12; } } } if (PollString.IsEmpty()) { if ((GetSendState() < 2) || (ci_NoError != Reason)) { WriteLog (LOG_INFO, "Connection was dropped with Reason 0x%X (%s) before Fax was completely transfered.\n", Reason, capi_info2str (Reason)); exitState = 12; } } else { if ((GetRecvState() < 3) || (ci_NoError != Reason)) { WriteLog (LOG_INFO, "Connection was dropped with Reason 0x%X (%s) before Fax was completely received.\n", Reason, capi_info2str (Reason)); exitState = 12; } else { exitState = 0; } } StopSend(); StopRecv(); DisconnectConfirm(); } /*===========================================================================*\ \*===========================================================================*/ void CFaxSend::IsDisconnected (c_info Reason) { dhead ("CFaxSend::IsDisconnected", DCON_CFaxSend); WriteLog (LOG_INFO, "Connection dropped with Reason 0x%X (%s).\n", Reason, capi_info2str (Reason)); // connection dropped before established (10) or transfer still in progress (11) if ((exitState == 10) || (exitState == 11)) { if (exitState == 11) { exitState = 12; } switch ((Reason >> 8) & 0xFF) { case 0x00: case 0x10: exitState = 2; break; case 0x11: case 0x20: case 0x30: exitState = 3; break; case 0x33: exitState = ((Reason & 0xFF) == 0x01) ? 5 : 10; break; case 0x34: switch (Reason & 0xFF) { case 0x91: case 0xA2: case 0xA9: exitState = 4; break; } break; } } CloseSend(); CloseRecv(); #ifdef GENERATE_DEBUGSFFDATAFILE if (DebugSffDataFile) { fclose (DebugSffDataFile); DebugSffDataFile = 0; } #endif ResetChannel(); if (!PollString.IsEmpty() && GetRecvFiles() && !GetRecvFiles()->IsEmpty()) { // notify about received fax dassert (!PollRcvdCmd.IsEmpty()); CDynamicString executeCommand; executeCommand.Set (&PollRcvdCmd); char *StateText = ""; if (GetFormat() == FaxFormat_Hylafax) { switch (GetRecvState()) { default: case 0: StateText = "Can't build up connection for incoming call."; break; case 1: StateText = "Connection was established but no fax data was received."; break; case 2: StateText = "Connection droped unexpected during fax receiving."; break; case 3: break; } CDynamicString commStr; commStr.Print ("%09u", m_commID); // Hylafax: executeCommand.PrintAppend (" \"%S\" \"%S\" \"%S\" \"%S\" \"%s\"", &PollString, GetRecvFiles()->GetFirst(), &DeviceName, &commStr, StateText); } else { // mgetty: "" "" tUInt recvStatus = 0; switch (GetRecvState()) { default: case 0: recvStatus = 6; break; case 1: recvStatus = 7; break; case 2: recvStatus = 12; break; case 3: break; } executeCommand.PrintAppend (" %u 0x%X \"%S\" \"%S\" %u", recvStatus, Reason, GetReceiveID(), &PollString, GetPageCount()); for (COneMultiString *pLauf = GetRecvFiles()->GetFirst(); (pLauf != 0); pLauf = pLauf->GetNext()) { executeCommand.PrintAppend (" \"%s\"", pLauf->GetPointer()); } } if (executeCommand.ErrorDetected() == vTrue) { WriteLog (LOG_INFO, "Fax received and stored under %s.\n", GetRecvFiles()->GetFirst()); WriteLog (LOG_ERR, "Allocating memory error! Can't notify new received fax!\n"); exitState = 9; } else { WriteLog (LOG_INFO, "Fax received and calling '%s'.\n", executeCommand.GetPointer()); fflush (0); runCmd ((char *)executeCommand.GetPointer(), vTrue); } GetRecvFiles()->RemoveAndDeleteAll(); } } /*===========================================================================*\ \*===========================================================================*/ void CFaxSend::IsReseted (void) { dhead ("CFaxSend::IsReseted", DCON_CFaxSend); if (hLogFile != 0) { fclose (hLogFile); hLogFile = 0; } if (finishFunc) { finishFunc(); } } /*===========================================================================*\ \*===========================================================================*/ void CFaxSend::SendData (void) { dhead ("CFaxSend::SendData", DCON_CFaxSend); tUInt len = 0; tUChar *buffer = 0; if (basicUniqueStart (&SendDataInUse) == vTrue) { do { while ((IsPutQueueFull() == vFalse) && (GetSendState() < 2)) { buffer = new tUChar [CAPI_BUFFER_SIZE]; if (!buffer) { WriteLog (LOG_WARNING, "Allocating memory for new buffer failed!\n"); dwarning (0); break; } switch (SendSFF (buffer, CAPI_BUFFER_SIZE, &len)) { case i_Okay: if (len) { //if (UseOnlyLowRes == vTrue) { //TODO: eliminate every second line on fine faxes //SffLowResFilter.Change (buffer, len); //} #ifdef GENERATE_DEBUGSFFDATAFILE if (DebugSffDataFile) { fwrite (buffer, len, 1, DebugSffDataFile); } #endif if (PutData (buffer, len, buffer) == vFalse) { dassert (0); delete [] buffer; Disconnect (DisconnectKind_Fast); break; } len = 0; } else { delete [] buffer; } if (GetSendState() == 2) { WriteLog (LOG_INFO, "Fax file completely transfered to CAPI.\n"); exitState = 0; Disconnect (DisconnectKind_WaitNoPut); } break; case iErr_File_NotExist: exitState = 1; // no break! default: delete [] buffer; Disconnect (DisconnectKind_Fast); break; } } } while (basicUniqueStop (&SendDataInUse) == vFalse); } } /*===========================================================================*\ \*===========================================================================*/ void CFaxSend::WriteLog (tSInt priority, char *text, ...) { dhead ("CFaxSend::WriteLog", DCON_CFaxSend); char *statusText = 0; char timebuf[MAX_STRING_SIZE]; timeval tv; va_list params; va_start (params, text); gettimeofday (&tv, 0); strftime (timebuf, MAX_STRING_SIZE, "%h %d %T", localtime((time_t*) &tv.tv_sec)); sprintf (timebuf + strlen(timebuf), ".%02lu: [%5d]: ", tv.tv_usec / 10000, getpid()); if (hJobFile) { fprintf (hJobFile, timebuf); vfprintf (hJobFile, text, params); va_end (params); va_start (params, text); } if (enableEcho) { vprintf (text, params); va_end (params); va_start (params, text); } switch (priority) { default: if (LogLevel < LOG_TRACE_ALL) { return; } break; case LOG_INFO: case LOG_NOTICE: if (LogLevel < LOG_TRACE_INFOS) { return; } statusText = "INFO: "; break; case LOG_WARNING: if (LogLevel < LOG_TRACE_WARNINGS) { return; } statusText = "WARNING: "; break; case LOG_ERR: if (LogLevel < LOG_TRACE_ERRORS) { return; } statusText = "ERROR: "; break; } if (hLogFile) { fprintf (hLogFile, timebuf); fprintf (hLogFile, DEFAULT_SENDPROG_NAME " - "); if (statusText) { fprintf (hLogFile, statusText); } vfprintf (hLogFile, text, params); va_end (params); va_start (params, text); fflush (hLogFile); } if (priority == LOG_ERR) { char errortext[MAX_STRING_SIZE]; vsnprintf (errortext, MAX_STRING_SIZE, text, params); openlog (DEFAULT_SENDPROG_NAME, LOG_PERROR, 0); syslog (priority, errortext); closelog(); } va_end (params); } /*===========================================================================*\ \*===========================================================================*/ tUInt CFaxSend::GetJobFile (void) { dhead ("CFaxSend::GetJobFile", DCON_CFaxSend); dassert (GetFormat() == FaxFormat_Hylafax); CloseJobFile(); char astring[MAX_STRING_SIZE]; tSInt len; tUInt tmpJobFileNr = 1; tSInt tmpFileD = -1; tSInt SeqFile = open (HYLAFAX_LOG_DIR HYLAFAX_SEQF_FILE, O_CREAT | O_RDWR, 0644); if (SeqFile >= 0) { flock (SeqFile, LOCK_EX); len = read (SeqFile, astring, MAX_STRING_SIZE); astring[(len <= 0) ? 0 : len] = '\0'; tmpJobFileNr = atoi (astring) + 1; } for (tUInt trys = MAX_TRY_COUNT; trys > 0; trys--, tmpJobFileNr++) { if (tmpJobFileNr < 1 || tmpJobFileNr > MAX_SEQ_NUMBER) { tmpJobFileNr = 1; } sprintf (astring, HYLAFAX_LOG_DIR "c%09u", tmpJobFileNr); tmpFileD = open (astring, O_RDWR | O_CREAT | O_EXCL, LogFileMode); dprint ("try(%s,%u,%d) ", astring, strlen (astring), tmpFileD); if (tmpFileD >= 0) { flock (tmpFileD, LOCK_EX | LOCK_NB); hJobFile = fdopen (tmpFileD, "w"); dprint ("fdopen(%x,%d) ", hJobFile, tmpFileD); if (hJobFile != 0) { if (SeqFile >= 0) { sprintf (astring , "%u", tmpJobFileNr); len = strlen (astring); lseek (SeqFile, 0, SEEK_SET); write (SeqFile, astring, len); ftruncate (SeqFile, len); } break; } close (tmpFileD); tmpFileD = -1; continue; } if (errno != EEXIST) { break; } } if (SeqFile >= 0) { close (SeqFile); } m_commID = (hJobFile) ? tmpJobFileNr : 0; return m_commID; } /*===========================================================================*\ \*===========================================================================*/ void CFaxSend::CloseJobFile (void) { if (hJobFile != 0) { fclose (hJobFile); hJobFile = 0; } m_commID = 0; } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/faxsend/faxsend.h0000644000175000017500000000671510470310071017631 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _FAXSEND_H_ #define _FAXSEND_H_ #include "Channel.h" #include "BasicFax.h" #include "ConfPars.h" #include "PathName.h" #include "defaults.h" /*===========================================================================*\ \*===========================================================================*/ class CFaxSend : public CTransferChannel, public CBasicFaxConversion { public: CFaxSend (void (*FinishedFunc)(void)); virtual ~CFaxSend (void); tBool Config (tChar *confName, char *devName, FaxFormatType faxType, int argc, char **argv); void SetTagLine (CDynamicString *pTagLineFormat); tSInfo Send (CDynamicString *Number, CMultiString *FaxFilesList, tUInt Resolution, tUInt jobID, tUInt *pCommID, CDynamicString *pPollStr); void WriteLog (tSInt priority, char *text, ...); tUInt exitState; void CloseJobFile (void); private: // virtual functions from CBasicFaxConversion void PageEndReached (tBool IsLastPage); tUInt GetRecvFileMode (void); CDynamicString *GetSpoolDir (void); // virtual functions from CTransferChannel void IncomingCall (c_cipvalue CIPValue, CConstString *pOppositeNumber, CConstString *pMyCalledNumber); void DoConnecting (void); void ConnectProceeding (CConstString *ConnectedNumber); void IsConnected (cp_ncpi_all *pNCPI); void PutDataComplete (void *hDataID, c_info Info); void GetData (tUByte *Data, tUShort DataLength, tUShort DataHandle); void DisconnectInquiry (c_info ReasonB3, cp_ncpi_all *pNCPI); void IsDisconnected (c_info Reason); void IsReseted (void); void SendData (void); tUInt GetJobFile (void); void (*finishFunc)(void); CPathName SpoolDir; CDynamicString DeviceName; CDynamicString PollRcvdCmd; CDynamicString PollString; CDynamicString TelNumber; CDynamicString FaxNumber; CDynamicString Identifier; CDynamicString OrgFaxNumber; CDynamicString OrgIdentifier; CDynamicString OutMSN; CDynamicString NumberPrefix; CDynamicString NumberPlusReplace; CDynamicString LogFileName; tUInt LogLevel; tUInt LogFileMode; tUInt SuppressMSN; tUInt UseFaxCIPValue; tUInt RecvFileMode; tUInt m_commID; FILE *hLogFile; FILE *hJobFile; tBool enableEcho; tUInt SendDataInUse; //tBool UseOnlyLowRes; }; /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/linuxdep/0000755000175000017500000000000010470310072016220 5ustar mastermastercapi4hylafax-svn/src/linuxdep/SysTick.h0000644000175000017500000000263510470310072017770 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef __systick_h__ #define __systick_h__ #include "TimerList.h" class CSystemTicker { public: CSystemTicker (void); virtual ~CSystemTicker (void); void AddTimer (tHandle timer, unsigned interval); tBool RemoveTimer (tHandle timer); void IncrementTicks (void); void NotifyTimers (void); private: static int alife; CSystemTicker *first; CTimerList *list; unsigned ticks; void (*handler) (int); }; inline void CSystemTicker::IncrementTicks (void) { ticks++; } CSystemTicker *GetSystemTicker (void); #endif capi4hylafax-svn/src/linuxdep/Eventing.cpp0000644000175000017500000000654010470310072020510 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "Eventing.h" #include "Protect.h" #include "dbgLINUX.h" #include #include /*===========================================================================*\ \*===========================================================================*/ tBool Event_Create (thEvent *pEvent) { dhead ("Event_Create", DEBUG_Eventing); dassert (pEvent != 0); dwarning (*pEvent == vIllegalHandle); dassert (vIllegalHandle == 0); sem_t *pSem = new sem_t; if (pSem && (sem_init (pSem, 0, 0) == 0)) { *pEvent = pSem; return vTrue; } dprintWrn ("sem_init failed with %d. ", errno); *pEvent = 0; return vFalse; } /*===========================================================================*\ \*===========================================================================*/ void Event_Destroy (thEvent *pEvent) { dhead ("Event_Destroy", DEBUG_Eventing); dassert (pEvent != 0); if (*pEvent != vIllegalHandle) { if (sem_destroy ((sem_t *)*pEvent) != 0) { dprintErr ("sem_destroy failed with %d. ", errno); } delete (sem_t *)*pEvent; *pEvent = vIllegalHandle; } } /*===========================================================================*\ \*===========================================================================*/ void Event_Set (thEvent event) { dhead ("Event_Set", DEBUG_Eventing); dassert (event != 0); int get; sem_getvalue ((sem_t *)event, &get); if (get == 0) { int fret = sem_post ((sem_t *)event); dassert (fret == 0); } } /*===========================================================================*\ \*===========================================================================*/ void Event_Clear (thEvent event) { dhead ("Event_Clear", DEBUG_Eventing); dassert (event != 0); while (sem_trywait ((sem_t *)event) == 0) ; } /*===========================================================================*\ \*===========================================================================*/ tBool Event_Wait (thEvent event, tUInt TimeInMSec) { dhead ("Event_Wait", DEBUG_Eventing); dparams ("%x", TimeInMSec); dassert (TimeInMSec == 0); // No timeout support now !! while (sem_wait ((sem_t *)event)) { if (errno != EINTR) { break; } } return vTrue; } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/linuxdep/misc.h0000644000175000017500000000251410470310072017326 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef MISC_H #define MISC_H /*===========================================================================*\ \*===========================================================================*/ tUInt FaxPropEncode (tUInt vRes, tUInt BaudRate); tBool runCmd (char* cmd, bool changeIDs); const char *DataFormat2str (tUInt DataFormat); /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/linuxdep/Makefile.in0000644000175000017500000003342210470310072020271 0ustar mastermaster# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/linuxdep DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru liblinuxdep_a_AR = $(AR) $(ARFLAGS) liblinuxdep_a_LIBADD = am_liblinuxdep_a_OBJECTS = CapiBase.$(OBJEXT) dbgLEVEL.$(OBJEXT) \ misc.$(OBJEXT) PrctlDmp.$(OBJEXT) SecTimer.$(OBJEXT) \ SysTick.$(OBJEXT) TimerList.$(OBJEXT) liblinuxdep_a_OBJECTS = $(am_liblinuxdep_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) depcomp = $(SHELL) $(top_srcdir)/src/scripts/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(liblinuxdep_a_SOURCES) DIST_SOURCES = $(liblinuxdep_a_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) INSTALL = @INSTALL@ ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ hylafaxbindir = @hylafaxbindir@ hylafaxspooldir = @hylafaxspooldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign CLEANFILES = *~ comperr MAINTAINERCLEANFILES = Makefile.in INCLUDES = -I$(srcdir)/../standard -I$(srcdir)/../capi noinst_HEADERS = dbgLINUX.h misc.h PrctlDmp.h SysTick.h TimerList.h noinst_LIBRARIES = liblinuxdep.a liblinuxdep_a_SOURCES = CapiBase.cpp dbgLEVEL.cpp misc.cpp PrctlDmp.cpp SecTimer.cpp SysTick.cpp TimerList.cpp all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/linuxdep/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/linuxdep/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) liblinuxdep.a: $(liblinuxdep_a_OBJECTS) $(liblinuxdep_a_DEPENDENCIES) -rm -f liblinuxdep.a $(liblinuxdep_a_AR) liblinuxdep.a $(liblinuxdep_a_OBJECTS) $(liblinuxdep_a_LIBADD) $(RANLIB) liblinuxdep.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CapiBase.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PrctlDmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SecTimer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SysTick.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TimerList.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbgLEVEL.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: capi4hylafax-svn/src/linuxdep/TimerList.h0000644000175000017500000000327710470310072020316 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef __timerlist_h__ #define __timerlist_h__ #include "CBTimer.h" class CTimerSlot : public CBasicTimerSupport { public: CTimerSlot (void); void SetTarget (unsigned target); private: CTimerSlot *link; unsigned target; friend class CTimerList; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class CTimerList { public: CTimerList (void); ~CTimerList (void); void Add (tHandle timer, unsigned time); tBool Remove (tHandle timer); void Clear (void); void Notify (unsigned time); unsigned Card (void); private: CTimerSlot *list; unsigned count; CTimerSlot *internal_Remove (CTimerSlot * s1, CTimerSlot * s2); }; inline unsigned CTimerList::Card (void) { return count; } #endif capi4hylafax-svn/src/linuxdep/dbgLINUX.h0000644000175000017500000000243010470310072017744 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _DBGCAPI_H_ #define _DBGCAPI_H_ #include "DbgInfo.h" /*===========================================================================*\ \*===========================================================================*/ extern tUInt DCON_CapiBase; extern tUInt DCON_SecTimer; /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/linuxdep/dbgLEVEL.cpp0000644000175000017500000000734610470310072020262 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "dbgSTD.h" #include "dbgCAPI.h" #include "dbgLINUX.h" #include "ExtFuncs.h" #include /*===========================================================================*\ \*===========================================================================*/ tUInt DCON_CFaxSend = Dbg_Level_Internal; tUInt DCON_CFaxReceive = Dbg_Level_Internal; tUInt DCON_CFaxReceiveDevice = Dbg_Level_Internal; tUInt DCON_CFaxReceiveMain = Dbg_Level_Internal; tUInt DCON_SffFilter = Dbg_Level_Infos; tUInt DCON_TifFilter = Dbg_Level_Infos; tUInt DCON_CBasicFaxConversion = Dbg_Level_Internal; /*===========================================================================*\ CAPI \*===========================================================================*/ tUInt DCON_CAPITrace = Dbg_Level_Logs; tUInt DCON_CCAPI20_MsgBase = Dbg_Level_Infos; tUInt DCON_CCAPI20_Channel = Dbg_Level_Infos; tUInt DCON_CCAPI20_Facility = Dbg_Level_Infos; tUInt DCON_CTransferChannel = Dbg_Level_Internal; tUInt DCON_CCntrlMSNList = Dbg_Level_Internal; tUInt DCON_PLCIList = Dbg_Level_Infos; tUInt DCON_CCStruct = Dbg_Level_Infos; tUInt DCON_CCAPI20_Statistic = Dbg_Level_Infos; /*===========================================================================*\ others \*===========================================================================*/ tUInt DCON_StringFuncs = Dbg_Level_Infos; tUInt DCON_CDynamicString = Dbg_Level_Infos; tUInt DCON_CStandardByteQueue = Dbg_Level_Infos; tUInt DCON_CStandardQueue = Dbg_Level_Infos; tUInt DCON_CStandardArray = Dbg_Level_Infos; tUInt DCON_CDynamicStore = Dbg_Level_Infos; tUInt DCON_CPointerList = Dbg_Level_Infos; tUInt DCON_CBasicTimerSupport = Dbg_Level_Infos; tUInt DCON_ConfigParser = Dbg_Level_Internal; tUInt DCON_ConfigParserAssi = Dbg_Level_Internal; tUInt DCON_CapiBase = Dbg_Level_Infos; tUInt DCON_Protect = Dbg_Level_Infos; tUInt DCON_SecTimer = Dbg_Level_Infos; tUInt DCON_Eventing = Dbg_Level_Infos; /*===========================================================================*\ \*===========================================================================*/ char *DbgIPrintLinePrefix = ""; unsigned DbgIPrintLinePrefixLen = 0; #if defined (DCON_FILE_NAME) && (USE_DCON_INFO_CLASS > 0) #include "DbgFile.h" void DbgIPrintStr (char *output) { DebugFilePrint (output); } #else #include void DbgIPrintStr (char *output) { puts (output); } #endif void DbgIBreakPoint (void) { } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/linuxdep/PrctlDmp.cpp0000644000175000017500000000425310470310072020455 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "PrctlDmp.h" #include #include #include #include #include #ifndef PR_GET_DUMPABLE #define PR_GET_DUMPABLE 3 #endif #ifndef PR_SET_DUMPABLE #define PR_SET_DUMPABLE 4 #endif /*===========================================================================*\ \*===========================================================================*/ void InitPrctlDumpable (void) { int ret; errno = 0; ret = prctl(PR_GET_DUMPABLE); if (errno == EINVAL) { //printf ("Warning: PR_GET_DUMPABLE not supported by current kernel\n"); } else if (ret == 0) { errno = 0; if (prctl (PR_SET_DUMPABLE, 1) < 0) { if (errno == EINVAL) { printf ("Warning: PR_SET_DUMPABLE not supported by current kernel\n"); } else { fprintf (stderr, "Error: PR_SET_DUMPABLE failed - %s (%d)\n", strerror(errno), errno); } } else if (prctl(PR_GET_DUMPABLE) != 0) { //printf ("Info: programm will dump core if needed"); } else { fprintf (stderr, "Error: programm not dumpable after PR_SET_DUMPABLE :-(\n"); } } } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/linuxdep/CapiBase.cpp0000644000175000017500000001672110470310072020402 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "CapiBase.h" #include "c2msgdef.h" #include "dbgLINUX.h" #define __NO_CAPIUTILS__ #include #include /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ struct InternalCapiEntry { CCallBackCapiBase *pBaseClass; pthread_t Thread; tBool StopThread; }; static void *CapiBase_WaitForSignalThread (InternalCapiEntry *pice); /*===========================================================================*\ \*===========================================================================*/ void CapiBase_Register (CCallBackCapiBase *pBaseClass, tUInt, tUInt MaxB3Connection, tUInt MaxB3Blks, tUInt MaxSizeB3) { dhead ("CapiBase_Register", DCON_CapiBase); dassert (pBaseClass != 0); c_info fret = ci_Int_MemoryFullErr; InternalCapiEntry *pice = new InternalCapiEntry; dwarning (pice != 0); pBaseClass->Set_ApplID (IllegalApplID); if (pice) { pice->pBaseClass = pBaseClass; pice->Thread = 0; pice->StopThread = vFalse; fret = (c_info)capi20_isinstalled(); if (fret == ci_NoError) { tUInt applid; fret = (c_info)capi20_register (MaxB3Connection, MaxB3Blks, MaxSizeB3, &applid); dprint ("ApplID=%x, Register-Return=%x ", applid, fret); if ((applid != IllegalApplID) && (CapiInfoIsSuccess (ci_NoError))) { pBaseClass->Set_ApplID (applid); if (!pthread_create (&pice->Thread, 0, (void *(*)(void *))CapiBase_WaitForSignalThread, pice)) { // everything is initialised successfully return; } dwarning (0); pBaseClass->Set_ApplID (IllegalApplID); fret = (c_info)capi20_release (applid); // what can we do if release failed? dassert (fret == ci_NoError); fret = ci_Reg_OSResourceErr; } } delete pice; } dassert (fret != ci_NoError); pBaseClass->RegisterComplete (vIllegalHandle, fret); } /*===========================================================================*\ \*===========================================================================*/ void CapiBase_Release (thCapiBase Base) { dhead ("CapiBase_Release", DCON_CapiBase); dassert (Base != vIllegalHandle); InternalCapiEntry *pice = (InternalCapiEntry *)Base; dassert (pice->pBaseClass->ApplID() != IllegalApplID); c_word applid = pice->pBaseClass->ApplID(); pice->pBaseClass->Set_ApplID (IllegalApplID); pice->StopThread = vTrue; dprint ("Terminate Thread(%x)!!! ", pice->pBaseClass); // send a message to terminate the CAPI_WAIT_FOR_SIGNAL static c_word ListenMsg[] = { 0x1a, 0x00, CAPI_LISTEN_REQ, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; capi20_put_message (applid, (c_message)ListenMsg); // Call to CAPI_RELEASE will be done at the end of the thread } /*===========================================================================*\ \*===========================================================================*/ void CapiBase_PutMessage (thCapiBase Base, c_message Message) { dhead ("CapiBase_PutMessage", DCON_CapiBase); dassert (Base != vIllegalHandle); ((InternalCapiEntry *)Base)->pBaseClass->PutMessageComplete ((c_info)capi20_put_message ( ((InternalCapiEntry *)Base)->pBaseClass->ApplID(), Message)); } /*===========================================================================*\ \*===========================================================================*/ void CapiBase_GetProfile (thCapiBase Base, tUInt Controller) { dhead ("CapiBase_GetProfile", DCON_CapiBase); dassert (Base != vIllegalHandle); cm_getprofile Buffer; ((InternalCapiEntry *)Base)->pBaseClass->GetProfileComplete (Controller, &Buffer, (c_info)capi20_get_profile (Controller, (c_message)&Buffer)); } /*===========================================================================*\ \*===========================================================================*/ void *CapiBase_WaitForSignalThread (InternalCapiEntry *pice) { dhead ("CapiBase_WaitForSignalThread", DCON_CapiBase); dassert (pice != 0); c_message pCAPIMessage; c_word applid = pice->pBaseClass->ApplID(); tUInt fret = ci_NoError; dassert (applid != IllegalApplID); if (pice->StopThread == vFalse) { pice->pBaseClass->RegisterComplete ((thCapiBase)pice, ci_NoError); while (pice->StopThread == vFalse) { // after the ThreadState was checked, check the result from CAPI_WAIT_FOR_SIGNAL switch (fret) { case ci_NoError: case ci_Reg_Busy: case ci_Msg_Busy: case ci_Msg_SendQueueFull: case ci_Msg_ReceiveQueueEmpty: break; default: /*----- Ein schwieriger Fehler! -----*/ dwarning (0); pice->pBaseClass->GetMessageReceived (0, (c_info)fret); break; } dprint ("-CAPI_GET_MESSAGE(%x)- ", pice->pBaseClass); fret = capi20_get_message (applid, &pCAPIMessage); switch (fret) { case ci_Reg_Busy: case ci_Msg_Busy: case ci_Msg_SendQueueFull: case ci_Msg_ReceiveQueueEmpty: break; default: dwarning (0); // no break! case ci_NoError: pice->pBaseClass->GetMessageReceived (pCAPIMessage, (c_info)fret); break; } if (pice->StopThread == vTrue) { dprint ("Release was called in GetMessageReceived(%x)! ", pice->pBaseClass); break; } dprint ("-CAPI_WAIT_FOR_SIGNAL(%x)- ", pice->pBaseClass); fret = capi20_waitformessage (applid, 0); dprint ("-loop(%x)- ", pice->pBaseClass); } } dprint ("Call CAPI_RELEASE!! "); dassert (pice->pBaseClass->ApplID() == IllegalApplID); fret = capi20_release (applid); dassert (fret == 0); dprint ("-ThreadQueueEnd(%x)- ", pice->pBaseClass); CCallBackCapiBase *pBaseClass = pice->pBaseClass; delete pice; pBaseClass->ReleaseComplete(); return 0; } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/linuxdep/Makefile.am0000644000175000017500000000072710470310072020262 0ustar mastermaster## Process this file with automake to produce Makefile.in AUTOMAKE_OPTIONS = foreign CLEANFILES = *~ comperr MAINTAINERCLEANFILES = Makefile.in INCLUDES = -I$(srcdir)/../standard -I$(srcdir)/../capi noinst_HEADERS = dbgLINUX.h misc.h PrctlDmp.h SysTick.h TimerList.h noinst_LIBRARIES = liblinuxdep.a liblinuxdep_a_SOURCES = CapiBase.cpp dbgLEVEL.cpp misc.cpp PrctlDmp.cpp SecTimer.cpp SysTick.cpp TimerList.cpp capi4hylafax-svn/src/linuxdep/SysTick.cpp0000644000175000017500000000672510470310072020327 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include #include #include #include "SysTick.h" static CSystemTicker *ticker = 0; /*---------------------------------------------------------------------------*\ * Run-time system's signal handler \*---------------------------------------------------------------------------*/ static void tick_handler (int /*sig*/) { if (ticker) { ticker->IncrementTicks (); ticker->NotifyTimers (); } } /* tick_handler */ /*---------------------------------------------------------------------------*\ * CSystemTicker \*---------------------------------------------------------------------------*/ int CSystemTicker::alife = 0; CSystemTicker::CSystemTicker (void) : first (0), list (0), ticks (0), handler (0) { if (1 == ++alife) { struct itimerval interval; list = new CTimerList (); handler = signal (SIGALRM, &tick_handler); interval.it_interval.tv_sec = 1; interval.it_interval.tv_usec = 0; interval.it_value.tv_sec = 1; interval.it_value.tv_usec = 0; (void) setitimer (ITIMER_REAL, &interval, 0); first = this; } else { first = GetSystemTicker (); } } // CSystemTicker::CSystemTicker CSystemTicker::~CSystemTicker (void) { if (0 == --alife) { struct itimerval interval; interval.it_interval.tv_sec = 0; interval.it_interval.tv_usec = 0; interval.it_value.tv_sec = 0; interval.it_value.tv_usec = 0; (void) setitimer (ITIMER_REAL, &interval, 0); (void) signal (SIGALRM, handler); handler = 0; delete list; } first = 0; } // CSystemTicker::~CSystemTicker void CSystemTicker::AddTimer (tHandle timer, unsigned interval) { // Something in the setitimer code limits the maximum duration // for these timers. I have not yet determined the exact maximum, // but 30 minutes works, an hour does not. (The corresponding // timer will not "fire"...) // assert (interval < 1801); list->Add (timer, ticks + interval); } // CSystemTicker::AddTimer tBool CSystemTicker::RemoveTimer (tHandle timer) { return list->Remove (timer); } // CSystemTicker::RemoveTimer void CSystemTicker::NotifyTimers (void) { list->Notify (ticks); } // CSystemTicker::NotifyTimers /*---------------------------------------------------------------------------*\ * Global access to the global system ticker object \*---------------------------------------------------------------------------*/ CSystemTicker * GetSystemTicker (void) { return ticker ? ticker : ticker = new CSystemTicker (); } // SetSystemTicker capi4hylafax-svn/src/linuxdep/PrctlDmp.h0000644000175000017500000000235310470310072020121 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _PRCTLDMP_H_ #define _PRCTLDMP_H_ /*===========================================================================*\ \*===========================================================================*/ void InitPrctlDumpable (void); /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/linuxdep/SecTimer.cpp0000644000175000017500000000512110470310072020436 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "SecTimer.h" #include "SysTick.h" #include "dbgLINUX.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ static CBasicTimerSupport *CTimerSlot_AllocFunc (void) { return (GetSystemTicker()) ? new CTimerSlot : 0; } /*===========================================================================*\ \*===========================================================================*/ tBool SecTimer_Create (thSecTimer *pTimer) { dhead ("SecTimer_Create", DCON_SecTimer); dassert (pTimer != 0); return CTimerSlot::Create (pTimer, CTimerSlot_AllocFunc); } void SecTimer_Destroy (thSecTimer *pTimer) { dhead ("SecTimer_Destroy", DCON_SecTimer); dassert (pTimer != 0); if (*pTimer != vIllegalHandle) { SecTimer_Cancel (*pTimer); CTimerSlot::Destroy (pTimer); } } tBool SecTimer_Call (thSecTimer timer, tUInt secs, tCallBackTimerFunc cbfunc, void *handle1, void *handle2) { dhead ("SecTimer_Call", DCON_SecTimer); dparams ("%x,%x,%x,%x,%x", timer, secs, cbfunc, handle1, handle2); dassert (timer != vIllegalHandle); dassert (secs > 0); dassert (cbfunc != 0); SecTimer_Cancel (timer); ((CTimerSlot *)timer)->SetCallBack (cbfunc); ((CTimerSlot *)timer)->SetHandles (handle1, handle2); GetSystemTicker()->AddTimer (timer, secs); return vTrue; } tBool SecTimer_Cancel (thSecTimer timer) { dhead ("SecTimer_Cancel", DCON_SecTimer); dassert (timer != vIllegalHandle); return GetSystemTicker()->RemoveTimer (timer); } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/linuxdep/misc.cpp0000644000175000017500000000755510470310072017673 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "aTypes.h" #include #include #include #include #include #include #include #include #include /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ tUInt FaxPropEncode (tUInt vRes, tUInt BaudRate) { //params.encode: st|bf|ec|df|ln| wd| br|vr //values for capi: 000 0 0 00 10 000 ??? 0/1 tUInt br = 0; if (BaudRate > 12000) { br = 5; } else if (BaudRate > 9600) { br = 4; } else if (BaudRate > 7200) { br = 3; } else if (BaudRate > 4800) { br = 2; } else if (BaudRate > 2400) { br = 1; } return 0x100 + (br << 1) + ((vRes > 98) ? 1 : 0); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ static void detachIO(void) { //endpwent(); // XXX some systems hold descriptors int fd = open (_PATH_DEVNULL, O_RDWR); dup2 (fd, STDIN_FILENO); dup2 (fd, STDOUT_FILENO); dup2 (fd, STDERR_FILENO); for (fd = _POSIX_OPEN_MAX - 1; (fd >= 0); fd--) { if (fd != STDIN_FILENO && fd != STDOUT_FILENO && fd != STDERR_FILENO) { close(fd); } } } static void setRealIDs (void) { uid_t euid = geteuid(); seteuid (0); const passwd *pwd = getpwuid (euid); if (pwd) { initgroups(pwd->pw_name, pwd->pw_gid); } else { setgroups (0, NULL); } setgid (getegid()); setuid (euid); } tBool runCmd (char* cmd, bool changeIDs) { pid_t pid = fork(); switch (pid) { case 0: if (changeIDs) { setRealIDs(); } detachIO(); execl ("/bin/sh", "sh", "-c", cmd, NULL); sleep (1); _exit (127); default: { int status = 0; waitpid (pid, &status, 0); if (status == 0) { return vTrue; } break; } case -1: break; } return vFalse; } /*---------------------------------------------------------------------------*\ Convert NCPI for B3 protocol 5, Parameter Format to readable string (messages CONNECT_B3_REQ, CONNECT_B3_IND, CONNECT_B3_ACTIVE_IND, DISCONNECT_B3_IND) \*---------------------------------------------------------------------------*/ const char *DataFormat2str (tUInt DataFormat) { char *t; switch (DataFormat) { case 0: t = "SFF"; break; case 1: t = "Plain fax format (modified Huffman coding"; break; case 2: t = "PCX"; break; case 3: t = "DCX"; break; case 4: t = "TIFF"; break; case 5: t = "ASCII"; break; case 6: t = "Extended ANSI"; break; case 7: t = "Binary file transfer"; break; default: t = "unknown"; break; } return t; } capi4hylafax-svn/src/linuxdep/TimerList.cpp0000644000175000017500000000730710470310072020647 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "TimerList.h" #include "dbgLINUX.h" /*---------------------------------------------------------------------------*\ * CTimerSlot \*---------------------------------------------------------------------------*/ CTimerSlot::CTimerSlot (void) : link (0), target (0) { // NOP } // CTimerSlot::CTimerSlot void CTimerSlot::SetTarget (unsigned taRget) { target = taRget; } // CTimerSlot::CTimerSlot /*---------------------------------------------------------------------------*\ * CTimerList \*---------------------------------------------------------------------------*/ CTimerList::CTimerList (void) : list (0), count (0) { // NOP } // CTimerList::CTimerList CTimerList::~CTimerList (void) { Clear (); } // CTimerList::~CTimerList void CTimerList::Add (tHandle timer, unsigned time) { dhead ("CTimerList::Add", DCON_SecTimer); dparams ("%x,%x", timer, time); CTimerSlot * tmp1 = list; CTimerSlot * tmp2 = 0; CTimerSlot * new1 = (CTimerSlot *)timer; new1->SetTarget (time); while (tmp1 && (tmp1->target < time)) { tmp2 = tmp1; tmp1 = tmp1->link; } new1->link = tmp1; if (tmp2) { tmp2->link = new1; } else { list = new1; } ++count; } // CTimerList::Add tBool CTimerList::Remove (tHandle timer) { dhead ("CTimerList::Remove", DCON_SecTimer); dparams ("%x", timer); CTimerSlot * tmp1 = list; CTimerSlot * tmp2 = 0; while (tmp1) { if (timer == (tHandle)tmp1) { (void) internal_Remove (tmp1, tmp2); return vTrue; } tmp2 = tmp1; tmp1 = tmp1->link; } //dwarning (0); // timer not found in list! return vFalse; } // CTimerList::Remove void CTimerList::Clear (void) { dhead ("CTimerList::Clear", DCON_SecTimer); CTimerSlot * temp = list; CTimerSlot * next; while (temp) { next = temp->link; temp = next; } count = 0; list = 0; } // CTimerList::Clear void CTimerList::Notify (unsigned time) { dhead ("CTimerList::Notify", DCON_SecTimer); dparams ("%x", time); CTimerSlot *tmp1 = list; CTimerSlot *tmp2 = 0; CTimerSlot *tmp3; while (tmp1) { if (tmp1->target <= time) { dprint ("Slot found! "); tmp3 = internal_Remove (tmp1, tmp2); tmp1->DoCallBack(); tmp1 = tmp3; } else { tmp2 = tmp1; tmp1 = tmp2->link; } } } // CTimerList::Notify CTimerSlot * CTimerList::internal_Remove (CTimerSlot * s1, CTimerSlot * s2) { dhead ("CTimerList::internal_Remove", DCON_SecTimer); dparams ("%x,%x", s1, s2); CTimerSlot * temp = 0; if (s1) { temp = s1->link; if (s2) { s2->link = s1->link; } else { list = s1->link; } --count; } return temp; } // CTimerList::internal_Remove capi4hylafax-svn/src/capi/0000755000175000017500000000000010470310075015307 5ustar mastermastercapi4hylafax-svn/src/capi/dbgCAPI.h0000644000175000017500000000311510470310075016651 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _DBGCAPI_H_ #define _DBGCAPI_H_ #include "DbgInfo.h" /*===========================================================================*\ \*===========================================================================*/ extern tUInt DCON_CAPITrace; extern tUInt DCON_CCAPI20_MsgBase; extern tUInt DCON_CCAPI20_Manager; extern tUInt DCON_CCAPI20_Channel; extern tUInt DCON_CCAPI20_Facility; extern tUInt DCON_CTransferChannel; extern tUInt DCON_CCntrlMSNList; extern tUInt DCON_PLCIList; extern tUInt DCON_CAPI_CONVERT; extern tUInt DCON_CCStruct; extern tUInt DCON_CCAPI20_Statistic; /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/capi/CCStruct.h0000644000175000017500000002236010470310075017155 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _CCSTRUCT_H_ #define _CCSTRUCT_H_ #include "capi2def.h" #include "CString.h" #include "DataPack.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define iWrn_Struct_NoChanges CalculateInfoValue (infoType_Packet, infoKind_Warning, 1) #define iErr_Struct_LenToSmall CalculateInfoValue (infoType_Packet, infoKind_Error, 1) #define iErr_Struct_WrongFormat CalculateInfoValue (infoType_Packet, infoKind_Error, 2) #define iErr_Struct_WrongLength CalculateInfoValue (infoType_Packet, infoKind_Error, 3) #define iErr_Struct_LenOutOfRange CalculateInfoValue (infoType_Packet, infoKind_Error, 4) /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define cxf_NOLEN "\x4F" // must be the first in a cxf-list #define cxf_MSGLEN "\x4E" // must be the first in a cxf-list #define cxf_CONST "\x4D" // must be the only one (except cxf_NOLEN) #define cxf_STRUCT "\x4C" #define cxf_STRING "\x4B" // could only be the last one #define cxf_PACKET "\x4A" // could only be the last one #define cxf_ARRAY "\x49" // Data is a c_word Number followed by a CCStruct ** #define cxf_MULTIPLY "\x48" // Data is a c_word Number followed by the CCStruct *, which is multiplied Number times #define cxf_INFO "\x47" #define cxf_REJECT "\x46" #define cxf_CIPVAL "\x45" #define cxf_B1PROT "\x44" #define cxf_B2PROT "\x43" #define cxf_B3PROT "\x42" #define cxf_FACIL "\x41" #define cxf_SUPSRV "\x40" #define cxf_Z_06 "\x3F" // write some 0 in Buffer #define cxf_Z_05 "\x3E" #define cxf_Z_04 "\x3D" #define cxf_Z_03 "\x3C" #define cxf_Z_02 "\x3B" #define cxf_Z_01 "\x3A" #define cxf_Z_STRUCT "\x39" #define cxf_I_12 "\x38" // ignore x-Bytes of Data #define cxf_I_10 "\x37" #define cxf_I_0E "\x36" #define cxf_I_0C "\x35" #define cxf_I_04 "\x34" #define cxf_I_03 "\x33" #define cxf_I_02 "\x32" #define cxf_01 "\x01" #define cxf_02 "\x02" #define cxf_03 "\x03" #define cxf_04 "\x04" #define cxf_05 "\x05" #define cxf_06 "\x06" #define cxf_07 "\x07" #define cxf_08 "\x08" #define cxf_09 "\x09" #define cxf_0A "\x0A" #define cxf_0B "\x0B" #define cxf_0C "\x0C" #define cxf_0D "\x0D" #define cxf_0E "\x0E" #define cxf_0F "\x0F" #define cxf_10 "\x10" #define cxf_11 "\x11" #define cxf_12 "\x12" #define cxf_28 "\x28" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ enum tCapiStructType { cxt_RawData, cxt_StructData, // default type for CCStruct childs cxt_Message, cxt_ConnectReq, cxt_ConnectInd, cxt_ConnectActiveInd, cxt_ConnectResp, cxt_ConnectB3Resp, cxt_DataB3, cxt_DataB3Conf, cxt_DataB3Resp, cxt_DisconnectB3Ind, cxt_FacilityReq, cxt_FacilityConf, cxt_FacilityInd, cxt_FacilityResp, cxt_InfoReq, cxt_InfoInd, cxt_ListenReq, cxt_Manufacturer, cxt_BProtocol, cxt_B1Config, cxt_B2Config, cxt_B3Config, cxt_AdditionalInfo, cxt_Ncpi, cxt_CalledPartyNumber, cxt_CallingPartyNumber, cxt_FacilityParam, cxt_FacilityParam_SupplServ, cxt_FacilityReq_DTMF, cxt_FacilityReq_DTMFDigits, cxt_FacilityReq_WakeUp, cxt_FacilityReq_WakeUpParam, cxt_FacilityConf_DTMF, cxt_FacilityConf_WakeUp }; /*===========================================================================*\ \*===========================================================================*/ class CCStruct { public: CCStruct (tCapiStructType datatype = cxt_RawData); CCStruct (const void *data, tUInt len, tCapiStructType datatype = cxt_RawData); virtual ~CCStruct (void); void Reset (void); /*=======================================================================*\ CalcStructSize must always be called before FillBuffer CalcStructSize returns the needed size of the Buffer! \*=======================================================================*/ tUInt CalcStructSize (void); void ResetStructSize (tBool recursive = vTrue); void FillBuffer (tUByte *pBuffer); void FillBuffer (tUByte **ppBuffer); tSInfo ParseStruct (CCStruct *pStruct); tSInfo ParseMessage (c_message Message); tSInfo ParseBuffer (tUByte *pBuffer, tUInt len = 0); tSInfo ParseBuffer (tUByte **ppBuffer, tUInt *pLen); tBool ResizeAndSet (tUInt len, tBool ResizeOnlyIfNeeded); tUByte *GetData (void); tUInt GetLen (void); tCapiStructType GetDataType (void); tCapiStructType GetClassType (void); protected: CCStruct (void *data, tFormatChar *format); CCStruct (tCapiStructType type, void *data, tUInt len, tFormatChar *format = cxf_CONST); CCStruct (tCapiStructType type, void *data, tFormatChar *format); private: void FillData (tUByte **ppBuffer); tSInfo ParseData (tUByte **ppBuffer, tUInt Len); tBool Resize (tUInt maxlen); tCapiStructType m_ClassType; tCapiStructType m_DataType; tFormatChar *m_Format; tUInt m_Len; tUInt m_MaxLen; tUByte *m_pData; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class CCStructStore : public CCStruct { public: CCStructStore (tCapiStructType datatype = cxt_RawData) : CCStruct ("", 0, datatype) {} }; /*===========================================================================*\ Inline Functions \*===========================================================================*/ inline CCStruct::CCStruct (tCapiStructType datatype) : m_ClassType (cxt_RawData), m_DataType (datatype), m_Format (cxf_CONST), m_Len (0), m_MaxLen (0), m_pData (0) { } inline CCStruct::CCStruct (const void *data, tUInt len, tCapiStructType datatype) : m_ClassType (cxt_RawData), m_DataType (datatype), m_Format (cxf_CONST), m_Len (len), m_MaxLen (0), m_pData ((tUByte *)data) { } inline CCStruct::CCStruct (void *data, tFormatChar *format) : m_ClassType (cxt_StructData), m_DataType (cxt_StructData), m_Format (format), m_Len (0), m_MaxLen (0), m_pData ((tUByte *)data) { } inline CCStruct::CCStruct (tCapiStructType type, void *data, tUInt len, tFormatChar *format) : m_ClassType (type), m_DataType (type), m_Format (format), m_Len (len), m_MaxLen (0), m_pData ((tUByte *)data) { // dassert (type != cxt_RawData); } inline CCStruct::CCStruct (tCapiStructType type, void *data, tFormatChar *format) : m_ClassType (type), m_DataType (type), m_Format (format), m_Len (0), m_MaxLen (0), m_pData ((tUByte *)data) { // dassert (type != cxt_RawData); } inline void CCStruct::FillBuffer (tUByte *pBuffer) { FillBuffer (&pBuffer); } inline tSInfo CCStruct::ParseMessage (c_message Message) { // dassert (Message != 0); // dassert (get16 (Message) > 12); return ParseBuffer (Message + 12, get16 (Message) - 12); } inline tSInfo CCStruct::ParseBuffer (tUByte *pBuffer, tUInt len) { return ParseBuffer (&pBuffer, &len); } inline tBool CCStruct::ResizeAndSet (tUInt len, tBool ResizeOnlyIfNeeded) { // dassert (m_ClassType == cxt_RawData); if ( ( (len > m_MaxLen) || (ResizeOnlyIfNeeded == vFalse)) && (Resize (len) == vFalse)) { m_Len = 0; return vFalse; } s_memzero (m_pData, len); m_Len = len; return vTrue; } inline tUByte *CCStruct::GetData (void) { // dassert (type == cxt_RawData); return m_pData; } inline tUInt CCStruct::GetLen (void) { // dassert (type == cxt_RawData); return m_Len; } inline tCapiStructType CCStruct::GetDataType (void) { return m_DataType; } inline tCapiStructType CCStruct::GetClassType (void) { return m_ClassType; } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/capi/Makefile.in0000644000175000017500000003602710470310075017364 0ustar mastermaster# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/capi DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru libcapi_a_AR = $(AR) $(ARFLAGS) libcapi_a_LIBADD = am_libcapi_a_OBJECTS = CapiChan.$(OBJEXT) CapiLay.$(OBJEXT) \ CapiMsg.$(OBJEXT) CapiStat.$(OBJEXT) CCStruct.$(OBJEXT) \ Channel.$(OBJEXT) DataHand.$(OBJEXT) DCMTrace.$(OBJEXT) \ Facility.$(OBJEXT) MSNList.$(OBJEXT) PLCIList.$(OBJEXT) libcapi_a_OBJECTS = $(am_libcapi_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) depcomp = $(SHELL) $(top_srcdir)/src/scripts/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libcapi_a_SOURCES) DIST_SOURCES = $(libcapi_a_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) INSTALL = @INSTALL@ ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ hylafaxbindir = @hylafaxbindir@ hylafaxspooldir = @hylafaxspooldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign CLEANFILES = *~ comperr MAINTAINERCLEANFILES = Makefile.in INCLUDES = -I$(srcdir)/../standard noinst_HEADERS = c2msgdef.h \ capi2def.h \ CapiBase.h \ CapiChan.h \ CapiLay.h \ CapiMsg.h \ CapiStat.h \ CCSFacil.h \ CCSMesg.h \ CCSParam.h \ CCStruct.h \ Channel.h \ DataHand.h \ DCMTrace.h \ dbgCAPI.h \ Facility.h \ MSNList.h \ PLCIList.h noinst_LIBRARIES = libcapi.a libcapi_a_SOURCES = CapiChan.cpp \ CapiLay.cpp \ CapiMsg.cpp \ CapiStat.cpp \ CCStruct.cpp \ Channel.cpp \ DataHand.cpp \ DCMTrace.cpp \ Facility.cpp \ MSNList.cpp \ PLCIList.cpp all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/capi/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/capi/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libcapi.a: $(libcapi_a_OBJECTS) $(libcapi_a_DEPENDENCIES) -rm -f libcapi.a $(libcapi_a_AR) libcapi.a $(libcapi_a_OBJECTS) $(libcapi_a_LIBADD) $(RANLIB) libcapi.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CCStruct.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CapiChan.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CapiLay.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CapiMsg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CapiStat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Channel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DCMTrace.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DataHand.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Facility.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MSNList.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PLCIList.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLIBRARIES ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: capi4hylafax-svn/src/capi/Facility.cpp0000644000175000017500000004702510470310075017567 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "Facility.h" #include "aString.h" #include "dbgCAPI.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define MAX_CALL_IDENTITY_LEN 100 // < 250 !!! /*===========================================================================*\ \*===========================================================================*/ void CCAPI20_Facility::fReq_DTMF (c_dtmffunction Function, c_word ToneDuration, c_word GapDuration, CDynamicString *pDTMFDigits, CCStruct *pDTMFCharacteristics) { dhead ("CCAPI20_Facility::fReq_DTMF", DCON_CCAPI20_Facility); // generate cm_facility struct cp_facilityreq_dtmf fdtmf ((c_word)Function, ToneDuration, GapDuration, pDTMFDigits, pDTMFCharacteristics); cm_facilityreq cpfac (facilselect_DTMF, &fdtmf); c_dword localNCCI = GetNCCI(); if (GetState() != cs_Connected) { fConf_DTMF (ci_Int_NotConnected); return; } dassert (localNCCI != IllegalNCCI); FACILITY_REQ (GetNextMsgNr(), localNCCI, &cpfac); } /*===========================================================================*\ \*===========================================================================*/ void CCAPI20_Facility::fReq_PMWakeup (c_dword Controller, c_word NumberRequested, cp_facilityreq_wakeupparam *NumberList) { dhead ("CCAPI20_Facility::fReq_PMWakeup", DCON_CCAPI20_Facility); dassert ((NumberRequested == 0) || (NumberList != 0)); // calculate needed size and allocate it cm_facilityreq cpfac (facilselect_PMWakeup); if (!NumberRequested) { // empty struct CCStruct frWakeUp ( "\x00\x00\x00", 3); cpfac.pFacilityParam = &frWakeUp; FACILITY_REQ (GetNextMsgNr(), Controller, &cpfac); } else { cp_facilityreq_wakeup frWakeUp (NumberRequested, NumberList); cpfac.pFacilityParam = &frWakeUp; } } /*===========================================================================*\ \*===========================================================================*/ #ifdef USE_SUPPLEMENTARY_SERVICES void CCAPI20_Facility::fReq_Listen (c_dword Controller, c_dword NotificationMask) { dhead ("CCAPI20_Facility::fReq_Listen", DCON_CCAPI20_Facility); cp_content_dword fparam (NotificationMask); CallSupplServFacilityReq (Controller, supplserv_Listen, &fparam); } /*===========================================================================*\ \*===========================================================================*/ void CCAPI20_Facility::fReq_Hold (void) { dhead ("CCAPI20_Facility::fReq_Hold", DCON_CCAPI20_Facility); if (SetState (cs_HoldPending, cs_D_Connected) == vTrue) { CallSupplServFacilityReq (GetPLCI(), supplserv_Hold, 0); } else { dwarning (0); fInd_Hold (ci_Int_IllegalState); } } /*===========================================================================*\ \*===========================================================================*/ void CCAPI20_Facility::fReq_Retrieve (void) { dhead ("CCAPI20_Facility::fReq_Retrieve", DCON_CCAPI20_Facility); if (SetState (cs_RetrievePending, cs_Holded) == vTrue) { CallSupplServFacilityReq (GetPLCI(), supplserv_Retrieve, 0); } else { dwarning (0); fInd_Retrieve (ci_Int_IllegalState); } } /*===========================================================================*\ \*===========================================================================*/ void CCAPI20_Facility::fReq_Suspend (CDynamicString *pCallIdentity) { dhead ("CCAPI20_Facility::fReq_Suspend", DCON_CCAPI20_Facility); dassert (pCallIdentity != 0); if (SetState (cs_SuspendPending, cs_D_Connected) == vTrue) { cp_content_string fparam (pCallIdentity); CallSupplServFacilityReq (GetPLCI(), supplserv_Suspend, &fparam); } else { dwarning (0); fInd_Suspend (ci_Int_IllegalState); } } /*===========================================================================*\ \*===========================================================================*/ void CCAPI20_Facility::fReq_Resume (c_dword Controller, CDynamicString *pCallIdentity) { dhead ("CCAPI20_Facility::fReq_Resume", DCON_CCAPI20_Facility); dassert (pCallIdentity != 0); if (SetState (cs_ResumePending, cs_Registered) == vTrue) { cp_content_string fparam (pCallIdentity); CallSupplServFacilityReq (Controller, supplserv_Resume, &fparam); } else { dwarning (0); fInd_Resume (ci_Int_IllegalState); } } /*===========================================================================*\ \*===========================================================================*/ void CCAPI20_Facility::fReq_ECT (CCAPI20_Channel * /*pChannel*/) { dhead ("CCAPI20_Facility::fReq_ECT", DCON_CCAPI20_Facility); //dassert (pChannel != 0); dwarning (GetState() == cs_Holded); cp_content_dword fparam (GetPLCI()); CallSupplServFacilityReq (GetPLCI(), supplserv_ECT, &fparam); } /*===========================================================================*\ \*===========================================================================*/ void CCAPI20_Facility::fReq_3PTY_Begin (CCAPI20_Channel * /*pChannel*/) { dhead ("CCAPI20_Facility::fReq_3PTY_Begin", DCON_CCAPI20_Facility); //dassert (pChannel != 0); dwarning (GetState() == cs_Holded); cp_content_dword fparam (GetPLCI()); CallSupplServFacilityReq (GetPLCI(), supplserv_3PTY_Begin, &fparam); } /*===========================================================================*\ \*===========================================================================*/ void CCAPI20_Facility::fReq_3PTY_End (CCAPI20_Channel * /*pChannel*/) { dhead ("CCAPI20_Facility::fReq_3PTY_End", DCON_CCAPI20_Facility); //dassert (pChannel != 0); dwarning (GetState() == cs_Holded); cp_content_dword fparam (GetPLCI()); CallSupplServFacilityReq (GetPLCI(), supplserv_3PTY_End, &fparam); } /*===========================================================================*\ \*===========================================================================*/ void CCAPI20_Facility::fReq_CD (tBool PresentationAllowed, CDynamicString *pDeflectToNumber) { dhead ("CCAPI20_Facility::fReq_CD", DCON_CCAPI20_Facility); if (SetState (cs_CallDeflecting, cs_D_ConnectIndication) == vTrue) { cp_supplserv_cdreq sscd ((PresentationAllowed == vTrue) ? (c_word)1 : (c_word)0, pDeflectToNumber); CallSupplServFacilityReq (GetPLCI(), supplserv_CD, &sscd); } else { dwarning (0); fInd_CD (ci_Int_IllegalState); } } /*===========================================================================*\ \*===========================================================================*/ void CCAPI20_Facility::fReq_MCID (void) { dhead ("CCAPI20_Facility::fReq_MCID", DCON_CCAPI20_Facility); CallSupplServFacilityReq (GetPLCI(), supplserv_MCID, 0); } /*===========================================================================*\ \*===========================================================================*/ tBool CCAPI20_Facility::HandleSupplServicesInd (c_dword Address, c_supplserv Function, CCStruct *pParams) { dhead ("CCAPI20_Facility::HandleSupplServicesInd", DCON_CCAPI20_Facility); dparams ("%x,%x", Address, Function); dassert (pParams != 0); if (Address != GetPLCI()) { if (Address > CAPI_MAX_CONTROLLER_NUMBER) { // Address must be a PLCI or NCCI => This Address is definitly not for this class RETURN ('x', vFalse); } } { // TODO: für forwarding, CCBS ist das hier zu allgemeingültig! cp_facility_supplserv supplserv (Function); cm_facilityresp fresp (facilselect_SupplServices, &supplserv); FACILITY_RESP (GetNextMsgNr(), Address, &fresp); } c_info Info = ci_NoError; if (pParams->GetLen() >= sizeof (c_word)) { Info = (c_info)get16 (pParams->GetData()); dprint ("Info=%x ", Info); } switch (Function) { case supplserv_Hold: if (CapiInfoIsSuccess (Info)) { if (SetState (cs_Holded, cs_HoldPending) == vTrue) { dassert (GetNCCI() == IllegalNCCI); fInd_Hold (Info); } } else if (SetState (cs_D_Connected, cs_HoldPending) == vTrue) { dassert (GetNCCI() == IllegalNCCI); ConnectB3Req(); fInd_Hold (Info); } break; case supplserv_Retrieve: if (CapiInfoIsSuccess (Info)) { dassert (GetNCCI() == IllegalNCCI); if (SetState (cs_D_Connected, cs_RetrievePending) == vTrue) { ConnectB3Req(); fInd_Retrieve (Info); } } else if (SetState (cs_Holded, cs_RetrievePending) == vTrue) { dassert (GetNCCI() == IllegalNCCI); fInd_Retrieve (Info); } break; case supplserv_Suspend: if (CapiInfoIsSuccess (Info)) { if (SetState (cs_D_DisconnectPending, cs_SuspendPending) == vTrue) { fInd_Suspend (Info); } } else if (SetState (cs_D_Connected, cs_SuspendPending) == vTrue) { ConnectB3Req(); fInd_Suspend (Info); } break; case supplserv_Resume: if (CapiInfoIsSuccess (Info)) { if (SetState(cs_D_Connected, cs_ResumePending) == vTrue) { fInd_Resume (Info); if (GetState() == cs_D_Connected) { ConnectB3Req(); } } } else { DisconnectReq(); fInd_Resume (Info); } break; case supplserv_ECT: if (GetState() == cs_Holded) { fInd_ECT (Info); } break; case supplserv_3PTY_Begin: if (GetState() == cs_Holded) { fInd_3PTY_Begin (Info); } break; case supplserv_3PTY_End: if (GetState() >= cs_D_Connected) { fInd_3PTY_End (Info); } break; case supplserv_CD: if (SetState ((CapiInfoIsError (Info) == vTrue) ? cs_D_ConnectIndication : cs_D_DisconnectPending, cs_CallDeflecting) == vTrue) { fInd_CD (Info); } break; case supplserv_MCID: fInd_MCID (Info); break; //case supplserv_CCBS_Request: //case supplserv_CCBS_Deactivate: //case supplserv_CCBS_Interrogate: //case supplserv_CCBS_Call: // dassert (pParams->GetLen) >= sizeof (c_dword); // fInd_CCBS_Call (*(c_word *)pParams->GetData()); // break; case supplserv_Hold_Notify: fInd_Hold_Notify(); break; case supplserv_Retrieve_Notify: fInd_Retrieve_Notify(); break; case supplserv_Suspend_Notify: fInd_Suspend_Notify(); break; case supplserv_Resume_Notify: fInd_Resume_Notify(); break; case supplserv_CallIsDiverting_Notify: fInd_CallIsDiverting_Notify(); break; //case supplserv_DiversionActive_Notify: // fInd_DiversionActive_Notify(); // break; case supplserv_ConferenceEstablished: fInd_ConferenceEstablished(); break; case supplserv_ConferenceDisconnected: fInd_ConferenceDisconnected(); break; //case supplserv_CCBS_EraseCallLinkID: //case supplserv_CCBS_Status: //case supplserv_CCBS_RemoteUserFree: //case supplserv_CCBS_B_Free: //case supplserv_CCBS_Erase: //case supplserv_CCBS_StopAlerting: //case supplserv_CCBS_InfoRetain: default: dprintWrn ("Unhandled SupplServInd(%x,a=%x) ", Function, Address); break; } RETURN ('x', vTrue); } #endif // #ifdef USE_SUPPLEMENTARY_SERVICES /*===========================================================================*\ \*===========================================================================*/ void CCAPI20_Facility::FACILITY_CONF (c_word, c_dword Address, cm_facilityconf *Params) { dhead ("CCAPI20_Facility::FACILITY_CONF", DCON_CCAPI20_Facility); dprint ("%x", Params->FacilitySelector); dassert (Params != 0); dassert (Params->pFacilityParam != 0); dassert (sizeof (void *) == sizeof (c_dword)); // see fReq_Activate/_Deactivate switch (Params->FacilitySelector) { case facilselect_DTMF: { c_info di = Params->Info; dwarning (Params->pFacilityParam->GetLen() >= sizeof (c_word)); if ( (CapiInfoIsSuccess (di) == vTrue) && (Params->pFacilityParam->GetLen() >= sizeof (c_word))) { switch (get16 (Params->pFacilityParam->GetData())) { case 0: // nothing to do break; case 1: di = ci_Int_IncorrectDTMFDigit; break; default: dassert (0); // no Break! case 2: di = ci_Int_UnknownDTMFRequest; break; } } fConf_DTMF (di); break; } #ifdef USE_SUPPLEMENTARY_SERVICES case facilselect_SupplServices: { cp_facility_supplserv_ref fss; if (infoSuccess (fss.ParseStruct (Params->pFacilityParam))) { dassert (fss.pParameter != 0); c_info Info = (fss.pParameter->GetLen() >= sizeof (c_word)) ? (c_info)get16 (fss.pParameter->GetData()) : Params->Info; dprint ("SupplServ=%x,Info=%x ", fss.Function, Info); if (CapiInfoIsSuccess (Info) == vTrue) { if (fss.Function == supplserv_Resume) { SetPLCI (Address); } } else { // error handling switch (fss.Function) { case supplserv_Listen: fConf_Listen (Info); break; case supplserv_Hold: dassert (GetPLCI() == Address); dassert (GetState() == cs_HoldPending); if (SetState (cs_D_Connected, cs_HoldPending) == vTrue) { ConnectB3Req(); fInd_Hold (Info); } break; case supplserv_Retrieve: dassert (GetPLCI() == Address); dassert (GetState() == cs_RetrievePending); if (SetState (cs_Holded, cs_RetrievePending) == vTrue) { fInd_Retrieve (Info); } break; case supplserv_Suspend: dassert (GetPLCI() == Address); dassert (GetState() == cs_SuspendPending); if (SetState (cs_D_Connected, cs_SuspendPending) == vTrue) { ConnectB3Req(); fInd_Suspend (Info); } break; case supplserv_Resume: dassert (Address != IllegalPLCI); if (SetState (cs_Registered, cs_ResumePending) == vTrue) { fInd_Resume (Info); } break; case supplserv_ECT: fInd_ECT (Info); break; case supplserv_3PTY_Begin: fInd_3PTY_Begin (Info); break; case supplserv_3PTY_End: fInd_3PTY_End (Info); break; case supplserv_CD: dassert (GetPLCI() == Address); dassert (GetState() == cs_CallDeflecting); if (SetState (cs_D_ConnectIndication, cs_CallDeflecting) == vTrue) { fInd_CD (Info); } break; case supplserv_MCID: fInd_MCID (Info); break; case supplserv_CCBS_Request: //fInd_CCBS_Request (Info); break; case supplserv_CCBS_Deactivate: //fInd_CCBS_Deactivate (Info); break; case supplserv_CCBS_Interrogate: //fInd_CCBS_Interrogate (Info); break; case supplserv_CCBS_Call: //fInd_CCBS_Call (Info); break; default: dprintErr ("Illegal SupplServ=%x ", fss.Function); dassert (0); break; } } } else { dassert (0); } break; } #endif // #ifdef USE_SUPPLEMENTARY_SERVICES case facilselect_PMWakeup: dprint ("FP=%x ", Params->pFacilityParam); dassert ( (CapiInfoIsSuccess (Params->Info) == vFalse) || (Params->pFacilityParam->GetLen() >= sizeof (c_word))); fConf_PMWakeup (Address, Params->Info, ( (CapiInfoIsSuccess (Params->Info) == vTrue) && (Params->pFacilityParam->GetLen() >= sizeof (c_word))) ? get16 (Params->pFacilityParam->GetData()) : (tUShort)0); break; default: dwarning (0); break; } } /*===========================================================================*\ \*===========================================================================*/ tBool CCAPI20_Facility::FACILITY_IND (c_word, c_dword Address, cm_facilityind *Params) { dhead ("CCAPI20_Facility::FACILITY_IND", DCON_CCAPI20_Facility); dassert (Params != 0); dassert (Params->pFacilityParam != 0); dassert (sizeof (void *) == sizeof (c_dword)); // see fReq_Activate/_Deactivate tBool fret = vFalse; switch (Params->FacilitySelector) { case facilselect_DTMF: if ((Address == GetPLCI()) && (Params->pFacilityParam->GetLen() > 0)) { cm_facilityresp fresp (facilselect_DTMF, 0); FACILITY_RESP (GetNextMsgNr(), Address, &fresp); fInd_DTMF (Params->pFacilityParam); fret = vTrue; } break; #ifdef USE_SUPPLEMENTARY_SERVICES case facilselect_SupplServices: { cp_facility_supplserv_ref fss; fret = infoSuccess (fss.ParseStruct (Params->pFacilityParam)); if (fret == vTrue) { fret = HandleSupplServicesInd (Address, fss.Function, fss.pParameter); } break; } #endif default: // illegal Selector dwarning (0); // no break! case facilselect_Handset: case facilselect_V42Compression: // not supported now break; } RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/capi/WaitStat.h0000644000175000017500000000465510470310075017232 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _WAITSTAT_H_ #define _WAITSTAT_H_ #include "CapiStat.h" #include "Eventing.h" /*===========================================================================*\ \*===========================================================================*/ class CCAPI20_WaitStatistic : public CCAPI20_Statistic { public: CCAPI20_WaitStatistic (ctStatDeep statdeep = StatDeep_CntrlFacilities); virtual ~CCAPI20_WaitStatistic (void); void FreshUp (tUInt maxWaitTime = 0); // in ms private: void FreshUpComplete (c_info Info); thEvent m_hEvent; }; /*===========================================================================*\ CCAPI20_WaitStatistic - inline functions \*===========================================================================*/ inline CCAPI20_WaitStatistic::CCAPI20_WaitStatistic (ctStatDeep statdeep) : CCAPI20_Statistic (statdeep), m_hEvent (vIllegalHandle) { Event_Create (&m_hEvent); } inline CCAPI20_WaitStatistic::~CCAPI20_WaitStatistic (void) { Event_Destroy (&m_hEvent); } inline void CCAPI20_WaitStatistic::FreshUp (tUInt maxWaitTime) { CCAPI20_Statistic::FreshUp(); if ( (Event_Wait (m_hEvent, maxWaitTime) == vFalse) && (FreshUpInUse() == vTrue)) { FreshUpCancel(); // TODO: Wait infinite is probably not so good? Event_Wait (m_hEvent, 0); } } inline void CCAPI20_WaitStatistic::FreshUpComplete (c_info) { Event_Set (m_hEvent); } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/capi/CapiChan.cpp0000644000175000017500000006462510470310075017476 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "CapiChan.h" #include "dbgCAPI.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define TIMER_FOR_RINGING 1 #define TIMER_FOR_BCHANNEL 2 #define TIMER_FOR_DISCONNECT 3 #define TIMER_BCHANNEL_WAITTIME 90 // sec #define TIMER_DISCONNECT_WAITTIME 20 // sec static void StateChangeTimer_CallBack (void *pCapiChannel, void *kind) { dhead ("StateChangeTimer_CallBack", DCON_CCAPI20_Channel); dparams ("%x", kind); dassert (pCapiChannel != 0); CCAPI20_Channel *pChan = (CCAPI20_Channel *)pCapiChannel; switch (pChan->GetState()) { case cs_B_ConnectPending: case cs_D_Connected: if ((tULong)kind == TIMER_FOR_RINGING) { dwarning (0); // this kind of timer should be cancelled before break; } // no break! case cs_D_ConnectPending: case cs_D_ConnectRequest: pChan->DisconnectReq(); break; case cs_D_DisconnectPending: dwarning (0); pChan->Release(); break; default: // in this states the timer should have been canceled before dwarning (0); break; } } /*===========================================================================*\ CCAPI20_Channel Konstruktor \*===========================================================================*/ CCAPI20_Channel::CCAPI20_Channel (void) : hStateChangeTimer (vIllegalHandle), curState (cs_Released), RingingTimeout (0) { dhead ("CCAPI20_Channel-Constructor", DCON_CCAPI20_Channel); m_Protect.Init(); SetController (IllegalController); SetPLCI (IllegalPLCI); SetNCCI (IllegalNCCI); SetInitiator (vFalse); SecTimer_Create (&hStateChangeTimer); } /*===========================================================================*\ CCAPI20_Channel Destruktor \*===========================================================================*/ CCAPI20_Channel::~CCAPI20_Channel (void) { dhead ("CCAPI20_Channel-Destructor", DCON_CCAPI20_Channel); dassert (GetState() == cs_Released); dassert (GetPLCI() == IllegalPLCI); dassert (GetNCCI() == IllegalNCCI); dwarning (GetInitiator() == vFalse); SetNCPI (0); if (hStateChangeTimer != vIllegalHandle) { SecTimer_Destroy (&hStateChangeTimer); } } /*===========================================================================*\ CCAPI20_Channel::SetNCPI \*===========================================================================*/ void CCAPI20_Channel::SetNCPI (CCStruct *pNCPI) { dhead ("CCAPI20_Channel::SetNCPI", DCON_CCAPI20_Channel); m_NCPIout.ParseStruct (pNCPI); } /*===========================================================================*\ CCAPI20_Channel::AcceptIncomingCall \*===========================================================================*/ tBool CCAPI20_Channel::AcceptIncomingCall (void) { dhead ("CCAPI20_Channel::AcceptIncomingCall", DCON_CCAPI20_Channel); dwarning (GetState() == cs_D_ConnectIndication); if (GetState() != cs_D_ConnectIndication) { RETURN ('x', vFalse); } dassert (GetPLCI() != IllegalPLCI); if (SetNewPLCIEntry (GetPLCI()) == vTrue) { RETURN ('x', vTrue); } DisconnectReq(); //if (SetState (cs_D_DisconnectPending, cs_D_ConnectIndication) == vTrue) { // dassert (hStateChangeTimer != vIllegalHandle); // SecTimer_Call (hStateChangeTimer, TIMER_DISCONNECT_WAITTIME, StateChangeTimer_CallBack, // this, (void *)TIMER_FOR_DISCONNECT); // cm_connectresp crIgnore; // CONNECT_RESP (GetNextMsgNr(), GetPLCI(), &crIgnore); //} RETURN ('x', vFalse); } /*===========================================================================*\ CCAPI20_Channel::Register \*===========================================================================*/ void CCAPI20_Channel::Register (tUInt MaxDataSize, tUInt MaxInFrames) { dhead ("CCAPI20_Channel::Register", DCON_CCAPI20_Channel); dparams ("t=%x", this); dassert (GetState() == cs_Released); dassert (MaxDataSize <= CAPI_MAX_DATA_SIZE); dwarning (MaxDataSize > 100); if ( (m_Protect.Init() == vFalse) || ( (hStateChangeTimer == vIllegalHandle) && (SecTimer_Create (&hStateChangeTimer) == vFalse))) { Register_Complete (ci_Int_TimerInitFailure); } else if (SetState (cs_Registering, cs_Released) == vTrue) { REGISTER (1, MaxInFrames, MaxDataSize); } else { dwarning (0); } } /*===========================================================================*\ CCAPI20_Channel::Release \*===========================================================================*/ void CCAPI20_Channel::Release (void) { dhead ("CCAPI20_Channel::Release", DCON_CCAPI20_Channel); dassert (GetState() > cs_Released); dassert (GetState() < cs_D_DisconnectPending); m_Protect.BeginWrite(); switch (GetState()) { case cs_Released: dwarning (0); m_Protect.EndWrite(); Release_Complete(); break; case cs_Releasing: // nothing to do! m_Protect.EndWrite(); break; case cs_Registering: curState = cs_Releasing; m_Protect.EndWrite(); ResetValues(); break; default: dwarning (0); // no break; case cs_Registered: case cs_RegisterDelayed: curState = cs_Releasing; m_Protect.EndWrite(); ResetValues(); RELEASE(); } } /*===========================================================================*\ CCAPI20_Channel::ConnectReq \*===========================================================================*/ tBool CCAPI20_Channel::ConnectReq (c_dword Controller, cm_connectreq *Params) { dhead ("CCAPI20_Channel::ConnectReq", DCON_CCAPI20_Channel); dassert (Params != 0); if (SetState (cs_D_ConnectRequest, cs_Registered) == vFalse) { RETURN ('x', vFalse); } dassert (GetController() == IllegalController); SetController (Controller); SetInitiator (vTrue); CONNECT_REQ (GetNextMsgNr(), Controller, Params); RETURN ('x', vTrue); } /*===========================================================================*\ CCAPI20_Channel::DataB3Req \*===========================================================================*/ void CCAPI20_Channel::DataB3Req (cm_datab3 *Params) { dhead ("CCAPI20_Channel::DataB3Req", DCON_CCAPI20_Channel); dassert (Params != 0); dwarning (GetState() == cs_Connected); if (GetState() == cs_Connected) { dassert (GetNCCI() != IllegalNCCI); DATA_B3_REQ (GetNextMsgNr(), GetNCCI(), Params); } else { cm_datab3conf cp (Params->DataHandle, ci_Int_NotConnected); DataB3Conf (&cp); } } /*===========================================================================*\ CCAPI20_Channel::DisconnectReq \*===========================================================================*/ void CCAPI20_Channel::DisconnectReq (tBool FastDisconnect) { dhead ("CCAPI20_Channel::DisconnectReq", DCON_CCAPI20_Channel); dwarning (GetState() >= cs_Registered); m_Protect.BeginWrite(); switch (GetState()) { case cs_D_ConnectRequest: curState = cs_D_DisconnectPending; dassert (hStateChangeTimer != vIllegalHandle); m_Protect.EndWrite(); SecTimer_Call (hStateChangeTimer, TIMER_DISCONNECT_WAITTIME, StateChangeTimer_CallBack, this, (void *)TIMER_FOR_DISCONNECT); break; case cs_D_ConnectIndication: { curState = cs_D_DisconnectPending; m_Protect.EndWrite(); SecTimer_Call (hStateChangeTimer, TIMER_DISCONNECT_WAITTIME, StateChangeTimer_CallBack, this, (void *)TIMER_FOR_DISCONNECT); cm_connectresp crIgnore; CONNECT_RESP (GetNextMsgNr(), GetPLCI(), &crIgnore); break; } case cs_D_DisconnectRespPending: case cs_D_DisconnectPending: /*----- Do Nothing!! -----*/ m_Protect.EndWrite(); break; case cs_B_DisconnectRespPending: case cs_B_DisconnectPending: if (FastDisconnect == vFalse) { m_Protect.EndWrite(); break; } // no break; -> Okay we make a second test for FastDisconnect before calling DISCONNECT_REQ, // but that doesn't matter case cs_B_ConnectPending: case cs_Connected: if (FastDisconnect == vFalse) { dassert (GetNCCI() != IllegalNCCI); curState = cs_B_DisconnectPending; m_Protect.EndWrite(); DISCONNECT_B3_REQ (GetNextMsgNr(), GetNCCI(), &m_NCPIout); break; } // no break! default: dassert (GetPLCI() != IllegalPLCI); dwarning (GetNCCI() == IllegalNCCI); curState = cs_D_DisconnectPending; dassert (hStateChangeTimer != vIllegalHandle); m_Protect.EndWrite(); SecTimer_Call (hStateChangeTimer, TIMER_DISCONNECT_WAITTIME, StateChangeTimer_CallBack, this, (void *)TIMER_FOR_DISCONNECT); DISCONNECT_REQ (GetNextMsgNr(), GetPLCI()); break; case cs_Released: case cs_Releasing: case cs_Registering: case cs_RegisterDelayed: dwarning (0); // DisconnectReq should not been called in this states! // no break! case cs_Registered: m_Protect.EndWrite(); DisconnectInd (ci_NoError); break; } } /*===========================================================================*\ CCAPI20_Channel::ConnectResp \*===========================================================================*/ void CCAPI20_Channel::ConnectResp (cm_connectresp *Params) { dhead ("CCAPI20_Channel::ConnectResp", DCON_CCAPI20_Channel); dassert (Params != 0); dwarning (GetState() == cs_D_ConnectIndication); dassert (GetInitiator() == vFalse); dassert (GetPLCI() != IllegalPLCI); // TODO!!: for DDI this handling isn't correct!!!!!!! if (Params->Reject == creject_Accept) { if (SetState (cs_D_ConnectPending, cs_D_ConnectIndication) == vTrue) { CONNECT_RESP (GetNextMsgNr(), GetPLCI(), Params); } else { dwarning (0); } } else { if (SetState (cs_D_DisconnectPending, cs_D_ConnectIndication) == vTrue) { CONNECT_RESP (GetNextMsgNr(), GetPLCI(), Params); ResetValues(); SetState (cs_Registered, cs_D_DisconnectPending); } else { dwarning (0); } } } /*===========================================================================*\ CCAPI20_Channel::DataB3Resp \*===========================================================================*/ void CCAPI20_Channel::DataB3Resp (c_word DataHandle) { dhead ("CCAPI20_Channel::DataB3Resp", DCON_CCAPI20_Channel); dassert (GetNCCI() != IllegalNCCI); dwarning (GetState() == cs_Connected); if (GetState() == cs_Connected) { // default way cm_datab3resp db3r (DataHandle); DATA_B3_RESP (GetNextMsgNr(), GetNCCI(), &db3r); } } /*===========================================================================*\ CCAPI20_Channel::DisconnectB3Resp \*===========================================================================*/ void CCAPI20_Channel::DisconnectB3Resp (void) { dhead ("CCAPI20_Channel::DisconnectB3Resp", DCON_CCAPI20_Channel); dassert (GetNCCI() != IllegalNCCI); dwarning (GetState() == cs_B_DisconnectRespPending); if (SetState (cs_D_Connected, cs_B_DisconnectRespPending) == vTrue) { DISCONNECT_B3_RESP (GetNextMsgNr(), GetNCCI()); SetNCCI (IllegalNCCI); if (SetState (cs_D_DisconnectPending, cs_D_Connected) == vTrue) { dassert (hStateChangeTimer != vIllegalHandle); SecTimer_Call (hStateChangeTimer, TIMER_DISCONNECT_WAITTIME, StateChangeTimer_CallBack, this, (void *)TIMER_FOR_DISCONNECT); DISCONNECT_REQ (GetNextMsgNr(), GetPLCI()); } } else if (SetState (cs_Registered, cs_D_DisconnectRespPending) == vTrue) { dwarning (0); SecTimer_Cancel (hStateChangeTimer); DISCONNECT_B3_RESP (GetNextMsgNr(), GetNCCI()); SetNCCI (IllegalNCCI); DISCONNECT_RESP (GetNextMsgNr(), GetPLCI()); ResetValues(); DisconnectInd (ci_NoError); } else { dassert (0); } } /*===========================================================================*\ CCAPI20_Channel::REGISTER_COMPLETE \*===========================================================================*/ void CCAPI20_Channel::REGISTER_COMPLETE (c_info ErrorCode) { dhead ("CCAPI20_Channel::REGISTER_COMPLETE", DCON_CCAPI20_Channel); dwarning ((GetState() == cs_Registering) || (GetState() == cs_RegisterDelayed)); dwarning (ErrorCode == ci_NoError); if (GetState() == cs_Releasing) { ResetValues(); if (CapiInfoIsError (ErrorCode) && (ErrorCode != ci_Int_RegisterDelayed)) { Release_Complete(); } else { RELEASE(); } return; } dassert ((GetState() == cs_Registering) || (GetState() == cs_RegisterDelayed)); tCapiState new_cs; switch (ErrorCode) { default: if (CapiInfoIsError (ErrorCode)) { dassert (GetApplID() == IllegalApplID); new_cs = cs_Released; break; } dwarning (0); // no break; case ci_NoError: dassert (GetApplID() != IllegalApplID); new_cs = cs_Registered; break; case ci_Int_RegisterDelayed: dassert (GetApplID() == IllegalApplID); new_cs = cs_RegisterDelayed; break; } dassert ((GetState() == cs_Registering) || (GetState() == cs_RegisterDelayed)); m_Protect.BeginWrite(); curState = new_cs; m_Protect.EndWrite(); dprint ("curstate=%x ", curState); Register_Complete (ErrorCode); } /*===========================================================================*\ CCAPI20_Channel::RELEASE_COMPLETE \*===========================================================================*/ void CCAPI20_Channel::RELEASE_COMPLETE (void) { dhead ("CCAPI20_Channel::RELEASE_COMPLETE", DCON_CCAPI20_Channel); dparams ("%x", GetState()); ResetValues(); dassert (hStateChangeTimer != vIllegalHandle); dinfo ((GetState() == cs_Registered) || (GetState() == cs_Releasing) || (GetState() == cs_RegisterDelayed), "ReleaseComplete, but State=%x ", GetState()); SecTimer_Cancel (hStateChangeTimer); m_Protect.BeginWrite(); tCapiState oldState = curState; curState = cs_Released; m_Protect.EndWrite(); switch (oldState) { case cs_Released: dassert (0); break; case cs_RegisterDelayed: case cs_Releasing: case cs_Registered: case cs_Registering: dwarning (0); break; default: DisconnectInd (ci_NoError); break; } Release_Complete(); } /*===========================================================================*\ CCAPI20_Channel - Conf-Messages \*===========================================================================*/ void CCAPI20_Channel::CONNECT_CONF (c_word, c_dword PLCI, c_info Info) { dhead ("CCAPI20_Channel::CONNECT_CONF", DCON_CCAPI20_Channel); dparams ("s=%x", GetState()); if (CapiInfoIsSuccess (Info)) { if (SetState (cs_D_ConnectPending, cs_D_ConnectRequest) == vTrue) { dassert (GetController() != IllegalController); dassert (GetPLCI() == IllegalPLCI); dassert (GetNCCI() == IllegalNCCI); dassert (GetInitiator() == vTrue); SetPLCI (PLCI); if (RingingTimeout) { dassert (hStateChangeTimer != vIllegalHandle); SecTimer_Call (hStateChangeTimer, RingingTimeout, StateChangeTimer_CallBack, this, (void *)TIMER_FOR_RINGING); } ConnectConf(); } else { dwarning (0); if (GetState() == cs_D_DisconnectPending) { dassert (GetPLCI() == IllegalPLCI); dassert (GetController() != IllegalController); dassert (hStateChangeTimer != vIllegalHandle); SetPLCI (PLCI); SecTimer_Call (hStateChangeTimer, TIMER_DISCONNECT_WAITTIME, StateChangeTimer_CallBack, this, (void *)TIMER_FOR_DISCONNECT); } DISCONNECT_REQ (GetNextMsgNr(), PLCI); } } else { SetController (IllegalController); SetInitiator (vFalse); if (SetState (cs_Registered, cs_D_ConnectRequest) == vFalse) { if (SetState (cs_Registered, cs_D_DisconnectPending) == vFalse) { dassert (0); } } DisconnectInd (Info); } } void CCAPI20_Channel::CONNECT_B3_CONF (c_word, c_dword NCCI, c_info Info) { dhead ("CCAPI20_Channel::CONNECT_B3_CONF", DCON_CCAPI20_Channel); dparams ("s=%x", GetState()); if (CapiInfoIsSuccess (Info)) { if ((GetPLCIFromNCCI (NCCI) == GetPLCI()) && (SetState (cs_B_ConnectPending, cs_D_Connected) == vTrue)) { dassert (GetNCCI() == IllegalNCCI); dassert (GetInitiator() == vFalse); SetNCCI (NCCI); dprint ("curstate=%x, ncci=%x, NCCI=%x ", GetState(), GetNCCI(), NCCI); return; } dwarning (0); } DISCONNECT_REQ (GetNextMsgNr(), GetPLCIFromNCCI (NCCI)); } void CCAPI20_Channel::DATA_B3_CONF (c_word, c_dword NCCI, cm_datab3conf *Params) { dhead ("CCAPI20_Channel::DATA_B3_CONF", DCON_CCAPI20_Channel); dparams ("s=%x", GetState()); dassert (Params != 0); dprint ("Handle=%x Info=%x ", Params->DataHandle, Params->Info); if (NCCI != GetNCCI()) { dwarning (0); DISCONNECT_B3_REQ (GetNextMsgNr(), NCCI, 0); return; } dwarning (GetState() == cs_Connected); DataB3Conf (Params); } void CCAPI20_Channel::DISCONNECT_B3_CONF (c_word, c_dword NCCI, c_info Info) { dhead ("CCAPI20_Channel::DISCONNECT_B3_CONF", DCON_CCAPI20_Channel); dparams ("s=%x", GetState()); if (NCCI == GetNCCI()) { dassert (GetState() == cs_B_DisconnectPending); if (CapiInfoIsSuccess (Info)) { return; } dwarning (0); } else { dwarning (0); } DISCONNECT_REQ (GetNextMsgNr(), GetPLCIFromNCCI (NCCI)); } void CCAPI20_Channel::DISCONNECT_CONF (c_word, c_dword PLCI, c_info Info) { dhead ("CCAPI20_Channel::DISCONNECT_CONF", DCON_CCAPI20_Channel); dparams ("s=%x", GetState()); if (PLCI == GetPLCI()) { if (CapiInfoIsSuccess (Info)) { dassert (GetState() == cs_D_DisconnectPending); } else { dprintErr ("Info=%x ", Info); dassert (hStateChangeTimer != vIllegalHandle); SecTimer_Cancel (hStateChangeTimer); Release(); } } } void CCAPI20_Channel::LISTEN_CONF (c_word, c_dword Controller, c_info Info) { dhead ("CCAPI20_Channel::LISTEN_CONF", DCON_CCAPI20_Channel); ListenConf (Controller, Info); } void CCAPI20_Channel::SELECT_B_PROTOCOL_CONF (c_word, c_dword PLCI, c_info Info) { dhead ("CCAPI20_Channel::SELECT_B_PROTOCOL_CONF", DCON_CCAPI20_Channel); dwarning (PLCI == GetPLCI()); if (PLCI == GetPLCI() && (SetState (cs_ProtocolPending, cs_D_Connected) == vTrue)) { SelectBProtocolConf (Info); if (GetState() == cs_D_Connected) { ConnectB3Req(); } } } void CCAPI20_Channel::MANUFACTURER_CONF (c_word, c_dword Controller, cm_manufacturer *Params) { dhead ("CCAPI20_Channel::MANUFACTURER_CONF", DCON_CCAPI20_Channel); ManufacturerConf (Controller, Params); } /*===========================================================================*\ CCAPI20_Channel - Ind-Messages \*===========================================================================*/ tBool CCAPI20_Channel::CONNECT_IND (c_word, c_dword PLCI, cm_connectind *Params) { dhead ("CCAPI20_Channel::CONNECT_IND", DCON_CCAPI20_Channel); dparams ("s=%x", GetState()); if (SetState (cs_D_ConnectIndication, cs_Registered) == vFalse) { RETURN ('x', vFalse); } dassert (GetController() == IllegalController); dassert (GetPLCI() == IllegalPLCI); dassert (GetNCCI() == IllegalNCCI); SetPLCI (PLCI); SetController (GetControllerFromPLCI (PLCI)); ConnectInd (GetController(), Params); RETURN ('x', vTrue); } tBool CCAPI20_Channel::CONNECT_ACTIVE_IND (c_word, c_dword PLCI, cm_connectactiveind *Params) { dhead ("CCAPI20_Channel::CONNECT_ACTIVE_IND", DCON_CCAPI20_Channel); dparams ("s=%x", GetState()); dassert (Params != 0); if ((PLCI != GetPLCI()) || (SetState (cs_D_Connected, cs_D_ConnectPending) == vFalse)) { RETURN ('x', vFalse); } dassert (hStateChangeTimer != vIllegalHandle); CONNECT_ACTIVE_RESP (GetNextMsgNr(), PLCI); dassert (hStateChangeTimer != vIllegalHandle); SecTimer_Call (hStateChangeTimer, TIMER_BCHANNEL_WAITTIME, StateChangeTimer_CallBack, this, (void *)TIMER_FOR_BCHANNEL); ConnectActiveInd (Params->pConnectedNumber); if (GetState() != cs_D_Connected) { SetInitiator (vFalse); } else if (GetInitiator() == vTrue) { SetInitiator (vFalse); ConnectB3Req(); } RETURN ('x', vTrue); } tBool CCAPI20_Channel::CONNECT_B3_IND (c_word, c_dword NCCI, CCStruct *) { dhead ("CCAPI20_Channel::CONNECT_B3_IND", DCON_CCAPI20_Channel); dparams ("s=%x", GetState()); if ((GetPLCIFromNCCI (NCCI) != GetPLCI()) || (SetState (cs_B_ConnectPending, cs_D_Connected) == vFalse)) { RETURN ('x', vFalse); } dassert (GetNCCI() == IllegalNCCI); dassert (GetInitiator() == vFalse); SetNCCI (NCCI); cm_connectb3resp ConnB3Params (creject_Accept, &m_NCPIout); CONNECT_B3_RESP (GetNextMsgNr(), GetNCCI(), &ConnB3Params); RETURN ('x', vTrue); } tBool CCAPI20_Channel::CONNECT_B3_ACTIVE_IND (c_word, c_dword NCCI, CCStruct *pNCPI) { dhead ("CCAPI20_Channel::CONNECT_B3_ACTIVE_IND", DCON_CCAPI20_Channel); dparams ("s=%x", GetState()); if ((NCCI != GetNCCI()) || (SetState (cs_Connected, cs_B_ConnectPending) == vFalse)) { RETURN ('x', vFalse); } dassert (GetPLCI() != IllegalPLCI); dwarning (GetInitiator() == vFalse); CONNECT_B3_ACTIVE_RESP (GetNextMsgNr(), NCCI); dassert (hStateChangeTimer != vIllegalHandle); SecTimer_Cancel (hStateChangeTimer); ConnectB3ActiveInd (pNCPI); RETURN ('x', vTrue); } tBool CCAPI20_Channel::DATA_B3_IND (c_word, c_dword NCCI, cm_datab3 *Params) { dhead ("CCAPI20_Channel::DATA_B3_IND", DCON_CCAPI20_Channel); dparams ("s=%x", GetState()); if (NCCI != GetNCCI()) { RETURN ('x', vFalse); } dwarning (GetState() == cs_Connected); DataB3Ind (Params); RETURN ('x', vTrue); } tBool CCAPI20_Channel::DISCONNECT_B3_IND (c_word, c_dword NCCI, cm_disconnectb3ind *Params) { dhead ("CCAPI20_Channel::DISCONNECT_B3_IND", DCON_CCAPI20_Channel); dparams ("s=%x", GetState()); if (NCCI != GetNCCI()) { RETURN ('x', vFalse); } dassert ((GetState() == cs_B_ConnectPending) || (GetState() == cs_Connected) || (GetState() == cs_B_DisconnectPending) || (GetState() == cs_D_DisconnectPending)); dassert (GetPLCI() == GetPLCIFromNCCI (NCCI)); m_Protect.BeginWrite(); if (curState != cs_D_DisconnectPending) { curState = cs_B_DisconnectRespPending; } m_Protect.EndWrite(); DisconnectB3Ind (Params); RETURN ('x', vTrue); } tBool CCAPI20_Channel::DISCONNECT_IND (c_word, c_dword PLCI, c_info Reason) { dhead ("CCAPI20_Channel::DISCONNECT_IND", DCON_CCAPI20_Channel); dparams ("s=%x", GetState()); if (PLCI != GetPLCI()) { RETURN ('x', vFalse); } dwarning (GetNCCI() == IllegalNCCI); dassert (GetState() > cs_Registered); dassert (hStateChangeTimer != vIllegalHandle); SecTimer_Cancel (hStateChangeTimer); if (SetState (cs_D_DisconnectRespPending, cs_B_DisconnectRespPending) == vFalse) { DISCONNECT_RESP (GetNextMsgNr(), PLCI); ResetValues(); m_Protect.BeginWrite(); curState = cs_Registered; m_Protect.EndWrite(); DisconnectInd (Reason); } RETURN ('x', vTrue); } tBool CCAPI20_Channel::INFO_IND (c_word, c_dword Address, cm_infoind *Params) { dhead ("CCAPI20_Channel::INFO_IND", DCON_CCAPI20_Channel); dassert (Params != 0); // TODO: Handle InfoInd for Controller-Addresses if (Address != GetPLCI()) { RETURN ('x', vFalse); } INFO_RESP (GetNextMsgNr(), GetControllerFromPLCI (Address)); InfoInd (Params); RETURN ('x', vTrue); } tBool CCAPI20_Channel::MANUFACTURER_IND (c_word Messagenumber, c_dword Controller, cm_manufacturer *Params) { dhead ("CCAPI20_Channel::MANUFACTURER_IND", DCON_CCAPI20_Channel); CCAPI20_Layer::MANUFACTURER_IND (Messagenumber, Controller, Params); // Auto-Answer before ManufacturerInd-call ManufacturerInd (Controller, Params); return vTrue; } /*===========================================================================*\ \*===========================================================================*/ void CCAPI20_Channel::ResetValues (void) { dhead ("CCAPI20_Channel::ResetValues", DCON_CCAPI20_Channel); m_Protect.BeginWrite(); FreePLCIEntry (GetPLCI()); SetPLCI (IllegalPLCI); SetNCCI (IllegalNCCI); SetController (IllegalController); SetInitiator (vFalse); m_Protect.EndWrite(); } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/capi/Channel.cpp0000644000175000017500000013774310470310075017402 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "Channel.h" #include "dbgCAPI.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define CAPI_CALLEDPARTYNUM_MAXLEN 70 #define DTMF_STATE_N 0 // N = Nothing #define DTMF_STATE_B 1 // B = Listen Begin #define DTMF_STATE_E 2 // E = Listen End #define DTMF_STATE_S 3 // S = Send #define DTMF_STATE_BE 4 #define DTMF_STATE_BS 5 #define DTMF_STATE_EB 6 #define DTMF_STATE_ES 7 #define DTMF_STATE_SE 8 #define DTMF_STATE_SB 9 #define DTMF_STATE_BSE 10 #define DTMF_STATE_ESB 11 #define CHANNEL_STATUS_INIT 0x00 #define CHANNEL_STATUS_WAIT_REGISTER 0x01 #define CHANNEL_STATUS_WAIT_RELEASE 0x02 #define CHANNEL_STATUS_RESET 0x04 #define CHANNEL_STATUS_DISCONNECT_WAIT_NO 0x08 #define CHANNEL_STATUS_DISCONNECT_WAIT_WITH 0x10 #define CHANNEL_STATUS_DISCONNECT_WAIT 0x18 /*===========================================================================*\ CTransferChannel - Konstruktor \*===========================================================================*/ CTransferChannel::CTransferChannel (void) : m_pMSNList (0), m_deleteMSNList (vFalse), m_WaitForDDINumbers (vFalse), m_OutController (IllegalController), m_ActiveController (IllegalController), m_CIPValue (cipvalue_Undefined), m_MaxDataSize (CAPI_MAX_DATA_SIZE), m_DDIPrefixLen (0), m_SupplServType (0), m_DTMFState (DTMF_STATE_N), m_DTMFToneDuration (0), m_DTMFGapDuration (0), m_DTMFListen (vFalse), m_ManualRegister (vFalse), m_Reseting (CHANNEL_STATUS_INIT), m_CheckListenInUse (0) { dhead ("CTransferChannel-Constructor", DCON_CTransferChannel); // TODO!!: Handle Error condition!!!!! m_SendBlock.InitEntries (CAPI_MAX_OUTSTANDING_FRAMES); } /*===========================================================================*\ CTransferChannel - Destruktor \*===========================================================================*/ CTransferChannel::~CTransferChannel (void) { dhead ("CTransferChannel-Destructor", DCON_CTransferChannel); dassert (CurState() == cs_Released); dassert (m_Reseting == CHANNEL_STATUS_INIT); dwarning (m_ManualRegister == vFalse); if (m_deleteMSNList == vTrue) { delete m_pMSNList; } m_pMSNList = 0; m_deleteMSNList = vFalse; m_ManualRegister = vFalse; m_OutController = IllegalController; m_ActiveController = IllegalController; m_CIPValue = cipvalue_Undefined; m_SupplServType = 0; } /*===========================================================================*\ CTransferChannel::ResetChannel \*===========================================================================*/ void CTransferChannel::ResetChannel (void) { dhead ("CTransferChannel::ResetChannel", DCON_CTransferChannel); dparams ("%x,%x", CurState(), m_Reseting); dwarning (m_Reseting == CHANNEL_STATUS_INIT); GetProtectClass()->BeginWrite(); m_ManualRegister = vFalse; if ( (CurState() == cs_Released) && (m_Reseting == CHANNEL_STATUS_INIT) && (m_CheckListenInUse == 0)) { GetProtectClass()->EndWrite(); IsReseted(); } else { SetBitsAll (&m_Reseting, CHANNEL_STATUS_RESET); GetProtectClass()->EndWrite(); Disconnect (DisconnectKind_Fast); SetMSNList (0); } } /*===========================================================================*\ CTransferChannel::CheckListen \*===========================================================================*/ void CTransferChannel::CheckListen (void) { dhead ("CTransferChannel::CheckListen", DCON_CTransferChannel); dprint ("state=%x,pMSNList=%p ", GetState(), m_pMSNList); GetProtectClass()->BeginWrite(); if (CheckBitsOne (m_Reseting, CHANNEL_STATUS_RESET)) { dprint ("m_Reseting=%x, m_CheckListenInUse=%x ", m_Reseting, m_CheckListenInUse); if ((GetState() == cs_Registered) && (m_ManualRegister == vFalse)) { SetBitsAll (&m_Reseting, CHANNEL_STATUS_WAIT_RELEASE); GetProtectClass()->EndWrite(); dprint ("Start Release: "); Release(); dprint ("Finished Release! "); } else { // nothing more to do, because someone else is responsible for calling CheckFinishReset GetProtectClass()->EndWrite(); } return; } if (basicInc (&m_CheckListenInUse) > 0) { GetProtectClass()->EndWrite(); return; } else { dprint ("m_Reseting=%x, m_CheckListenInUse=%x ", m_Reseting, m_CheckListenInUse); GetProtectClass()->EndWrite(); do { CCntrlMSNList *pTmpMSNList = m_pMSNList; switch (GetState()) { case cs_Released: dprint ("cl-State=cs_Released\n"); if (pTmpMSNList && (pTmpMSNList->IsEmpty() == vFalse)) { dwarning (CheckBitsOne (m_Reseting, CHANNEL_STATUS_RESET) == vFalse); GetProtectClass()->BeginWrite(); SetBitsAll (&m_Reseting, CHANNEL_STATUS_WAIT_REGISTER); GetProtectClass()->EndWrite(); Register (m_MaxDataSize); } break; case cs_Registering: dprint ("cl-State=cs_Registering\n"); // nothing to do! break; case cs_Registered: dprint ("cl-State=cs_Registered\n"); if ((!pTmpMSNList || (pTmpMSNList->IsEmpty() == vTrue)) && (m_ManualRegister == vFalse)) { GetProtectClass()->BeginWrite(); SetBitsAll (&m_Reseting, CHANNEL_STATUS_WAIT_RELEASE); GetProtectClass()->EndWrite(); dprint ("Start Release: "); Release(); dprint ("Finished Release! "); break; } // no break! default: dprint ("cl-State=default\n"); if (pTmpMSNList) { tUInt i; tUInt newCntrler; tUInt countMSNs; cp_facilityreq_wakeupparam OneWakeupNumber; cp_facilityreq_wakeupparam *WakeupList; COneMultiString *pCurNumber; cm_listenreq newListenP; dprint ("cl-ResetGetNextMask\n"); pTmpMSNList->ResetGetNextMask(); dprint ("cl-MSNList-Loop\n"); while (pTmpMSNList->GetNextMask (&newCntrler, &newListenP.InfoMask, &newListenP.CIPMask) == vTrue) { dprint ("cl-newCntrler=%x\n", newCntrler); dassert (newCntrler != IllegalController); ListenReq (newCntrler, &newListenP); dprint ("cl-AfterListen\n"); if (pTmpMSNList->GetWakeupSupport (newCntrler) == vTrue) { dprint ("cl-WakeUpEnabled\n"); CMultiString *allMSNs = pTmpMSNList->GetAllMSNs (newCntrler); if ( !allMSNs || CheckBitsAll (newListenP.InfoMask, (infomask_CalledPartyNum | infomask_SendingComplete)) || pTmpMSNList->ExistMSNRange (newCntrler)) { // empty MSNList, MSN Ranges or DDI in use => disable Wakeup dwarning (0); fReq_PMWakeup (newCntrler, 0, 0); } else { dassert (allMSNs->IsEmpty() == vFalse); countMSNs = allMSNs->CountElements(); if (countMSNs > 1) { WakeupList = new cp_facilityreq_wakeupparam [countMSNs]; if (WakeupList) { pCurNumber = allMSNs->GetFirst(); for (i = 0; i < countMSNs; i++, pCurNumber = pCurNumber->GetNext()) { dassert (pCurNumber != 0); dassert (WakeupList[i].pCalledPartyNumber != 0); WakeupList[i].pCalledPartyNumber->pNumber = pCurNumber; WakeupList[i].CIPMask = newListenP.CIPMask; } dassert (countMSNs <= MAXVAL_tUShort); fReq_PMWakeup (newCntrler, (tUShort)countMSNs, WakeupList); delete [] WakeupList; } else { dwarning (0); fReq_PMWakeup (newCntrler, 0, 0); } } else { dassert (OneWakeupNumber.pCalledPartyNumber != 0); dassert (allMSNs->GetFirst() != 0); OneWakeupNumber.pCalledPartyNumber->pNumber = allMSNs->GetFirst(); OneWakeupNumber.CIPMask = newListenP.CIPMask; dassert (OneWakeupNumber.pCalledPartyNumber != 0); fReq_PMWakeup (newCntrler, 1, &OneWakeupNumber); } } } dprint ("cl-NextIteration\n"); } } break; } dprint ("Cur-m_CheckListenInUse=%x ", m_CheckListenInUse); } while (GetProtectClass()->Dec (&m_CheckListenInUse) > 1); dprint ("Loop terminated! "); } if (GetState() == cs_Released) { dprint ("Calling CheckFinishReset! "); CheckFinishReset (CHANNEL_STATUS_INIT); } } /*===========================================================================*\ CTransferChannel::MakeCall \*===========================================================================*/ tBool CTransferChannel::MakeCall (CConstString *pTelNumber, c_cipvalue CipValue) { dhead ("CTransferChannel::MakeCall", DCON_CTransferChannel); dwarning (pTelNumber != 0); dwarning (CipValue != cipvalue_Undefined); dwarning (m_ActiveController == IllegalController); dassert (m_OutController != IllegalController); if ( (CheckBitsOne (GetProtectClass()->Get (&m_Reseting), CHANNEL_STATUS_RESET)) || (m_ActiveController != IllegalController) || (GetState() > cs_Registered)) { RETURN ('x', vFalse); } if (pTelNumber) { if (m_CalledPartyNum.Set (pTelNumber) == vFalse) { dwarning (0); RETURN ('x', vFalse); } } else { m_CalledPartyNum.RemoveAll(); } m_ActiveController = m_OutController; m_CIPValue = CipValue; m_SupplServType = 0; dprint ("state=%x ", GetState()); switch (GetState()) { case cs_Released: dwarning (CheckBitsOne (m_Reseting, CHANNEL_STATUS_RESET) == vFalse); GetProtectClass()->BeginWrite(); if (CheckBitsOne (m_Reseting, CHANNEL_STATUS_RESET)) { GetProtectClass()->EndWrite(); m_ActiveController = IllegalController; m_CIPValue = cipvalue_Undefined; m_CalledPartyNum.RemoveAll(); RETURN ('x', vFalse); } SetBitsAll (&m_Reseting, CHANNEL_STATUS_WAIT_REGISTER); GetProtectClass()->EndWrite(); Register (m_MaxDataSize); break; case cs_Registering: /*----- Nothing To Do! -----*/ break; default: dwarning (0); break; case cs_Registered: { DialingBegin(); cp_callednumber callednumparam (&m_CalledPartyNum); cm_connectreq ConParams (m_CIPValue, &callednumparam, &m_sMSN, 0, 0, &m_BProtocol, &m_AdditionalInfo); if (ConnectReq (m_ActiveController, &ConParams) == vFalse) { m_ActiveController = IllegalController; m_CIPValue = cipvalue_Undefined; m_CalledPartyNum.RemoveAll(); RETURN ('x', vFalse); } } break; } RETURN ('x', vTrue); } /*===========================================================================*\ CTransferChannel::AnswerCall \*===========================================================================*/ void CTransferChannel::AnswerCall (c_reject Reject) { dhead ("CTransferChannel::AnswerCall", DCON_CTransferChannel); dparams ("%x", Reject); cp_connectednumber ConnectNum; ConnectNum.pNumber = &m_CalledPartyNum; cm_connectresp ConParams (Reject, &m_BProtocol, (m_CalledPartyNum.IsEmpty()) ? 0 : &ConnectNum, 0, &m_AdditionalInfo); ConnectResp (&ConParams); } /*===========================================================================*\ CTransferChannel::PutData \*===========================================================================*/ tBool CTransferChannel::PutData (tUByte *Data, tUShort DataLength, void *hDataID) { dhead ("CTransferChannel::PutData", DCON_CTransferChannel); dparams ("d=%p,l=%x,h=%x", Data, DataLength, hDataID); if (CheckBitsOne (m_Reseting, CHANNEL_STATUS_DISCONNECT_WAIT_NO | CHANNEL_STATUS_RESET)) { dwarning (0); RETURN ('x', vFalse); } tUShort CapiHandle; if (m_SendBlock.New (hDataID, &CapiHandle) == vFalse) { //PutDataComplete (hDataID, i_QueueFull); RETURN ('x', vFalse); } dassert (CapiHandle <= MAXVAL_tUShort); cm_datab3 DataParams (Data, DataLength, CapiHandle, 0); DataB3Req (&DataParams); RETURN ('x', vTrue); } /*===========================================================================*\ CTransferChannel::Disconnect \*===========================================================================*/ void CTransferChannel::Disconnect (tDisconnectKind kind) { dhead ("CTransferChannel::Disconnect", DCON_CTransferChannel); dparams ("%x", kind); switch (kind) { case DisconnectKind_WaitWithPut: if (IsPutQueueEmpty() == vFalse) { m_Reseting = 4; } else { DisconnectReq(); } break; case DisconnectKind_WaitNoPut: if (IsPutQueueEmpty() == vFalse) { m_Reseting = 2; } else { DisconnectReq(); } break; default: case DisconnectKind_Normal: DisconnectReq(); break; case DisconnectKind_Fast: DisconnectReq (vTrue); break; case DisconnectKind_Hard: GetProtectClass()->BeginWrite(); SetBitsAll (&m_Reseting, CHANNEL_STATUS_WAIT_RELEASE); GetProtectClass()->EndWrite(); dwarning (m_ManualRegister == vTrue); m_ManualRegister = vTrue; Release(); break; } } /*===========================================================================*\ CTransferChannel::UpdateBParameters \*===========================================================================*/ void CTransferChannel::UpdateBParameters (void) { dhead ("CTransferChannel::UpdateBParameters", DCON_CTransferChannel); SelectBProtocolReq (&m_BProtocol); } /*===========================================================================*\ CTransferChannel::HoldCall \*===========================================================================*/ #ifdef USE_SUPPLEMENTARY_SERVICES void CTransferChannel::HoldCall (void) { dhead ("CTransferChannel::HoldCall", DCON_CTransferChannel); if (GetState() > cs_D_Connected) { m_SupplServType = supplserv_Hold; DisconnectReq(); } else { fReq_Hold(); } } /*===========================================================================*\ CTransferChannel::UnholdCall \*===========================================================================*/ void CTransferChannel::UnholdCall (void) { dhead ("CTransferChannel::UnholdCall", DCON_CTransferChannel); fReq_Retrieve(); } /*===========================================================================*\ CTransferChannel::ParkCall \*===========================================================================*/ void CTransferChannel::ParkCall (CConstString *pIDStr) { dhead ("CTransferChannel::ParkCall", DCON_CTransferChannel); if (GetState() < cs_D_Connected) { CallParked (ci_Int_IllegalState); } else if (m_ParkIdentity.Set (pIDStr) == vFalse) { CallParked (ci_Int_MemoryFullErr); } else if (GetState() > cs_D_Connected) { m_SupplServType = supplserv_Suspend; DisconnectReq(); } else { fReq_Suspend (&m_ParkIdentity); m_ParkIdentity.RemoveAll(); } } /*===========================================================================*\ CTransferChannel::UnparkCall \*===========================================================================*/ void CTransferChannel::UnparkCall (CConstString *pIDStr) { dhead ("CTransferChannel::UnparkCall", DCON_CTransferChannel); dassert (m_OutController != IllegalController); dassert (m_ActiveController == IllegalController); if (GetState() > cs_Registered) { CallUnparked (ci_Int_IllegalState); } else if (m_ParkIdentity.Set (pIDStr) == vFalse) { CallUnparked (ci_Int_MemoryFullErr); } else { switch (GetState()) { case cs_Released: //case cs_Releasing: dwarning (CheckBitsOne (m_Reseting, CHANNEL_STATUS_RESET) == vFalse); GetProtectClass()->BeginWrite(); if (CheckBitsOne (m_Reseting, CHANNEL_STATUS_RESET)) { GetProtectClass()->EndWrite(); break; } SetBitsAll (&m_Reseting, CHANNEL_STATUS_WAIT_REGISTER); GetProtectClass()->EndWrite(); m_ActiveController = m_OutController; m_CIPValue = cipvalue_Undefined; m_SupplServType = supplserv_Resume; Register (m_MaxDataSize); break; case cs_Registering: m_ActiveController = m_OutController; m_CIPValue = cipvalue_Undefined; m_SupplServType = supplserv_Resume; break; default: dassert (0); // no break! case cs_Registered: m_ActiveController = m_OutController; m_CIPValue = cipvalue_Undefined; fReq_Resume (m_ActiveController, &m_ParkIdentity); m_ParkIdentity.RemoveAll(); break; } } } /*===========================================================================*\ CTransferChannel::RedirectCall \*===========================================================================*/ void CTransferChannel::RedirectCall (CDynamicString *pTelNumber) { dhead ("CTransferChannel::RedirectCall", DCON_CTransferChannel); dassert (pTelNumber != 0); fReq_CD (vTrue, pTelNumber); } /*===========================================================================*\ CTransferChannel::TransferCall \*===========================================================================*/ void CTransferChannel::TransferCall (CTransferChannel *pChannel) { dhead ("CTransferChannel::TransferCall", DCON_CTransferChannel); dassert (pChannel != 0); dassert (GetState() == cs_Holded); dassert (pChannel->GetState() == cs_Connected); fReq_ECT (pChannel); } /*===========================================================================*\ CTransferChannel::Conference \*===========================================================================*/ void CTransferChannel::Conference (CTransferChannel *pChannel, tBool doBegin) { dhead ("CTransferChannel::Conference", DCON_CTransferChannel); dparams ("%x", doBegin); dassert (pChannel != 0); if (doBegin == vTrue) { fReq_3PTY_Begin (pChannel); } else { fReq_3PTY_End (pChannel); } } /*===========================================================================*\ CTransferChannel::DTMFListen \*===========================================================================*/ void CTransferChannel::DTMFListen (tBool activate) { dhead ("CTransferChannel::DTMFListen", DCON_CTransferChannel); dparams ("%x", activate); dwarning (GetState() == cs_Connected); if (activate == m_DTMFListen) { return; } m_DTMFListen = activate; if (GetState() != cs_Connected) { return; } if (activate == vTrue) { switch (m_DTMFState) { case DTMF_STATE_N: m_DTMFState = DTMF_STATE_B; fReq_DTMF (dtmffunction_StartListen, 0, 0, 0, 0); break; case DTMF_STATE_B: // nothing to do! break; case DTMF_STATE_E: m_DTMFState = DTMF_STATE_BE; break; case DTMF_STATE_S: m_DTMFState = DTMF_STATE_SB; break; case DTMF_STATE_BE: m_DTMFState = DTMF_STATE_B; break; case DTMF_STATE_BS: m_DTMFState = DTMF_STATE_B; break; case DTMF_STATE_EB: // nothing to do! break; case DTMF_STATE_ES: m_DTMFState = DTMF_STATE_ESB; break; case DTMF_STATE_SE: m_DTMFState = DTMF_STATE_SB; break; case DTMF_STATE_SB: // nothing to do! break; case DTMF_STATE_BSE: m_DTMFState = DTMF_STATE_BS; break; default: dassert (0); break; } } else { switch (m_DTMFState) { case DTMF_STATE_N: m_DTMFState = DTMF_STATE_E; fReq_DTMF (dtmffunction_StopListen, 0, 0, 0, 0); break; case DTMF_STATE_B: m_DTMFState = DTMF_STATE_BE; break; case DTMF_STATE_E: // nothing to do! break; case DTMF_STATE_S: m_DTMFState = DTMF_STATE_SE; break; case DTMF_STATE_BE: // nothing to do! break; case DTMF_STATE_BS: m_DTMFState = DTMF_STATE_BSE; break; case DTMF_STATE_EB: m_DTMFState = DTMF_STATE_E; break; case DTMF_STATE_ES: // nothing to do! break; case DTMF_STATE_SE: // nothing to do! break; case DTMF_STATE_SB: m_DTMFState = DTMF_STATE_SE; break; break; case DTMF_STATE_BSE: // nothing to do! break; default: dassert (0); break; } } } /*===========================================================================*\ CTransferChannel::DTMFSend \*===========================================================================*/ void CTransferChannel::DTMFSend (CConstString *pDTMFDigits, tUShort ToneDuration, tUShort GapDuration) { dhead ("CTransferChannel::DTMFSend", DCON_CTransferChannel); dassert (pDTMFDigits != 0); dassert (GetState() == cs_Connected); dwarning (m_DTMFDigits.GetLen() == 0); if (m_DTMFDigits.IsEmpty() == vFalse) { DTMFSendComplete (ci_Int_FunctionInUse); } else if (m_DTMFDigits.Set (pDTMFDigits) == vTrue) { dassert (m_DTMFDigits.GetLen() > 0); m_DTMFToneDuration = ToneDuration; m_DTMFGapDuration = GapDuration; switch (m_DTMFState) { case DTMF_STATE_N: m_DTMFState = DTMF_STATE_S; fReq_DTMF (dtmffunction_SendDigits, m_DTMFToneDuration, m_DTMFGapDuration, &m_DTMFDigits, 0); m_DTMFDigits.RemoveAll(); break; case DTMF_STATE_B: m_DTMFState = DTMF_STATE_BS; break; case DTMF_STATE_E: m_DTMFState = DTMF_STATE_ES; break; case DTMF_STATE_BE: m_DTMFState = DTMF_STATE_BSE; break; case DTMF_STATE_EB: m_DTMFState = DTMF_STATE_ESB; break; default: case DTMF_STATE_BS: case DTMF_STATE_ES: case DTMF_STATE_BSE: case DTMF_STATE_ESB: dassert (0); // no break! case DTMF_STATE_S: case DTMF_STATE_SE: case DTMF_STATE_SB: dwarning (0); m_DTMFDigits.RemoveAll(); DTMFSendComplete (ci_Int_FunctionInUse); break; } } else { DTMFSendComplete (ci_Int_MemoryFullErr); } } /*===========================================================================*\ CTransferChannel::fConf_DTMF \*===========================================================================*/ void CTransferChannel::fConf_DTMF (c_info Info) { dhead ("CTransferChannel::fConf_DTMF", DCON_CTransferChannel); dprint ("%x", Info); tUInt now = DTMF_STATE_N; tUInt next = DTMF_STATE_N; switch (m_DTMFState) { case DTMF_STATE_N: dwarning (0); break; case DTMF_STATE_B: m_DTMFState = DTMF_STATE_N; now = DTMF_STATE_B; break; case DTMF_STATE_E: m_DTMFState = DTMF_STATE_N; now = DTMF_STATE_E; break; case DTMF_STATE_S: m_DTMFState = DTMF_STATE_N; now = DTMF_STATE_S; break; case DTMF_STATE_BE: m_DTMFState = DTMF_STATE_E; next = DTMF_STATE_E; now = DTMF_STATE_B; break; case DTMF_STATE_BS: m_DTMFState = DTMF_STATE_S; next = DTMF_STATE_S; now = DTMF_STATE_B; break; case DTMF_STATE_ES: m_DTMFState = DTMF_STATE_S; next = DTMF_STATE_S; now = DTMF_STATE_E; break; case DTMF_STATE_SB: m_DTMFState = DTMF_STATE_B; next = DTMF_STATE_B; now = DTMF_STATE_S; break; case DTMF_STATE_SE: m_DTMFState = DTMF_STATE_E; next = DTMF_STATE_E; now = DTMF_STATE_S; break; case DTMF_STATE_EB: m_DTMFState = DTMF_STATE_B; next = DTMF_STATE_B; now = DTMF_STATE_E; break; case DTMF_STATE_BSE: m_DTMFState = DTMF_STATE_SE; next = DTMF_STATE_S; now = DTMF_STATE_B; break; case DTMF_STATE_ESB: m_DTMFState = DTMF_STATE_SB; next = DTMF_STATE_S; now = DTMF_STATE_E; break; default: dassert (0); break; } switch (now) { case DTMF_STATE_N: break; case DTMF_STATE_B: if (CapiInfoIsError (Info)) { m_DTMFListen = vFalse; DTMFListenError (Info); } break; case DTMF_STATE_E: break; case DTMF_STATE_S: DTMFSendComplete (Info); break; default: dassert (0); break; } switch (next) { case DTMF_STATE_N: break; case DTMF_STATE_B: fReq_DTMF (dtmffunction_StartListen, 0, 0, 0, 0); break; case DTMF_STATE_E: fReq_DTMF (dtmffunction_StopListen, 0, 0, 0, 0); break; case DTMF_STATE_S: dwarning (m_DTMFDigits.GetLen() > 0); fReq_DTMF (dtmffunction_SendDigits, m_DTMFToneDuration, m_DTMFGapDuration, &m_DTMFDigits, 0); m_DTMFDigits.RemoveAll(); break; default: dassert (0); break; } } #endif /*===========================================================================*\ CTransferChannel::CapiStart \*===========================================================================*/ void CTransferChannel::CapiStart (void) { dhead ("CTransferChannel::CapiStart", DCON_CTransferChannel); dwarning (m_ManualRegister == vFalse); m_ManualRegister = vTrue; if (CurState() == cs_Released) { dwarning (CheckBitsOne (m_Reseting, CHANNEL_STATUS_RESET) == vFalse); GetProtectClass()->BeginWrite(); SetBitsAll (&m_Reseting, CHANNEL_STATUS_WAIT_REGISTER); GetProtectClass()->EndWrite(); Register (m_MaxDataSize); } } /*===========================================================================*\ CTransferChannel::CapiStop \*===========================================================================*/ void CTransferChannel::CapiStop (void) { dhead ("CTransferChannel::CapiStop", DCON_CTransferChannel); dwarning (m_ManualRegister == vTrue); if ((m_ManualRegister == vTrue) && (CurState() >= cs_Registered)) { m_ManualRegister = vFalse; GetProtectClass()->BeginWrite(); SetBitsAll (&m_Reseting, CHANNEL_STATUS_WAIT_RELEASE); GetProtectClass()->EndWrite(); Release(); } } /*===========================================================================*\ CTransferChannel::GetProfile \*===========================================================================*/ void CTransferChannel::GetProfile (tUInt Controller) { dhead ("CTransferChannel::GetProfile", DCON_CTransferChannel); dassert (GetState() >= cs_Registered); GET_PROFILE (Controller); } /*===========================================================================*\ CTransferChannel::ManufacturerCall \*===========================================================================*/ void CTransferChannel::ManufacturerCall (c_dword Function, CCStruct *pData) { dhead ("CTransferChannel::ManufacturerCall", DCON_CTransferChannel); dassert (m_OutController != IllegalController); dassert (GetState() >= cs_Registered); cm_manufacturer Params (0x214D5641, 0, Function, pData); ManufacturerReq (m_OutController, &Params); } /*===========================================================================*\ CTransferChannel::Register_Complete \*===========================================================================*/ void CTransferChannel::Register_Complete (c_info ErrorCode) { dhead ("CTransferChannel::Register_Complete", DCON_CTransferChannel); dwarning (ErrorCode == ci_NoError); if (CapiInfoIsSuccess (ErrorCode)) { GetProtectClass()->BeginWrite(); if (CheckBitsOne (m_Reseting, CHANNEL_STATUS_RESET)) { SetBitsAll (&m_Reseting, CHANNEL_STATUS_WAIT_RELEASE); GetProtectClass()->EndWrite(); Release(); return; } m_Reseting = CHANNEL_STATUS_INIT; GetProtectClass()->EndWrite(); if (m_ManualRegister == vTrue) { CapiStarted (ci_NoError); } if (m_ActiveController != IllegalController) { DialingBegin(); #ifdef USE_SUPPLEMENTARY_SERVICES if (m_SupplServType == supplserv_Resume) { fReq_Resume (m_ActiveController, &m_ParkIdentity); } else #endif { cp_callednumber callednumparam (&m_CalledPartyNum); cm_connectreq ConParams (m_CIPValue, &callednumparam, &m_sMSN, 0, 0, &m_BProtocol, &m_AdditionalInfo); if (ConnectReq (m_ActiveController, &ConParams) == vFalse) { dassert (0); } } } m_SupplServType = 0; m_ParkIdentity.RemoveAll(); CheckListen(); } else if (ErrorCode != ci_Int_RegisterDelayed) { if (m_ActiveController != IllegalController) { m_ActiveController = IllegalController; m_CIPValue = cipvalue_Undefined; m_CalledPartyNum.RemoveAll(); IsDisconnected (ErrorCode); } if (m_pMSNList && (m_pMSNList->IsEmpty() == vFalse)) { ListenError (0, ErrorCode); } if (m_ManualRegister == vTrue) { m_ManualRegister = vFalse; CapiStarted (ErrorCode); } CheckFinishReset (CHANNEL_STATUS_INIT); } } /*===========================================================================*\ CTransferChannel::Release_Complete \*===========================================================================*/ void CTransferChannel::Release_Complete (void) { dhead ("CTransferChannel::Release_Complete", DCON_CTransferChannel); dassert (m_ActiveController == IllegalController); tUInt newState = ( (m_ActiveController != IllegalController) || (m_ManualRegister == vTrue) || (m_pMSNList && (m_pMSNList->IsEmpty() == vFalse))) ? CHANNEL_STATUS_WAIT_REGISTER : CHANNEL_STATUS_INIT; dprint ("newState=%x,ActiceC=%x,m_pMSNList=%p ", newState, m_ActiveController, m_pMSNList); if ((CheckFinishReset (newState) == 0) && (newState == CHANNEL_STATUS_WAIT_REGISTER)) { Register (m_MaxDataSize); } } /*===========================================================================*\ CTransferChannel::DataB3Conf \*===========================================================================*/ void CTransferChannel::DataB3Conf (cm_datab3conf *Params) { dhead ("CTransferChannel::DataB3Conf", DCON_CTransferChannel); dassert (Params != 0); void *hDataID; if (m_SendBlock.Free (Params->DataHandle, &hDataID) == vTrue) { PutDataComplete (hDataID, Params->Info); if (CheckBitsOne (m_Reseting, CHANNEL_STATUS_DISCONNECT_WAIT) && (IsPutQueueEmpty() == vTrue)) { Disconnect(); } } else { dprintErr ("Great CAPI Error (Now disconnecting)!!!\n"); Disconnect(); dassert (0); } } /*===========================================================================*\ CTransferChannel::ListenConf \*===========================================================================*/ void CTransferChannel::ListenConf (c_dword Controller, c_info Info) { dhead ("CTransferChannel::ListenConf", DCON_CTransferChannel); dparams ("c=%x,i=%x", Controller, Info); if (CapiInfoIsError (Info) == vTrue) { //if (Info == ci_Cod_IllegalAddress) { // // illegal controller-number can be deleted // m_pMSNList.Remove (Controller); // CheckListen(); //} ListenError (Controller, Info); } } /*===========================================================================*\ CTransferChannel::ManufacturerConf \*===========================================================================*/ void CTransferChannel::ManufacturerConf (c_dword, cm_manufacturer *Params) { dhead ("CTransferChannel::ManufacturerConf", DCON_CTransferChannel); ManufacturerCallComplete (Params->Class, Params->Function, Params->pManuData); } /*===========================================================================*\ CTransferChannel::SelectBProtocolConf \*===========================================================================*/ void CTransferChannel::SelectBProtocolConf (c_info Info) { dhead ("CTransferChannel::SelectBProtocolConf", DCON_CTransferChannel); UpdateBParametersComplete (Info); } /*===========================================================================*\ CTransferChannel::ConnectInd \*===========================================================================*/ void CTransferChannel::ConnectInd (c_dword Controller, cm_connectind *Params) { dhead ("CTransferChannel::ConnectInd", DCON_CTransferChannel); dassert (Params != 0); dassert (Params->pCalledPartyNumber != 0); dassert (Params->pCallingPartyNumber != 0); if (m_pMSNList != 0) { dassert (m_ActiveController == IllegalController); switch (m_pMSNList->FindCallInfo (Controller, Params->CIPValue, Params->pCalledPartyNumber, &m_DDIPrefixLen)) { case iWrn_MSNList_DDICall: dassert (CAPI_CALLEDPARTYNUM_MAXLEN < 254); dassert (m_DDIPrefixLen < CAPI_CALLEDPARTYNUM_MAXLEN); dassert (m_DDIPrefixLen > 0); if (Params->pCallingPartyNumber->GetLen() > 2) { m_CallingNumber.Set (Params->pCallingPartyNumber->GetData() + 2, Params->pCallingPartyNumber->GetLen() - 2); } else { m_CallingNumber.RemoveAll(); } m_CalledPartyNum.RemoveAll(); m_ActiveController = Controller; m_CIPValue = Params->CIPValue; return; case i_Okay: if (AcceptIncomingCall() == vTrue) { m_ActiveController = Controller; m_CIPValue = Params->CIPValue; if (Params->pCalledPartyNumber->GetLen() > 1) { dassert (Params->pCalledPartyNumber->GetData() != 0); m_CalledPartyNum.Set (Params->pCalledPartyNumber->GetData() + 1, Params->pCalledPartyNumber->GetLen() - 1); } else { m_CalledPartyNum.RemoveAll(); } if (Params->pCallingPartyNumber->GetLen() > 2) { m_CallingNumber.Set (Params->pCallingPartyNumber->GetData() + 2, Params->pCallingPartyNumber->GetLen() - 2); } else { m_CallingNumber.RemoveAll(); } dprint ("(%s)(%s)\n", m_CallingNumber.GetPointer(), m_CalledPartyNum.GetPointer()); IncomingCall (m_CIPValue, &m_CallingNumber, &m_CalledPartyNum); } return; case iWrn_MSNList_RejectCall: break; default: dassert (0); break; } } { cm_connectresp crIgnore; ConnectResp (&crIgnore); } } /*===========================================================================*\ CTransferChannel::ConnectActiveInd \*===========================================================================*/ void CTransferChannel::ConnectActiveInd (CCStruct *pConnectedNumber) { dhead ("CTransferChannel::ConnectActiveInd", DCON_CTransferChannel); dassert (pConnectedNumber != 0); CDynamicString ConNum; if (pConnectedNumber->GetLen() > 2) { ConNum.Set (pConnectedNumber->GetData() + 2, pConnectedNumber->GetLen() - 2); } ConnectProceeding (&ConNum); } /*===========================================================================*\ CTransferChannel::ConnectB3ActiveInd \*===========================================================================*/ void CTransferChannel::ConnectB3ActiveInd (CCStruct *pNCPI) { dhead ("CTransferChannel::ConnectB3ActiveInd", DCON_CTransferChannel); dassert (pNCPI != 0); if (m_DTMFListen == vTrue) { fReq_DTMF (dtmffunction_StartListen, 0, 0, 0, 0); } if (pNCPI->GetLen() > 0) { cp_ncpi_all NCPIall (m_BProtocol.B3Protocol); tSInfo fret = NCPIall.ParseStruct (pNCPI); dwarning (fret == i_Okay); //// Check ExtendedFax-Options, if CAPI tries to Build up with a set of not allowed features //if ((B3Prot == b3prot_G3Fax_extended) && (NCPIcapi->Options != 0)) { // c_word *FAXoption; // if (GetBeginAndLenOfStructData (B3Config, &(c_byte *)FAXoption) > 4 * sizeof (c_byte)) { // FAXoption += 1; // if (FAXoption & NCPIcapi->Options); // } //} IsConnected (infoSuccess (fret) ? &NCPIall : 0); } else { IsConnected (0); } } /*===========================================================================*\ CTransferChannel::DataB3Ind \*===========================================================================*/ void CTransferChannel::DataB3Ind (cm_datab3 *Params) { dhead ("CTransferChannel::DataB3Ind", DCON_CTransferChannel); dassert (Params != 0); GetData (Params->Data, Params->DataLength, Params->DataHandle); } /*===========================================================================*\ CTransferChannel::DisconnectB3Ind \*===========================================================================*/ void CTransferChannel::DisconnectB3Ind (cm_disconnectb3ind *Params) { dhead ("CTransferChannel::DisconnectB3Ind", DCON_CTransferChannel); dassert (Params != 0); dassert (Params->pNCPI != 0); GetProtectClass()->BeginWrite(); ClearBitsAll (&m_Reseting, CHANNEL_STATUS_DISCONNECT_WAIT); GetProtectClass()->EndWrite(); ResetSendBlock(); if (Params->pNCPI->GetLen() > 0) { cp_ncpi_all NCPIall (m_BProtocol.B3Protocol); NCPIall.ParseStruct (Params->pNCPI); DisconnectInquiry (Params->ReasonB3, &NCPIall); } else { DisconnectInquiry (Params->ReasonB3, 0); } #ifdef USE_SUPPLEMENTARY_SERVICES switch (m_SupplServType) { case supplserv_Hold: fReq_Hold(); break; case supplserv_Suspend: fReq_Suspend (&m_ParkIdentity); break; } m_SupplServType = 0; m_ParkIdentity.RemoveAll(); #endif } /*===========================================================================*\ CTransferChannel::DisconnectInd \*===========================================================================*/ void CTransferChannel::DisconnectInd (c_info Reason) { dhead ("CTransferChannel::DisconnectInd", DCON_CTransferChannel); //dwarning (m_ActiveController != IllegalController); if (m_ActiveController != IllegalController) { m_ActiveController = IllegalController; m_CIPValue = cipvalue_Undefined; m_DTMFListen = vFalse; GetProtectClass()->BeginWrite(); ClearBitsAll (&m_Reseting, CHANNEL_STATUS_DISCONNECT_WAIT); GetProtectClass()->EndWrite(); m_CalledPartyNum.RemoveAll(); m_CallingNumber.RemoveAll(); m_ParkIdentity.RemoveAll(); ResetSendBlock(); if (m_DDIPrefixLen > 0) { m_DDIPrefixLen = 0; } else { IsDisconnected (Reason); } dprint ("DisconectInd-CheckListen "); CheckListen(); } } /*===========================================================================*\ CTransferChannel::InfoInd \*===========================================================================*/ void CTransferChannel::InfoInd (cm_infoind *Params) { dhead ("CTransferChannel::InfoInd", DCON_CTransferChannel); dparams ("%x", Params->InfoNumber); dassert (Params != 0); // at the moment we only used this call for DDI switch (Params->InfoNumber) { case 0x70: // called party number info element if (GetState() != cs_D_ConnectIndication) { break; } else { dassert (Params->pInfoElement != 0); dassert ((Params->pInfoElement->GetLen() == 0) || (Params->pInfoElement->GetData() != 0)); //TODO: more checking if DDI is active! if (Params->pInfoElement->GetLen() <= 1) { break; } if (m_CalledPartyNum.Append (Params->pInfoElement->GetData() + 1, Params->pInfoElement->GetLen() - 1) == vFalse) { dwarning (0); m_CalledPartyNum.RemoveAll(); cm_connectresp crIgnore; ConnectResp (&crIgnore); break; } } // no break! case 0xA1: // sending complete info element dprintBuf (m_CalledPartyNum.GetPointer(), m_CalledPartyNum.GetLen()); dassert (m_ActiveController != IllegalController); if ( (GetState() == cs_D_ConnectIndication) && (m_CalledPartyNum.GetLen() > m_DDIPrefixLen) && (m_pMSNList != 0)) { CConstString ddinum (m_CalledPartyNum.GetPointer() + m_DDIPrefixLen, m_CalledPartyNum.GetLen() - m_DDIPrefixLen); switch (m_pMSNList->TestDDINumber (m_ActiveController, &ddinum)) { case iWrn_MSNList_DDICall: // DDI Number not complete received -> wait for more numbers break; case i_Okay: if (AcceptIncomingCall() == vTrue) { m_DDIPrefixLen = 0; IncomingCall (m_CIPValue, &m_CallingNumber, &ddinum); } break; case iWrn_MSNList_RejectCall: { m_CalledPartyNum.RemoveAll(); cm_connectresp crIgnore; ConnectResp (&crIgnore); break; } default: dassert (0); break; } } break; } } /*===========================================================================*\ CTransferChannel::ManufacturerInd \*===========================================================================*/ void CTransferChannel::ManufacturerInd (c_dword, cm_manufacturer *Params) { dhead ("CTransferChannel::ManufacturerInd", DCON_CTransferChannel); dassert (Params != 0); ManufacturerNotify (Params->Function, Params->pManuData); } /*===========================================================================*\ CTransferChannel::fConf_PMWakeup \*===========================================================================*/ void CTransferChannel::fConf_PMWakeup (c_dword Controller, c_info Info, c_word NumberAccepted) { dhead ("CTransferChannel::fConf_PMWakeup", DCON_CTransferChannel); dwarning (m_pMSNList != 0); CCntrlMSNList *pTmpMSNList = m_pMSNList; if (pTmpMSNList != 0) { if (CapiInfoIsSuccess (Info) == vTrue) { if (NumberAccepted && (NumberAccepted < pTmpMSNList->GetCountMSN (Controller))) { dwarning (0); fReq_PMWakeup (Controller, 0, 0); } } else { dprint ("fConf_PMWakeup returned with %x. ", Info); pTmpMSNList->SetWakeupSupport (Controller, vFalse); } } } /*===========================================================================*\ CTransferChannel::ResetSendBlock \*===========================================================================*/ void CTransferChannel::ResetSendBlock (void) { dhead ("CTransferChannel::ResetSendBlock", DCON_CTransferChannel); void *DelHandle; while (m_SendBlock.DelNextEntry (&DelHandle) == vTrue) { PutDataComplete (DelHandle, ci_Int_NotConnected); } } /*===========================================================================*\ CTransferChannel::CheckFinishReset \*===========================================================================*/ tUInt CTransferChannel::CheckFinishReset (tUInt NewResetState) { dhead ("CTransferChannel::CheckFinishReset", DCON_CTransferChannel); dassert (GetState() == cs_Released); GetProtectClass()->BeginWrite(); if (CheckBitsOne (m_Reseting, CHANNEL_STATUS_RESET) == vFalse) { m_Reseting = NewResetState; GetProtectClass()->EndWrite(); RETURN ('x', 0); } if (m_CheckListenInUse == 0) { m_Reseting = CHANNEL_STATUS_INIT; GetProtectClass()->EndWrite(); IsReseted(); RETURN ('x', 2); } GetProtectClass()->EndWrite(); RETURN ('x', 1); } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/capi/DataHand.h0000644000175000017500000000574110470310075017133 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _DATAHAND_H_ #define _DATAHAND_H_ #include "aTypes.h" #include "ProtClas.h" /*===========================================================================*\ \*===========================================================================*/ class CDataHandleAdmin { public: CDataHandleAdmin (void); virtual ~CDataHandleAdmin (void); tBool InitEntries (tUShort MaxEntries); tBool New (void *NewDataHandle, tUShort *RetHandle); // NewDataHandle != 0 !!!! tBool Free (tUShort InHandle, void **RetDataHandle); tBool IsEmpty (void); tBool IsFull (void); tUShort CurCount (void); tUShort MaxEntries (void); tBool DelNextEntry (void **HandleToDel = 0); // False: nichts da zum löschen private: struct HandleArray { void *pointer; tUShort next; tBool inuse; } *m_Array; CProtectClass m_Protect; tUShort m_maxEntries; tUShort m_curEntries; tUShort m_nextOne; }; /*===========================================================================*\ inline Funktionen \*===========================================================================*/ inline tBool CDataHandleAdmin::IsEmpty (void) { return (m_curEntries == 0) ? vTrue : vFalse; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tBool CDataHandleAdmin::IsFull (void) { return (m_curEntries == m_maxEntries) ? vTrue : vFalse; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tUShort CDataHandleAdmin::CurCount (void) { return m_curEntries; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tUShort CDataHandleAdmin::MaxEntries (void) { return m_maxEntries; } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/capi/CCSFacil.h0000644000175000017500000001702110470310075017030 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _CCSFACIL_H_ #define _CCSFACIL_H_ #include "CCSParam.h" #pragma pack(1) /*===========================================================================*\ \*===========================================================================*/ class cp_facilitynumber : public CCStruct { public: cp_facilitynumber (CDynamicString *num = 0, c_byte indicator = CALLNUM_INDICATOR_DEFAULT) : CCStruct (cxt_CallingPartyNumber, &FacilityType, cxf_03 cxf_STRING), FacilityType (0x01), NumberType (0x00), Indicator (indicator), pNumber (num) {} c_byte FacilityType; c_byte NumberType; c_byte Indicator; CDynamicString *pNumber; void ResetNumber (void) { FacilityType = 0x01; NumberType = 0x00; Indicator = CALLNUM_INDICATOR_DEFAULT; pNumber->RemoveAll(); }; }; /*===========================================================================*\ \*===========================================================================*/ class cp_facility_dtmfdigits : public CCStruct { public: cp_facility_dtmfdigits (CDynamicString *pdigits) : CCStruct (cxt_FacilityReq_DTMFDigits, &pDigits, cxf_STRING), pDigits (pdigits) {} CDynamicString *pDigits; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cp_facilityreq_dtmf : public CCStruct { public: cp_facilityreq_dtmf (c_word func = 0, c_word tone = 0, c_word gap = 0, CDynamicString *pdigits = 0, CCStruct *pchar = 0) : CCStruct (cxt_FacilityReq_DTMF, &Function, cxf_06 cxf_STRUCT cxf_STRUCT), Function (func), ToneDuration (tone), GapDuration (gap), pDTMFDigits (&m_DTMFDigits), pDTMFCharacteristics (pchar), m_DTMFDigits (pdigits) {} c_word Function; c_word ToneDuration; c_word GapDuration; cp_facility_dtmfdigits *pDTMFDigits; CCStruct *pDTMFCharacteristics; private: cp_facility_dtmfdigits m_DTMFDigits; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cp_facilityconf_dtmf : public CCStruct { public: cp_facilityconf_dtmf (void) : CCStruct (cxt_FacilityConf_DTMF, &DTMFInformation, cxf_02), DTMFInformation (0) {} c_word DTMFInformation; }; /*===========================================================================*\ \*===========================================================================*/ class cp_facilityreq_wakeupparam : public CCStruct { public: cp_facilityreq_wakeupparam (CDynamicString *num = 0, c_dword mask = 0) : CCStruct (cxt_FacilityReq_WakeUpParam, &pCalledPartyNumber, cxf_STRUCT cxf_04), pCalledPartyNumber (&m_CalledPartyNumber), CIPMask (mask), m_CalledPartyNumber (num) {} cp_callednumber *pCalledPartyNumber; c_dword CIPMask; private: cp_callednumber m_CalledPartyNumber; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cp_facilityreq_wakeup : public CCStruct { public: cp_facilityreq_wakeup (c_word num, cp_facilityreq_wakeupparam *param) : CCStruct (cxt_FacilityReq_WakeUp, &NumberAwakeParameters, &m_Format[0]), NumberAwakeParameters (num), pWakeUpParam (param) { s_strncpy (&m_Format[0], cxf_02 cxf_ARRAY "\x00\x00", 5); set16 ((c_byte *)(m_Format + 2), num); } private: c_word NumberAwakeParameters; cp_facilityreq_wakeupparam *pWakeUpParam; tFormatChar m_Format[5]; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cp_facilityconf_wakeup : public CCStruct { public: cp_facilityconf_wakeup (void) : CCStruct (cxt_FacilityConf_WakeUp, &AcceptedAwakeParameters, cxf_02), AcceptedAwakeParameters (0) {} c_word AcceptedAwakeParameters; }; /*===========================================================================*\ \*===========================================================================*/ class cp_facility_supplserv : public CCStruct { public: cp_facility_supplserv (c_supplserv sfunc = supplserv_GetSupportedServices, CCStruct *param = 0) : CCStruct (cxt_FacilityParam_SupplServ, &Function, cxf_02 cxf_STRUCT), Function (sfunc), pParameter (param) {} c_supplserv Function; CCStruct *pParameter; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cp_facility_supplserv_ref : public cp_facility_supplserv { public: cp_facility_supplserv_ref (void) : cp_facility_supplserv (supplserv_GetSupportedServices, &m_Parameter) {} private: CCStruct m_Parameter; }; /*===========================================================================*\ \*===========================================================================*/ class cp_facility_supplserv_conf : public CCStruct { public: class ICConfParam : public CCStruct { public: ICConfParam (void) : CCStruct (cxt_FacilityParam_SupplServ, &Info, 2, cxf_INFO cxf_04), Info (ci_NoError), SupportedServices (0) {} c_info Info; c_dword SupportedServices; }; cp_facility_supplserv_conf (void) : CCStruct (cxt_FacilityParam_SupplServ, &Function, cxf_02 cxf_STRUCT), Function (supplserv_GetSupportedServices), pParameter (&m_Parameter) {} c_supplserv Function; ICConfParam *pParameter; private: ICConfParam m_Parameter; }; /*===========================================================================*\ \*===========================================================================*/ class cp_supplserv_cdreq : public CCStruct { public: cp_supplserv_cdreq (c_word allowed, CDynamicString *num) : CCStruct (cxt_FacilityParam_SupplServ, &PresentationAllowed, cxf_02 cxf_STRUCT), PresentationAllowed (allowed), pDeflectToNumber (&m_DeflectToNumber), m_DeflectToNumber (num) {} c_word PresentationAllowed; cp_facilitynumber *pDeflectToNumber; private: cp_facilitynumber m_DeflectToNumber; }; /*===========================================================================*\ \*===========================================================================*/ #pragma pack() #endif capi4hylafax-svn/src/capi/CapiBase.h0000644000175000017500000000640410470310075017133 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _CAPIBASE_H_ #define _CAPIBASE_H_ #include "CCSMesg.h" /*===========================================================================*\ \*===========================================================================*/ class CCallBackCapiBase; typedef tHandle thCapiBase; void CapiBase_Register (CCallBackCapiBase *pBaseClass, tUInt MsgBufSize, tUInt MaxB3Connection, tUInt MaxB3Blks, tUInt MaxSizeB3); void CapiBase_Release (thCapiBase Base); void CapiBase_PutMessage (thCapiBase Base, c_byte *pMessage); //void CapiBase_GetManufacturer (thCapiBase Base, tUInt Controller); //void CapiBase_GetVersion (thCapiBase Base, tUInt Controller); //void CapiBase_GetSerialNumber (thCapiBase Base, tUInt Controller); void CapiBase_GetProfile (thCapiBase Base, tUInt Controller); /*===========================================================================*\ \*===========================================================================*/ class CCallBackCapiBase { public: CCallBackCapiBase (void); virtual ~CCallBackCapiBase (void) {} c_word ApplID (void); void Set_ApplID (c_word ApplID); virtual void RegisterComplete (thCapiBase Base, c_info ErrorCode) = 0; virtual void ReleaseComplete (void) = 0; virtual void PutMessageComplete (c_info ErrorCode) = 0; virtual void GetMessageReceived (c_byte *pMessage, c_info ErrorCode) = 0; // return: vTrue - Okay, vFalse - Release was called or an very hard error occured //virtual void GetManufacturerComplete (c_byte * /*lpBuffer*/, c_info /*ErrorCode*/) {} //virtual void GetVersionComplete (c_byte * /*version*/, c_info /*ErrorCode*/) {} //virtual void GetSerialNumberComplete (c_byte * /*lpBuffer*/, c_info /*ErrorCode*/) {} virtual void GetProfileComplete (tUInt Controller, cm_getprofile *pProfile, c_info ErrorCode) = 0; private: c_word m_Applid; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline CCallBackCapiBase::CCallBackCapiBase (void) : m_Applid (IllegalApplID) { } inline c_word CCallBackCapiBase::ApplID (void) { return m_Applid; } inline void CCallBackCapiBase::Set_ApplID (c_word ApplID) { m_Applid = ApplID; } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/capi/CapiStat.h0000644000175000017500000001206510470310075017174 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _CAPISTAT_H_ #define _CAPISTAT_H_ #include "CapiLay.h" #include "ProtClas.h" /*===========================================================================*\ \*===========================================================================*/ class CCAPI20_Statistic : private CCAPI20_Layer { public: enum ctStatDeep { StatDeep_OnlyInstall, StatDeep_CountCntrl, StatDeep_CntrlProps, StatDeep_DSLProps, StatDeep_CntrlFacilities }; enum ctGlobalOptionsFlag { gof_InternalController = 0, gof_ExternalController = 1, gof_Handset = 2, gof_DTMF = 3, gof_SupplementaryServices = 4, gof_ChannelAllocation = 5, gof_BChannelOperation = 6 }; enum ctSupplServicesFlag { ssf_HoldRetrieve = 0, ssf_TerminalPortability = 1, ssf_ECT = 2, ssf_3PTY = 4, ssf_CallForwarding = 5, ssf_CD = 6, ssf_MCID = 7, ssf_CCBS = 8 }; CCAPI20_Statistic (ctStatDeep statdeep = StatDeep_CntrlFacilities); virtual ~CCAPI20_Statistic (void); void FreshUp (tBool FreshUpOnError = vTrue); virtual void FreshUpComplete (c_info Info); void SetFreshUpCallBack (void (*CallBackFunc) (void *Handle, c_info Info), void *Handle); tBool FreshUpInUse (void); void FreshUpCancel (void); c_info CapiInstalled (void); tUInt CountControllers (void); tUInt CountBChannels (tUInt Controller); c_dword Profile_GlobalOptions (tUInt Controller); c_dword Profile_B1Protocol (tUInt Controller); c_dword Profile_B2Protocol (tUInt Controller); c_dword Profile_B3Protocol (tUInt Controller); c_dword SupplServices (tUInt Controller); tUInt DSL_FindController (tUInt Controller = 0); // Start search at (Controller + 1) tUInt DSL_GetModemState (tUInt Controller); tUInt DSL_GetSpeed (tUInt Controller); tBool DSL_GetMACAddress (tUInt Controller, tUByte *pAddress); // sizeof (pAddress) >= 6 private: void REGISTER_COMPLETE (c_info ErrorCode); void RELEASE_COMPLETE (void); void GET_PROFILE_COMPLETE (tUInt Controller, cm_getprofile *pProfile, c_info ErrorCode); void FACILITY_CONF (c_word Messagenumber, c_dword Address, cm_facilityconf *Params); void MANUFACTURER_CONF (c_word Messagenumber, c_dword Controller, cm_manufacturer *Params); tBool MANUFACTURER_IND (c_word Messagenumber, c_dword Controller, cm_manufacturer *Params); void DSLManuReq (tUInt Controller, CCStruct *pManuData); void CallFinished (void); void UpdateCurrent (c_info Info); struct ctIntCntrlData { tUInt NumBChannels; c_dword GlobalOptions; c_dword B1ProtocolSupport; c_dword B2ProtocolSupport; c_dword B3ProtocolSupport; c_dword SupplServices; tUInt DSL_ModemState; tUInt DSL_Speed; tUByte DSL_MACAddress [6]; tUByte DSL_Retries; }; struct ctIntCapiData { c_info CapiInstalled; tUInt CountControllers; ctIntCntrlData *pControllerData; }; CProtectClass m_Protect; ctIntCapiData *m_pCurrentData; ctIntCapiData *m_pFreshingData; tUInt m_FreshingController; ctStatDeep m_Deep; tUInt m_CountReqCalls; void (*m_CallBackFunc) (void *, c_info); void *m_CallBackHandle; tBool m_FreshOnError; }; /*===========================================================================*\ \*===========================================================================*/ inline void CCAPI20_Statistic::SetFreshUpCallBack (void (*CallBackFunc) (void *, c_info), void *Handle) { m_CallBackHandle = Handle; m_CallBackFunc = CallBackFunc; } inline tBool CCAPI20_Statistic::FreshUpInUse (void) { return (m_pFreshingData != 0); } inline void CCAPI20_Statistic::FreshUpCancel (void) { if (m_pFreshingData != 0) { RELEASE(); } } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/capi/capi2def.h0000644000175000017500000004137310470310075017145 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _CAPI2DEF_H_ #define _CAPI2DEF_H_ #include "aTypes.h" #include "InfoType.h" #include "osmem.h" /*===========================================================================*\ \*===========================================================================*/ #define IllegalApplID 0 #define IllegalController 0 #define IllegalPLCI 0 #define IllegalNCCI 0 /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define CAPI_DEFAULT_S0_LINES_COUNT 2 #define CAPI_MAX_MESSAGE_SIZE 4096 #define CAPI_MAX_DATA_SIZE 2048 #define CAPI_MAX_OUTSTANDING_FRAMES 8 #define CAPI_MAX_CONTROLLER_NUMBER 127 #define CAPI_MIN_DATA_SIZE 100 #define CAPI_MIN_OUTSTANDING_FRAMES 2 #define CALLNUM_INDICATOR_DEFAULT ((tUByte) 0x80) #define CALLNUM_INDICATOR_SUPPRESS ((tUByte) 0xA0) /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ /*----- basic-type definitions -----*/ typedef tUByte c_byte; typedef tUInt16 c_word; typedef tUInt32 c_dword; typedef tUInt64 c_qword; typedef c_byte *c_message; typedef c_byte *c_dataptr; /*----- capi state machine type and values -----*/ enum _tCapiState { // DO NOT CHANGE THE ORDER!! cs_Released, // inital state cs_Releasing, // => initial state cs_Registering, // building up to register state cs_RegisterDelayed, // CAPI not ready, so remember Register and complete a 2. time later cs_Registered, // listen or make call state cs_D_DisconnectRespPending, // Ind received, waiting for DataB3Resp => => cs_Registered cs_D_DisconnectPending, // => cs_Registered cs_CallDeflecting, // => cs_Registered cs_D_ConnectRequest, // start make call => cs_D_ConnectPending cs_D_ConnectIndication, // get incoming call => Answer => cs_D_ConnectPending cs_ResumePending, // => D-Channel state cs_D_ConnectPending, // => D-Channel state cs_SuspendPending, // => cs_D_DisconnectPending cs_Holded, // Holded state cs_HoldPending, // from cs_D_Connected to cs_Holded cs_RetrievePending, // from cs_Holded to cs_D_Connected cs_ProtocolPending, // SelectBProtocol in use => cs_D_Connected cs_D_Connected, // D-Channel (connected) state cs_B_DisconnectRespPending, // Ind received, waiting for DataB3Resp => D-Channel state cs_B_DisconnectPending, // => cs_B_DisconnectRespPending cs_B_ConnectPending, // => B-Channel state cs_Connected // B-Channel (connected) state }; typedef tUInt tCapiState; /*----- errornumbers -----*/ enum c_info { ci_NoError = 0x0000, ci_Wrn_NCPIignored = 0x0001, ci_Wrn_FlagsIgnored = 0x0002, ci_Wrn_AlertAlreadySend = 0x0003, ci_Wrn_HighestWarningValue = 0x00FF, // Special Warning Value ci_Reg_ToManyAppls = 0x1001, ci_Reg_LogBlkSizeToSmall = 0x1002, ci_Reg_BuffExeceeds64k = 0x1003, ci_Reg_MsgBufSizeToSmall = 0x1004, ci_Reg_NumLogConnNotSupported = 0x1005, ci_Reg_Reserved = 0x1006, ci_Reg_Busy = 0x1007, ci_Reg_OSResourceErr = 0x1008, ci_Reg_NotInstalled = 0x1009, ci_Reg_CtrlerNotSupportExtEquip = 0x100a, ci_Reg_CtrlerOnlySupportExtEquip = 0x100b, ci_Msg_IllAppNr = 0x1101, ci_Msg_IllCmdOrSubcmdOrMsgToSmall = 0x1102, ci_Msg_SendQueueFull = 0x1103, ci_Msg_ReceiveQueueEmpty = 0x1104, ci_Msg_ReceiveOverflow = 0x1105, ci_Msg_UnknownNotPar = 0x1106, ci_Msg_Busy = 0x1107, ci_Msg_OSResourceErr = 0x1108, ci_Msg_NotInstalled = 0x1109, ci_Msg_CtrlerNotSupportExtEquip = 0x110a, ci_Msg_CtrlerOnlySupportExtEquip = 0x110b, ci_Cod_MsgNotSupportInCurState = 0x2001, ci_Cod_IllegalAddress = 0x2002, ci_Cod_OutOfPLCI = 0x2003, ci_Cod_OutOfNCCI = 0x2004, ci_Cod_OutOfListen = 0x2005, ci_Cod_OutOfFax = 0x2006, ci_Cod_IllegalMsgParamCoding = 0x2007, ci_Ser_B1ProtNotSupported = 0x3001, ci_Ser_B2ProtNotSupported = 0x3002, ci_Ser_B3ProtNotSupported = 0x3003, ci_Ser_B1ProtParamNotSupported = 0x3004, ci_Ser_B2ProtParamNotSupported = 0x3005, ci_Ser_B3ProtParamNotSupported = 0x3006, ci_Phy_ProtErrLayer1 = 0x3301, ci_Phy_ProtErrLayer2 = 0x3302, ci_Phy_ProtErrLayer3 = 0x3303, ci_Phy_T30ConnectToNoFax = 0x3311, ci_Net_UnspecifiedCallClearing = 0x3400, // The following values are enhancements of the C++ CAPI state machine ant NOT(!) CAPI conform. ci_Int_IncorrectDTMFDigit = 0xFF00, // Mapping of "DTMF Information" into c_info. ci_Int_UnknownDTMFRequest = 0xFF01, // Mapping of "DTMF Information" into c_info. ci_Int_MemoryFullErr = 0xFFF0, // "new" returns a NULL Pointer ci_Int_NotConnected = 0xFFF1, // B-Channel not established anymore ci_Int_MsgSizeOverflow = 0xFFF2, // Message length is greater than CAPI_MAX_MESSAGE_SIZE ci_Int_TimerInitFailure = 0xFFF3, // A needed Timer couldn't be initialized ci_Int_IllegalState = 0xFFF4, ci_Int_FunctionInUse = 0xFFF5, ci_Int_OSResourceErr = 0xFFF6, // Problems with the OS so we can't do what was requested ci_Int_RegisterDelayed = 0xFFFF // CAPI not ready so wait and call RegisterComplete later a second time }; /*----- rejectvalues -----*/ enum c_reject { creject_Accept = 0, creject_Ignore = 1, creject_Reject_Normal = 2, creject_Reject_Busy = 3, creject_Reject_NotAvailable = 4, creject_Reject_Facility = 5, creject_Reject_Unacceptable = 6, creject_Reject_Incompatible = 7, creject_Reject_OutOfOrder = 8 }; /*----- CIP Values -----*/ enum c_cipvalue { cipvalue_Undefined = 0, cipvalue_Speech = 1, cipvalue_Digital = 2, cipvalue_RestrictedDigital = 3, cipvalue_3_1kHzAudio = 4, cipvalue_7kHzAudio = 5, cipvalue_Video = 6, cipvalue_PacketMode = 7, cipvalue_56kBitRateAdaption = 8, cipvalue_UnrestDigitalTones = 9, cipvalue_Telephony = 16, cipvalue_G3Fax = 17, cipvalue_G4Fax = 18, cipvalue_TeletexG4Fax = 19, cipvalue_TeletexProcessable = 20, cipvalue_TeletexBasicMode = 21, cipvalue_Videotex = 22, cipvalue_Telex = 23, cipvalue_MessageHandlingSystems = 24, cipvalue_OSIApplication = 25, cipvalue_7kHzTelephony = 26, cipvalue_VideoTelephony1 = 27, cipvalue_VideoTelephony2 = 28, }; /*----- CIP Masks -----*/ enum c_cipmask { cipmask_Undefined = (1 << cipvalue_Undefined), cipmask_Speech = (1 << cipvalue_Speech), cipmask_Digital = (1 << cipvalue_Digital), cipmask_RestrictedDigital = (1 << cipvalue_RestrictedDigital), cipmask_3_1kHzAudio = (1 << cipvalue_3_1kHzAudio), cipmask_7kHzAudio = (1 << cipvalue_7kHzAudio), cipmask_Video = (1 << cipvalue_Video), cipmask_PacketMode = (1 << cipvalue_PacketMode), cipmask_56kBitRateAdaption = (1 << cipvalue_56kBitRateAdaption), cipmask_UnrestDigitalTones = (1 << cipvalue_UnrestDigitalTones), cipmask_Telephony = (1 << cipvalue_Telephony), cipmask_G3Fax = (1 << cipvalue_G3Fax), cipmask_G4Fax = (1 << cipvalue_G4Fax), cipmask_TeletexG4Fax = (1 << cipvalue_TeletexG4Fax), cipmask_TeletexProcessable = (1 << cipvalue_TeletexProcessable), cipmask_TeletexBasicMode = (1 << cipvalue_TeletexBasicMode), cipmask_Videotex = (1 << cipvalue_Videotex), cipmask_Telex = (1 << cipvalue_Telex), cipmask_MessageHandlingSystems = (1 << cipvalue_MessageHandlingSystems), cipmask_OSIApplication = (1 << cipvalue_OSIApplication), cipmask_7kHzTelephony = (1 << cipvalue_7kHzTelephony), cipmask_VideoTelephony1 = (1 << cipvalue_VideoTelephony1), cipmask_VideoTelephony2 = (1 << cipvalue_VideoTelephony2) }; /*----- Info Masks -----*/ enum c_infomask { infomask_Cause = 0x0001, infomask_DateTime = 0x0002, infomask_Display = 0x0004, infomask_UserUser = 0x0008, infomask_CallProgress = 0x0010, infomask_Facility = 0x0020, infomask_ChargeInfo = 0x0040, infomask_CalledPartyNum = 0x0080, infomask_ChannelInfo = 0x0100, infomask_EarlyB3Connect = 0x0200, infomask_RedirectInfo = 0x0400, infomask_SendingComplete = 0x1000 }; /*----- B - Protocols -----*/ enum c_b1prot { b1prot_HDLC = 0, b1prot_Transparent = 1, b1prot_V110_asynch = 2, b1prot_V110_synch = 3, b1prot_G3Fax = 4, b1prot_invertedHDLC = 5, b1prot_56kBitTransparent = 6, b1prot_Modem_negotiate = 7, b1prot_Modem_asynch = 8, b1prot_Modem_synch = 9, b1prot_ATM = 28 }; enum c_b2prot { b2prot_X75 = 0, b2prot_Transparent = 1, b2prot_SDLC = 2, b2prot_LAPD = 3, b2prot_G3Fax = 4, b2prot_PPP = 5, b2prot_IgnoreFramingError = 6, b2prot_Modem_negotiate = 7, b2prot_X75_V42bis = 8, b2prot_V120_asynch = 9, b2prot_V120_V42bis_asynch = 10, b2prot_V120_transparent = 11, b2prot_LAPD_SAPI = 12, b2prot_ADSL = 30 }; enum c_b3prot { b3prot_Transparent = 0, b3prot_T90NL = 1, b3prot_ISO8208 = 2, b3prot_X25 = 3, b3prot_G3Fax = 4, b3prot_G3Fax_extended = 5, //b3prot_reserved = 6, Reserved == not usable => doesn't need to be defined b3prot_Modem = 7, b3prot_ADSL = 30 }; /*----- facility -----*/ enum c_facilselect { facilselect_Handset = 0, facilselect_DTMF = 1, facilselect_V42Compression = 2, facilselect_SupplServices = 3, facilselect_PMWakeup = 4, }; enum c_supplserv { supplserv_GetSupportedServices = 0x0000, supplserv_Listen = 0x0001, supplserv_Hold = 0x0002, supplserv_Retrieve = 0x0003, supplserv_Suspend = 0x0004, supplserv_Resume = 0x0005, supplserv_ECT = 0x0006, supplserv_3PTY_Begin = 0x0007, supplserv_3PTY_End = 0x0008, supplserv_CF_Activate = 0x0009, supplserv_CF_Deactivate = 0x000A, supplserv_CF_InterrogateParams = 0x000B, supplserv_CF_InterrogateNumbers = 0x000C, supplserv_CD = 0x000D, supplserv_MCID = 0x000E, supplserv_CCBS_Request = 0x000F, supplserv_CCBS_Deactivate = 0x0010, supplserv_CCBS_Interrogate = 0x0011, supplserv_CCBS_Call = 0x0012, // Supplementary Services Notfications supplserv_Hold_Notify = 0x8000, supplserv_Retrieve_Notify = 0x8001, supplserv_Suspend_Notify = 0x8002, supplserv_Resume_Notify = 0x8003, supplserv_CallIsDiverting_Notify = 0x8004, supplserv_DiversionActive_Notify = 0x8005, supplserv_CF_Activate_Notify = 0x8006, supplserv_CF_Deactivate_Notify = 0x8007, supplserv_Diversion_Information = 0x8008, supplserv_CT_Alerted_Notify = 0x8009, supplserv_CT_Active_Notify = 0x800A, supplserv_ConferenceEstablished = 0x800B, supplserv_ConferenceDisconnected = 0x800C, supplserv_CCBS_EraseCallLinkID = 0x800D, supplserv_CCBS_Status = 0x800E, supplserv_CCBS_RemoteUserFree = 0x800F, supplserv_CCBS_B_Free = 0x8010, supplserv_CCBS_Erase = 0x8011, supplserv_CCBS_StopAlerting = 0x8012, supplserv_CCBS_InfoRetain = 0x8013 }; enum c_dtmffunction { dtmffunction_StartListen = 1, dtmffunction_StopListen = 2, dtmffunction_SendDigits = 3 }; enum c_forwardtype { forwardtype_Unconditional = 0, forwardtype_Busy = 1, forwardtype_NoReply = 2 }; enum c_b3_faxextended_options { b3_faxextopt_highres = 0x0001, b3_faxextopt_poll = 0x0002, b3_faxextopt_jpeg = 0x0400, b3_faxextopt_jbig = 0x0800, b3_faxextopt_nojbigpro = 0x1000, b3_faxextopt_nomrcomp = 0x2000, b3_faxextopt_nommrcomp = 0x4000, b3_faxextopt_noecm = 0x8000 }; enum c_ncpi_faxextended_options { ncpi_faxextopt_highres = 0x0001, ncpi_faxextopt_poll = 0x0002, ncpi_faxextopt_pollafter = 0x0004, ncpi_faxextopt_jpeg = 0x0400, ncpi_faxextopt_jbig = 0x0800, ncpi_faxextopt_jbigpro = 0x1000, ncpi_faxextopt_mrcomp = 0x2000, ncpi_faxextopt_mmrcomp = 0x4000, ncpi_faxextopt_noecm = 0x8000 }; /*---------------------------------------------------------------------------*\ Convert PLCI and NCCI \*---------------------------------------------------------------------------*/ #define GetControllerFromPLCI(plci) (plci & 0x0000007F) #define GetControllerFromNCCI(ncci) (ncci & 0x0000007F) #define GetPLCIFromNCCI(ncci) (ncci & 0x0000FFFF) /*---------------------------------------------------------------------------*\ CapiInfoIs... Makros \*---------------------------------------------------------------------------*/ #define CapiInfoIsSuccess(info) ((info) <= ci_Wrn_HighestWarningValue) #define CapiInfoIsError(info) ((info) > ci_Wrn_HighestWarningValue) #define CapiInfoIsRegError(info) (((info) & 0xFF00) == 0x1000) #define MapCapiErr2Info(val) ((!val) ? i_Okay : CalculateInfoValue (infoType_Capi, \ CapiInfoIsError (val) ? infoKind_Error : infoKind_Warning, (val))) /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #endif capi4hylafax-svn/src/capi/DCMTrace.h0000644000175000017500000000400510470310075017041 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _DCMTRACE_H_ #define _DCMTRACE_H_ #include "capi2def.h" /*===========================================================================*\ \*===========================================================================*/ #define CMTRACE_Unknown 0 #define CMTRACE_Register 1 #define CMTRACE_Release 2 #define CMTRACE_GetProfile 3 #define CMTRACE_PutMessage 4 #define CMTRACE_GetMessage 5 /*===========================================================================*\ \*===========================================================================*/ //void DbgCapiMsgTraceInit (tUChar *FileName); //void DbgCapiMsgTraceDeInit (void); #ifndef NDEBUG void DbgCapiMsgTrace (c_message theMsg, c_info error = ci_NoError, unsigned kind = CMTRACE_Unknown); #else inline void DbgCapiMsgTrace (c_message /*theMsg*/, c_info /*error*/, unsigned /*kind*/) {} #endif /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/capi/CapiLay.h0000644000175000017500000000470310470310075017006 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _CAPILAY_H_ #define _CAPILAY_H_ #include "CapiMsg.h" #include "PLCIList.h" /*===========================================================================*\ \*===========================================================================*/ class CCAPI20_Layer : public CCAPI20_MsgBase { public: CCAPI20_Layer (void); virtual ~CCAPI20_Layer (void); c_word GetNextMsgNr (void); tBool SetNewPLCIEntry (c_dword PLCI); void FreePLCIEntry (c_dword PLCI); private: c_word nr; static tUInt CountLayers; }; /*===========================================================================*\ \*===========================================================================*/ inline CCAPI20_Layer::CCAPI20_Layer (void) { nr = 0; // assert (CountLayers + 1 != 0); // IMPORTANT: Ich gehe davon aus, daß dieser Constructor serialized aufgerufen wird if (CountLayers++ == 0) { if (InitPLCIList() == vFalse) { // assert (0); // TODO: was nun? } } } inline CCAPI20_Layer::~CCAPI20_Layer (void) { // assert (CountLayers > 0); if (--CountLayers == 0) { DeinitPLCIList(); } } inline c_word CCAPI20_Layer::GetNextMsgNr (void) { return ++nr; } inline tBool CCAPI20_Layer::SetNewPLCIEntry (c_dword PLCI) { return TestAndSetPLCIEntry (PLCI); } inline void CCAPI20_Layer::FreePLCIEntry (c_dword PLCI) { if (PLCI != IllegalPLCI) { UnsetPLCIEntry (PLCI); } } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/capi/PLCIList.h0000644000175000017500000000300410470310075017040 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _PLCILIST_H_ #define _PLCILIST_H_ #include "aTypes.h" /*===========================================================================*\ \*===========================================================================*/ tBool InitPLCIList (void); void DeinitPLCIList (void); /*===========================================================================*\ \*===========================================================================*/ tBool TestAndSetPLCIEntry (tUInt PLCI); void UnsetPLCIEntry (tUInt PLCI); /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/capi/CapiMsg.h0000644000175000017500000005452510470310075017016 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _CAPIMSG_H_ #define _CAPIMSG_H_ #include "CapiBase.h" #include "c2msgdef.h" #include "DynStore.h" #include "ProtClas.h" #include /*===========================================================================*\ \*===========================================================================*/ class CCAPI20_MsgBase : private CCallBackCapiBase { public: CCAPI20_MsgBase (void); virtual ~CCAPI20_MsgBase (void); c_word GetApplID (void); /*-----------------------------------------------------------------------*\ CAPI - REGISTER, RELEASE, GET_PROFILE \*-----------------------------------------------------------------------*/ void REGISTER (tUInt MaxB3Connection, tUInt MaxB3Blks, tUInt MaxSizeB3); void RELEASE (void); void GET_PROFILE (tUInt Controller); virtual void REGISTER_COMPLETE (c_info ErrorCode) = 0; virtual void RELEASE_COMPLETE (void) = 0; virtual void GET_PROFILE_COMPLETE (tUInt /*Controller*/, cm_getprofile * /*pProfile*/, c_info /*ErrorCode*/) {} /*-----------------------------------------------------------------------*\ CAPI - Requests \*-----------------------------------------------------------------------*/ void ALERT_REQ (c_word Messagenumber, c_dword PLCI, CCStruct *pAdditionalInfo); void CONNECT_REQ (c_word Messagenumber, c_dword Controller, cm_connectreq *Params); void CONNECT_B3_REQ (c_word Messagenumber, c_dword PLCI, CCStruct *pNCPI); void DATA_B3_REQ (c_word Messagenumber, c_dword NCCI, cm_datab3 *Params); void DISCONNECT_B3_REQ (c_word Messagenumber, c_dword NCCI, CCStruct *pNCPI); void DISCONNECT_REQ (c_word Messagenumber, c_dword PLCI); void FACILITY_REQ (c_word Messagenumber, c_dword Address, cm_facilityreq *Params); void INFO_REQ (c_word Messagenumber, c_dword Address, cm_inforeq *Params); void LISTEN_REQ (c_word Messagenumber, c_dword Controller, cm_listenreq *Params); void MANUFACTURER_REQ (c_word Messagenumber, c_dword Controller, cm_manufacturer *Params); void RESET_B3_REQ (c_word Messagenumber, c_dword NCCI, CCStruct *pNCPI); void SELECT_B_PROTOCOL_REQ (c_word Messagenumber, c_dword PLCI, cp_bprotocol *Params); /*-----------------------------------------------------------------------*\ virtual CAPI - Confirmation \*-----------------------------------------------------------------------*/ virtual void ALERT_CONF (c_word /*Messagenumber*/, c_dword /*PLCI*/, c_info /*Info*/) {} virtual void CONNECT_CONF (c_word /*Messagenumber*/, c_dword /*PLCI*/, c_info /*Info*/) {} virtual void CONNECT_B3_CONF (c_word /*Messagenumber*/, c_dword /*NCCI*/, c_info /*Info*/) {} virtual void DATA_B3_CONF (c_word /*Messagenumber*/, c_dword /*NCCI*/, cm_datab3conf * /*Params*/) {} virtual void DISCONNECT_B3_CONF (c_word /*Messagenumber*/, c_dword /*NCCI*/, c_info /*Info*/) {} virtual void DISCONNECT_CONF (c_word /*Messagenumber*/, c_dword /*PLCI*/, c_info /*Info*/) {} virtual void FACILITY_CONF (c_word /*Messagenumber*/, c_dword /*Address*/, cm_facilityconf * /*Params*/) {} virtual void INFO_CONF (c_word /*Messagenumber*/, c_dword /*Address*/, c_info /*Info*/) {} virtual void LISTEN_CONF (c_word /*Messagenumber*/, c_dword /*Controller*/, c_info /*Info*/) {} virtual void MANUFACTURER_CONF (c_word /*Messagenumber*/, c_dword /*Controller*/, cm_manufacturer * /*Params*/) {} virtual void RESET_B3_CONF (c_word /*Messagenumber*/, c_dword /*NCCI*/, c_info /*Info*/) {} virtual void SELECT_B_PROTOCOL_CONF (c_word /*Messagenumber*/, c_dword /*PLCI*/, c_info /*Info*/) {} /*-----------------------------------------------------------------------*\ virtual CAPI - Indications \*-----------------------------------------------------------------------*/ virtual tBool CONNECT_IND (c_word Messagenumber, c_dword PLCI, cm_connectind *Params); virtual tBool CONNECT_ACTIVE_IND (c_word Messagenumber, c_dword PLCI, cm_connectactiveind *Params); virtual tBool CONNECT_B3_IND (c_word Messagenumber, c_dword NCCI, CCStruct *pNCPI); virtual tBool CONNECT_B3_ACTIVE_IND (c_word Messagenumber, c_dword NCCI, CCStruct *pNCPI); virtual tBool CONNECT_B3_T90_ACTIVE_IND (c_word Messagenumber, c_dword NCCI); virtual tBool DATA_B3_IND (c_word Messagenumber, c_dword NCCI, cm_datab3 *Params); virtual tBool DISCONNECT_B3_IND (c_word Messagenumber, c_dword NCCI, cm_disconnectb3ind *Params); virtual tBool DISCONNECT_IND (c_word Messagenumber, c_dword PLCI, c_info Reason); virtual tBool FACILITY_IND (c_word Messagenumber, c_dword Address, cm_facilityind *Params); virtual tBool INFO_IND (c_word Messagenumber, c_dword Address, cm_infoind *Params); virtual tBool MANUFACTURER_IND (c_word Messagenumber, c_dword Controller, cm_manufacturer *Params); virtual tBool RESET_B3_IND (c_word Messagenumber, c_dword NCCI, CCStruct *pNCPI); /*-----------------------------------------------------------------------*\ CAPI - Responses \*-----------------------------------------------------------------------*/ void CONNECT_RESP (c_word Messagenumber, c_dword PLCI, cm_connectresp *Params); void CONNECT_ACTIVE_RESP (c_word Messagenumber, c_dword PLCI); void CONNECT_B3_RESP (c_word Messagenumber, c_dword NCCI, cm_connectb3resp *Params); void CONNECT_B3_ACTIVE_RESP (c_word Messagenumber, c_dword NCCI); void CONNECT_B3_T90_ACTIVE_RESP (c_word Messagenumber, c_dword NCCI); void DATA_B3_RESP (c_word Messagenumber, c_dword NCCI, cm_datab3resp *Params); void DISCONNECT_B3_RESP (c_word Messagenumber, c_dword NCCI); void DISCONNECT_RESP (c_word Messagenumber, c_dword PLCI); void FACILITY_RESP (c_word Messagenumber, c_dword Address, cm_facilityresp *Params); void INFO_RESP (c_word Messagenumber, c_dword Address); void MANUFACTURER_RESP (c_word Messagenumber, c_dword Controller, cm_manufacturer *Params); void RESET_B3_RESP (c_word Messagenumber, c_dword NCCI); /*-----------------------------------------------------------------------*\ Error Handling \*-----------------------------------------------------------------------*/ virtual void HandleMessageError (tUInt type, c_info ErrorCode, c_message cmsg); // type: 0 = PutMessage, 1 = GetMessage, 2 = GetProfile // cmsg: Nur bei PutMessage != 0 !! private: /*-----------------------------------------------------------------------*\ Virtuelle Funktionen von CCAPI20_Base \*-----------------------------------------------------------------------*/ void RegisterComplete (thCapiBase hBase, c_info ErrorCode); void ReleaseComplete (void); void PutMessageComplete (c_info ErrorCode); void GetMessageReceived (c_byte *pReturnMessage, c_info ErrorCode); void GetProfileComplete (tUInt Controller, cm_getprofile *pProfile, c_info ErrorCode); /*-----------------------------------------------------------------------*\ Interne Funtkionen \*-----------------------------------------------------------------------*/ void AllocAndPutMsg (c_byte Command, c_byte SubCommand, c_word Messagenumber, c_dword Address, tBool ZeroIsEmptyStruct, CCStruct *Params); void FreeCurPutMsg (void); void EmptyPutMsgbufferQueue (void); void HandleGetMessage (c_byte *Message); /*-----------------------------------------------------------------------*\ Interne Klassen und Variablen \*-----------------------------------------------------------------------*/ CDynStoreQueue PutMsgbufferQueue; CProtectClass m_Protect; thCapiBase m_hCapiBase; c_message m_CurPutMessage; #ifndef NDEBUG tUInt m_RegisterState; #endif }; /*===========================================================================*\ inline Funktionen der Klasse CCAPI20_MsgBase \*===========================================================================*/ inline c_word CCAPI20_MsgBase::GetApplID (void) { return ApplID(); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline void CCAPI20_MsgBase::GET_PROFILE (tUInt Controller) { //dassert (m_hCapiBase != vIllegalHandle); CapiBase_GetProfile (m_hCapiBase, Controller); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline void CCAPI20_MsgBase::GetProfileComplete (tUInt Controller, cm_getprofile *pProfile, c_info ErrorCode) { if (ErrorCode != ci_NoError) { //dassert (ErrorCode != ci_Msg_Busy); //dassert (ErrorCode != ci_Msg_SendQueueFull); // TODO: H.M.E.-Call with Controller & pProfile Info HandleMessageError (2, ErrorCode, 0); } GET_PROFILE_COMPLETE (Controller, pProfile, ErrorCode); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline void CCAPI20_MsgBase::FreeCurPutMsg (void) { m_Protect.BeginWrite(); c_byte *toDel = m_CurPutMessage; m_CurPutMessage = 0; m_Protect.EndWrite(); PutMsgbufferQueue.Free (toDel); } /*===========================================================================*\ CCAPI20_MsgBase: Fast alle CAPI - Requests \*===========================================================================*/ inline void CCAPI20_MsgBase::ALERT_REQ (c_word Messagenumber, c_dword PLCI, CCStruct *pAdditionalInfo) { AllocAndPutMsg (CAPI_ALERT, CAPI_REQ, Messagenumber, PLCI, vTrue, pAdditionalInfo); } inline void CCAPI20_MsgBase::CONNECT_REQ (c_word Messagenumber, c_dword Controller, cm_connectreq *Params) { AllocAndPutMsg (CAPI_CONNECT, CAPI_REQ, Messagenumber, Controller, vTrue, Params); } inline void CCAPI20_MsgBase::CONNECT_RESP (c_word Messagenumber, c_dword PLCI, cm_connectresp *Params) { AllocAndPutMsg (CAPI_CONNECT, CAPI_RESP, Messagenumber, PLCI, vTrue, Params); } inline void CCAPI20_MsgBase::CONNECT_B3_REQ (c_word Messagenumber, c_dword PLCI, CCStruct *pNCPI) { AllocAndPutMsg (CAPI_CONNECT_B3, CAPI_REQ, Messagenumber, PLCI, vTrue, pNCPI); } inline void CCAPI20_MsgBase::DATA_B3_REQ (c_word Messagenumber, c_dword NCCI, cm_datab3 *Params) { AllocAndPutMsg (CAPI_DATA_B3, CAPI_REQ, Messagenumber, NCCI, vTrue, Params); } inline void CCAPI20_MsgBase::DISCONNECT_B3_REQ (c_word Messagenumber, c_dword NCCI, CCStruct *pNCPI) { AllocAndPutMsg (CAPI_DISCONNECT_B3, CAPI_REQ, Messagenumber, NCCI, vTrue, pNCPI); } inline void CCAPI20_MsgBase::DISCONNECT_REQ (c_word Messagenumber, c_dword PLCI) { AllocAndPutMsg (CAPI_DISCONNECT, CAPI_REQ, Messagenumber, PLCI, vTrue, 0); } inline void CCAPI20_MsgBase::FACILITY_REQ (c_word Messagenumber, c_dword Address, cm_facilityreq *Params) { AllocAndPutMsg (CAPI_FACILITY, CAPI_REQ, Messagenumber, Address, vTrue, Params); } inline void CCAPI20_MsgBase::INFO_REQ (c_word Messagenumber, c_dword Address, cm_inforeq *Params) { AllocAndPutMsg (CAPI_INFO, CAPI_REQ, Messagenumber, Address, vTrue, Params); } inline void CCAPI20_MsgBase::LISTEN_REQ (c_word Messagenumber, c_dword Controller, cm_listenreq *Params) { AllocAndPutMsg (CAPI_LISTEN, CAPI_REQ, Messagenumber, Controller, vTrue, Params); } inline void CCAPI20_MsgBase::MANUFACTURER_REQ (c_word Messagenumber, c_dword Controller, cm_manufacturer *Params) { AllocAndPutMsg (CAPI_MANUFACTURER, CAPI_REQ, Messagenumber, Controller, vTrue, Params); } inline void CCAPI20_MsgBase::RESET_B3_REQ (c_word Messagenumber, c_dword NCCI, CCStruct *pNCPI) { AllocAndPutMsg (CAPI_RESET_B3, CAPI_REQ, Messagenumber, NCCI, vTrue, pNCPI); } inline void CCAPI20_MsgBase::SELECT_B_PROTOCOL_REQ (c_word Messagenumber, c_dword PLCI, cp_bprotocol *Params) { AllocAndPutMsg (CAPI_SELECT_B_PROTOCOL, CAPI_REQ, Messagenumber, PLCI, vTrue, Params); } /*===========================================================================*\ CCAPI20_MsgBase: Alle CAPI - Indications \*===========================================================================*/ inline tBool CCAPI20_MsgBase::CONNECT_IND (c_word Messagenumber, c_dword PLCI, cm_connectind *) { cm_connectresp crIgnore; CONNECT_RESP (Messagenumber, PLCI, &crIgnore); return vTrue; } inline tBool CCAPI20_MsgBase::CONNECT_ACTIVE_IND (c_word Messagenumber, c_dword PLCI, cm_connectactiveind *) { CONNECT_ACTIVE_RESP (Messagenumber, PLCI); DISCONNECT_REQ (0, PLCI); return vTrue; } inline tBool CCAPI20_MsgBase::CONNECT_B3_IND (c_word Messagenumber, c_dword NCCI, CCStruct *) { cm_connectb3resp cb3r; CONNECT_B3_RESP (Messagenumber, NCCI, &cb3r); return vTrue; } inline tBool CCAPI20_MsgBase::CONNECT_B3_ACTIVE_IND (c_word Messagenumber, c_dword NCCI, CCStruct *) { CONNECT_B3_ACTIVE_RESP (Messagenumber, NCCI); DISCONNECT_B3_REQ (0, NCCI, 0); return vTrue; } inline tBool CCAPI20_MsgBase::CONNECT_B3_T90_ACTIVE_IND (c_word Messagenumber, c_dword NCCI) { CONNECT_B3_T90_ACTIVE_RESP (Messagenumber, NCCI); return vTrue; } inline tBool CCAPI20_MsgBase::DATA_B3_IND (c_word Messagenumber, c_dword NCCI, cm_datab3 *Params) { // dassert (Params != 0); cm_datab3resp db3r (Params->DataHandle); DATA_B3_RESP (Messagenumber, NCCI, &db3r); return vTrue; } inline tBool CCAPI20_MsgBase::DISCONNECT_B3_IND (c_word Messagenumber, c_dword NCCI, cm_disconnectb3ind *) { DISCONNECT_B3_RESP (Messagenumber, NCCI); return vTrue; } inline tBool CCAPI20_MsgBase::DISCONNECT_IND (c_word Messagenumber, c_dword PLCI, c_info) { DISCONNECT_RESP (Messagenumber, PLCI); return vTrue; } inline tBool CCAPI20_MsgBase::FACILITY_IND (c_word Messagenumber, c_dword Address, cm_facilityind *Params) { // dassert (Params != 0); cm_facilityresp RespParams (Params->FacilitySelector, 0); FACILITY_RESP (Messagenumber, Address, &RespParams); return vTrue; } inline tBool CCAPI20_MsgBase::INFO_IND (c_word Messagenumber, c_dword Address, cm_infoind *) { INFO_RESP (Messagenumber, Address); return vTrue; } inline tBool CCAPI20_MsgBase::MANUFACTURER_IND (c_word Messagenumber, c_dword Controller, cm_manufacturer *Params) { MANUFACTURER_RESP (Messagenumber, Controller, Params); return vTrue; } inline tBool CCAPI20_MsgBase::RESET_B3_IND (c_word Messagenumber, c_dword NCCI, CCStruct *) { RESET_B3_RESP (Messagenumber, NCCI); return vTrue; } /*===========================================================================*\ CCAPI20_MsgBase: Nearly All CAPI - Responses \*===========================================================================*/ inline void CCAPI20_MsgBase::CONNECT_ACTIVE_RESP (c_word Messagenumber, c_dword PLCI) { AllocAndPutMsg (CAPI_CONNECT_ACTIVE, CAPI_RESP, Messagenumber, PLCI, vFalse, 0); } inline void CCAPI20_MsgBase::CONNECT_B3_RESP (c_word Messagenumber, c_dword NCCI, cm_connectb3resp *Params) { AllocAndPutMsg (CAPI_CONNECT_B3, CAPI_RESP, Messagenumber, NCCI, vTrue, Params); } inline void CCAPI20_MsgBase::CONNECT_B3_ACTIVE_RESP (c_word Messagenumber, c_dword NCCI) { AllocAndPutMsg (CAPI_CONNECT_B3_ACTIVE, CAPI_RESP, Messagenumber, NCCI, vFalse, 0); } inline void CCAPI20_MsgBase::CONNECT_B3_T90_ACTIVE_RESP (c_word Messagenumber, c_dword NCCI) { AllocAndPutMsg (CAPI_CONNECT_B3_T90_ACTIVE, CAPI_RESP, Messagenumber, NCCI, vFalse, 0); } inline void CCAPI20_MsgBase::DATA_B3_RESP (c_word Messagenumber, c_dword NCCI, cm_datab3resp *Params) { AllocAndPutMsg (CAPI_DATA_B3, CAPI_RESP, Messagenumber, NCCI, vTrue, Params); } inline void CCAPI20_MsgBase::DISCONNECT_B3_RESP (c_word Messagenumber, c_dword NCCI) { AllocAndPutMsg (CAPI_DISCONNECT_B3, CAPI_RESP, Messagenumber, NCCI, vFalse, 0); } inline void CCAPI20_MsgBase::DISCONNECT_RESP (c_word Messagenumber, c_dword PLCI) { AllocAndPutMsg (CAPI_DISCONNECT, CAPI_RESP, Messagenumber, PLCI, vFalse, 0); } inline void CCAPI20_MsgBase::FACILITY_RESP (c_word Messagenumber, c_dword Address, cm_facilityresp *Params) { AllocAndPutMsg (CAPI_FACILITY, CAPI_RESP, Messagenumber, Address, vTrue, Params); } inline void CCAPI20_MsgBase::INFO_RESP (c_word Messagenumber, c_dword Address) { AllocAndPutMsg (CAPI_INFO, CAPI_RESP, Messagenumber, Address, vFalse, 0); } inline void CCAPI20_MsgBase::MANUFACTURER_RESP (c_word Messagenumber, c_dword Controller, cm_manufacturer *Params) { AllocAndPutMsg (CAPI_MANUFACTURER, CAPI_RESP, Messagenumber, Controller, vTrue, Params); } inline void CCAPI20_MsgBase::RESET_B3_RESP (c_word Messagenumber, c_dword NCCI) { AllocAndPutMsg (CAPI_RESET_B3, CAPI_RESP, Messagenumber, NCCI, vFalse, 0); } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/capi/CCSMesg.h0000644000175000017500000003367210470310075016717 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _CCSMESG_H_ #define _CCSMESG_H_ #include "CCStruct.h" #include "CCSParam.h" #pragma pack(1) /*===========================================================================*\ GetProfile \*===========================================================================*/ struct cm_getprofile { c_word NumControllers; c_word NumBChannels; c_dword GlobalOptions; c_dword B1ProtocolSupport; c_dword B2ProtocolSupport; c_dword B3ProtocolSupport; c_byte Reserved[24]; c_byte ManufacturerSpecific[20]; }; /*===========================================================================*\ \*===========================================================================*/ class cm_messagebody : public CCStruct { protected: cm_messagebody (tCapiStructType type, void *data, tUInt len, tFormatChar *format) : CCStruct (type, data, len, format) {} cm_messagebody (tCapiStructType type, void *data, tFormatChar *format) : CCStruct (type, data, format) {} }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cm_message : public CCStruct { public: cm_message (void) : CCStruct (cxt_Message, &ApplID, cxf_MSGLEN cxf_0A cxf_STRUCT), ApplID (0), Command (0), Subcommand (0), MessageNumber (0), Address (0), pMessageBody (0) {} c_word ApplID; c_byte Command; c_byte Subcommand; c_word MessageNumber; c_dword Address; cm_messagebody *pMessageBody; }; /*===========================================================================*\ All Messages \*===========================================================================*/ #ifdef C_PLATFORM_64 class cm_datab3 : public cm_messagebody { public: cm_datab3 (c_dataptr data = 0, c_word length = 0, c_word handle = 0, c_word flags = 0) : cm_messagebody (cxt_DataB3, &DataLength, cxf_NOLEN cxf_Z_04 cxf_0E), DataLength (length), DataHandle (handle), Flags (flags), Data (data) {} c_word DataLength; c_word DataHandle; c_word Flags; c_dataptr Data; }; #else // C_PLATFORM_64 class cm_datab3 : public cm_messagebody { public: cm_datab3 (c_dataptr data = 0, c_word length = 0, c_word handle = 0, c_word flags = 0) : cm_messagebody (cxt_DataB3, &Data, 0x0A, cxf_NOLEN cxf_CONST), Data (data), DataLength (length), DataHandle (handle), Flags (flags) {} c_dataptr Data; c_word DataLength; c_word DataHandle; c_word Flags; }; #endif // C_PLATFORM_64 /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cm_manufacturer : public cm_messagebody { public: cm_manufacturer (c_dword manuid = 0, c_dword mclass = 0, c_dword function = 0, CCStruct *pdata = 0) : cm_messagebody (cxt_Manufacturer, &ManuID, cxf_NOLEN cxf_0C cxf_STRUCT), ManuID (manuid), Class (mclass), Function (function), pManuData (pdata) {} c_dword ManuID; c_dword Class; c_dword Function; CCStruct *pManuData; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cm_manufacturer_ref : public cm_manufacturer { public: cm_manufacturer_ref (void) : cm_manufacturer (0, 0, 0, &m_ManuData) {} private: CCStruct m_ManuData; }; /*===========================================================================*\ Requests \*===========================================================================*/ class cm_connectreq : public cm_messagebody { public: cm_connectreq (c_cipvalue value = cipvalue_Undefined, CCStruct *pcallednum = 0, CCStruct *pcallingnum = 0, CCStruct *pcalledsub = 0, CCStruct *pcallingsub = 0, cp_bprotocol *prot = 0, cp_addinfo *addinfo = 0) : cm_messagebody (cxt_ConnectReq, &CIPValue, cxf_NOLEN cxf_CIPVAL cxf_STRUCT cxf_STRUCT cxf_STRUCT cxf_STRUCT cxf_STRUCT cxf_Z_03 cxf_STRUCT), CIPValue (value), pCalledPartyNumber (pcallednum), pCallingPartyNumber (pcallingnum), pCalledPartySubaddress (pcalledsub), pCallingPartySubaddress (pcallingsub), pBProtocol (prot), pAdditionalInfo (addinfo) {} c_cipvalue CIPValue; CCStruct *pCalledPartyNumber; CCStruct *pCallingPartyNumber; CCStruct *pCalledPartySubaddress; CCStruct *pCallingPartySubaddress; cp_bprotocol *pBProtocol; cp_addinfo *pAdditionalInfo; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cm_facilityreq : public cm_messagebody { public: cm_facilityreq (c_facilselect select = facilselect_Handset, CCStruct *param = 0) : cm_messagebody (cxt_FacilityReq, &FacilitySelector, cxf_NOLEN cxf_FACIL cxf_STRUCT), FacilitySelector (select), pFacilityParam (param) {} c_facilselect FacilitySelector; CCStruct *pFacilityParam; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cm_inforeq : public cm_messagebody { public: cm_inforeq (CCStruct *callednum = 0, cp_addinfo *addinfo = 0) : cm_messagebody (cxt_InfoReq, &pCalledPartyNumber, cxf_NOLEN cxf_STRUCT cxf_STRUCT), pCalledPartyNumber (callednum), pAdditionalInfo (addinfo) {} CCStruct *pCalledPartyNumber; cp_addinfo *pAdditionalInfo; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cm_listenreq : public cm_messagebody { public: cm_listenreq (c_dword infom = 0, c_dword cipm = 0, c_dword cipm2 = 0, CCStruct *pnumber = 0) : cm_messagebody (cxt_ListenReq, &InfoMask, cxf_NOLEN cxf_0C cxf_STRUCT cxf_Z_STRUCT), InfoMask (infom), CIPMask (cipm), CIPMask2 (cipm2), pCallingPartyNumber (pnumber) {} c_dword InfoMask; c_dword CIPMask; c_dword CIPMask2; CCStruct *pCallingPartyNumber; }; /*===========================================================================*\ Confirmations \*===========================================================================*/ class cm_datab3conf : public cm_messagebody { public: cm_datab3conf (c_word han = 0, c_info inf = ci_NoError) : cm_messagebody (cxt_DataB3Conf, &DataHandle, cxf_NOLEN cxf_02 cxf_INFO), DataHandle (han), Info (inf) {} c_word DataHandle; c_info Info; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cm_facilityconf : public cm_messagebody { public: cm_facilityconf (void) : cm_messagebody (cxt_FacilityConf, &Info, cxf_NOLEN cxf_INFO cxf_FACIL cxf_STRUCT), Info (ci_NoError), FacilitySelector (facilselect_Handset), pFacilityParam (&m_FacilityParam) {} c_info Info; c_facilselect FacilitySelector; CCStruct *pFacilityParam; private: CCStruct m_FacilityParam; }; /*===========================================================================*\ Indications \*===========================================================================*/ class cm_connectind : public cm_messagebody { public: cm_connectind (void) : cm_messagebody (cxt_ConnectInd, &CIPValue, cxf_NOLEN cxf_CIPVAL cxf_STRUCT cxf_STRUCT cxf_STRUCT cxf_STRUCT cxf_Z_STRUCT cxf_Z_STRUCT cxf_Z_STRUCT cxf_STRUCT), CIPValue (cipvalue_Undefined), pCalledPartyNumber (&m_CalledPartyNumber), pCallingPartyNumber (&m_CallingPartyNumber), pCalledPartySubaddress (&m_CalledPartySubaddress), pCallingPartySubaddress (&m_CallingPartySubaddress), pAdditionalInfo (&m_AdditionalInfo) {} c_cipvalue CIPValue; CCStruct *pCalledPartyNumber; CCStruct *pCallingPartyNumber; CCStruct *pCalledPartySubaddress; CCStruct *pCallingPartySubaddress; cp_addinfo *pAdditionalInfo; private: CCStruct m_CalledPartyNumber; CCStruct m_CallingPartyNumber; CCStruct m_CalledPartySubaddress; CCStruct m_CallingPartySubaddress; cp_addinfo_ref m_AdditionalInfo; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cm_connectactiveind : public cm_messagebody { public: cm_connectactiveind (void) : cm_messagebody (cxt_ConnectActiveInd, &pConnectedNumber, cxf_NOLEN cxf_STRUCT cxf_STRUCT), pConnectedNumber (&m_ConnectedNumber), pConnectedSubaddress (&m_ConnectedSubaddress) {} CCStruct *pConnectedNumber; CCStruct *pConnectedSubaddress; private: CCStruct m_ConnectedNumber; CCStruct m_ConnectedSubaddress; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cm_disconnectb3ind : public cm_messagebody { public: cm_disconnectb3ind (void) : cm_messagebody (cxt_DisconnectB3Ind, &ReasonB3, cxf_NOLEN cxf_INFO cxf_STRUCT), ReasonB3 (ci_NoError), pNCPI (&m_NCPI) {} c_info ReasonB3; CCStruct *pNCPI; private: CCStruct m_NCPI; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cm_facilityind : public cm_messagebody { public: cm_facilityind (void) : cm_messagebody (cxt_FacilityInd, &FacilitySelector, cxf_NOLEN cxf_FACIL cxf_STRUCT), FacilitySelector (facilselect_Handset), pFacilityParam (&m_FacilityParam) {} c_facilselect FacilitySelector; CCStruct *pFacilityParam; private: CCStruct m_FacilityParam; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cm_infoind : public cm_messagebody { public: cm_infoind (void) : cm_messagebody (cxt_InfoInd, &InfoNumber, cxf_NOLEN cxf_02 cxf_STRUCT), InfoNumber (0), pInfoElement (&mi_InfoElement) {} c_word InfoNumber; CCStruct *pInfoElement; private: CCStruct mi_InfoElement; }; /*===========================================================================*\ Responses \*===========================================================================*/ class cm_connectresp : public cm_messagebody { public: cm_connectresp (c_reject reject = creject_Ignore, cp_bprotocol *prot = 0, CCStruct *pconnnum = 0, CCStruct *pconnsub = 0, cp_addinfo *addinfo = 0) : cm_messagebody (cxt_ConnectResp, &Reject, cxf_NOLEN cxf_REJECT cxf_STRUCT cxf_STRUCT cxf_STRUCT cxf_Z_STRUCT cxf_STRUCT), Reject (reject), pBProtocol (prot), pConnectedNumber (pconnnum), pConnectedSubaddress (pconnsub), pAdditionalInfo (addinfo) {} c_reject Reject; cp_bprotocol *pBProtocol; CCStruct *pConnectedNumber; CCStruct *pConnectedSubaddress; cp_addinfo *pAdditionalInfo; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cm_connectb3resp : public cm_messagebody { public: cm_connectb3resp (c_reject rej = creject_Reject_Normal, CCStruct *ncpi = 0) : cm_messagebody (cxt_ConnectB3Resp, &Reject, cxf_NOLEN cxf_REJECT cxf_STRUCT), Reject (rej), pNCPI (ncpi) {} c_reject Reject; CCStruct *pNCPI; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cm_datab3resp : public cm_messagebody { public: cm_datab3resp (c_word han) : cm_messagebody (cxt_DataB3Resp, &DataHandle, cxf_NOLEN cxf_02), DataHandle (han) {} c_word DataHandle; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cm_facilityresp : public cm_messagebody { public: cm_facilityresp (c_facilselect select = facilselect_Handset, CCStruct *param = 0) : cm_messagebody (cxt_FacilityResp, &FacilitySelector, cxf_NOLEN cxf_FACIL cxf_STRUCT), FacilitySelector (select), pFacilityParam (param) {} c_facilselect FacilitySelector; CCStruct *pFacilityParam; }; /*===========================================================================*\ \*===========================================================================*/ #pragma pack() #endif capi4hylafax-svn/src/capi/CCStruct.cpp0000644000175000017500000011704010470310075017510 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "CCStruct.h" #include "aString.h" #include "c2msgdef.h" #include "dbgCAPI.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define cxfv_NOLEN 0x4F // must be the first #define cxfv_MSGLEN 0x4E // must be the only one (except cxf_NOLEN) #define cxfv_CONST 0x4D // must be the only one (except cxf_NOLEN) #define cxfv_STRUCT 0x4C #define cxfv_STRING 0x4B #define cxfv_PACKET 0x4A #define cxfv_ARRAY 0x49 #define cxfv_MULTIPLY 0x48 #define cxfv_INFO 0x47 #define cxfv_REJECT 0x46 #define cxfv_CIPVAL 0x45 #define cxfv_B1PROT 0x44 #define cxfv_B2PROT 0x43 #define cxfv_B3PROT 0x42 #define cxfv_FACIL 0x41 #define cxfv_SUPSRV 0x40 #define cxfv_Z_06 0x3F #define cxfv_Z_05 0x3E #define cxfv_Z_04 0x3D #define cxfv_Z_03 0x3C #define cxfv_Z_02 0x3B #define cxfv_Z_01 0x3A #define cxfv_Z_STRUCT 0x39 #define cxfv_I_12 0x38 #define cxfv_I_10 0x37 #define cxfv_I_0E 0x36 #define cxfv_I_0C 0x35 #define cxfv_I_04 0x34 #define cxfv_I_03 0x33 #define cxfv_I_02 0x32 /*===========================================================================*\ \*===========================================================================*/ CCStruct::~CCStruct (void) { dhead ("CCStruct-Destructor", DCON_CCStruct); if (m_MaxLen) { delete [] m_pData; } m_pData = 0; m_Len = 0; m_MaxLen = 0; } /*===========================================================================*\ \*===========================================================================*/ void CCStruct::Reset (void) { dhead ("CCStruct::Reset", DCON_CCStruct); tFormatChar *format = m_Format; switch (*format) { case cxfv_NOLEN: case cxfv_MSGLEN: format++; break; } if (*format == cxfv_CONST) { m_Len = 0; //if (m_pData == 0) { // m_Len = 0; //} else { // s_memzero (m_pData, m_Len); //} } else { m_Len = 0; tUByte *pSData = m_pData; dassert (pSData != 0); for (; *format != '\0'; format++) { switch (*format) { case cxfv_CONST: case cxfv_NOLEN: case cxfv_MSGLEN: dassert (0); break; case cxfv_STRUCT: if (*(CCStruct **)pSData) { (*(CCStruct **)pSData)->Reset(); } pSData += sizeof (CCStruct *); break; case cxfv_STRING: if (*(CDynamicString **)pSData) { (*(CDynamicString **)pSData)->RemoveAll(); } pSData += sizeof (CDynamicString *); break; case cxfv_PACKET: if (*(CDataPacket **)pSData) { (*(CDataPacket **)pSData)->SetLen (0); } pSData += sizeof (CDataPacket *); break; case cxfv_ARRAY: { c_word count = *(c_word *)pSData; pSData += sizeof (c_word); CCStruct **lauf = *(CCStruct ***)pSData; pSData += sizeof (CCStruct **); dwarning (lauf != 0); if (lauf) { for (; count > 0; count--, lauf++) { if (*lauf) { (*lauf)->Reset(); } } } break; } case cxfv_MULTIPLY: { // ignore counter pSData += sizeof (c_word); if (*(CCStruct **)pSData) { (*(CCStruct **)pSData)->Reset(); } pSData += sizeof (CCStruct **); break; } case cxfv_INFO: *(c_info *)pSData = ci_NoError; pSData += sizeof (c_info); break; case cxfv_REJECT: *(c_reject *)pSData = creject_Ignore; pSData += sizeof (c_reject); break; case cxfv_CIPVAL: *(c_cipvalue *)pSData = cipvalue_Undefined; pSData += sizeof (c_cipvalue); break; case cxfv_B1PROT: *(c_b1prot *)pSData = b1prot_HDLC; pSData += sizeof (c_b1prot); break; case cxfv_B2PROT: *(c_b2prot *)pSData = b2prot_X75; pSData += sizeof (c_b2prot); break; case cxfv_B3PROT: *(c_b3prot *)pSData = b3prot_Transparent; pSData += sizeof (c_b3prot); break; case cxfv_FACIL: *(c_facilselect *)pSData = facilselect_Handset; pSData += sizeof (c_facilselect); break; case cxfv_SUPSRV: *(c_supplserv *)pSData = supplserv_GetSupportedServices; pSData += sizeof (c_supplserv); break; case cxfv_Z_06: case cxfv_Z_05: case cxfv_Z_04: case cxfv_Z_03: case cxfv_Z_02: case cxfv_Z_01: case cxfv_Z_STRUCT: // nothing to do! break; case cxfv_I_12: pSData += 0x12; break; case cxfv_I_10: pSData += 0x10; break; case cxfv_I_0E: pSData += 0x0E; break; case cxfv_I_0C: pSData += 0x0C; break; case cxfv_I_04: pSData += 0x04; break; case cxfv_I_03: pSData += 0x03; break; case cxfv_I_02: pSData += 0x02; break; default: s_memzero (pSData, (tUByte)*format); pSData += (tUByte)*format; break; } } } } /*===========================================================================*\ \*===========================================================================*/ tUInt CCStruct::CalcStructSize (void) { dhead ("CCStruct::CalcStructSize", DCON_CCStruct); dparams ("%x,%x,l=%x", m_ClassType, m_DataType, m_Len); dassert (m_Format != 0); if (m_Len == 0) { tFormatChar *format = m_Format; tUByte *pSData = m_pData; switch (*format) { case cxfv_CONST: // nothing to do! break; case cxfv_NOLEN: case cxfv_MSGLEN: format++; if (*format == cxfv_CONST) { // nothing to do! break; } // no break! default: dassert (pSData != 0); for (; *format != '\0'; format++) { switch (*format) { case cxfv_CONST: case cxfv_NOLEN: case cxfv_MSGLEN: dassert (0); break; case cxfv_STRUCT: m_Len += (*(CCStruct **)pSData) ? (*(CCStruct **)pSData)->CalcStructSize() : 1; dprint ("-cxfv_STRUCT(%x,%p)-", m_Len, pSData); pSData += sizeof (CCStruct *); break; case cxfv_STRING: if (*(CDynamicString **)pSData) { m_Len += (*(CDynamicString **)pSData)->GetLen(); } dprint ("-cxfv_STRING(%x,%p)-", m_Len, pSData); pSData += sizeof (CDynamicString *); break; case cxfv_PACKET: if (*(CDataPacket **)pSData) { m_Len += (*(CDataPacket **)pSData)->GetLen(); } dprint ("-cxfv_PACKET(%x,%p)-", m_Len, pSData); pSData += sizeof (CDataPacket *); break; case cxfv_ARRAY: { c_word count = *(c_word *)pSData; pSData += sizeof (c_word); CCStruct **lauf = *(CCStruct ***)pSData; pSData += sizeof (CCStruct **); dwarning (lauf != 0); if (lauf) { for (; count > 0; count--, lauf++) { m_Len += (*lauf) ? (*lauf)->CalcStructSize() : 1; dprint ("-cxfv_ARRAY(%x,%p)-", m_Len, lauf); } } break; } case cxfv_MULTIPLY: { c_word count = *(c_word *)pSData; pSData += sizeof (c_word); m_Len += ((*(CCStruct **)pSData) ? (*(CCStruct **)pSData)->CalcStructSize() : 1) * count; pSData += sizeof (CCStruct *); dprint ("-cxfv_MULTIPLY(%x,%p)-", m_Len, pSData); break; } case cxfv_INFO: m_Len += 2; dprint ("-cxfv_INFO(%x,%p)-", m_Len, pSData); pSData += sizeof (c_info); break; case cxfv_REJECT: m_Len += 2; dprint ("-cxfv_REJECT(%x,%p)-", m_Len, pSData); pSData += sizeof (c_reject); break; case cxfv_CIPVAL: m_Len += 2; dprint ("-cxfv_CIPVAL(%x,%p)-", m_Len, pSData); pSData += sizeof (c_cipvalue); break; case cxfv_B1PROT: m_Len += 2; dprint ("-cxfv_B1PROT(%x,%p)-", m_Len, pSData); pSData += sizeof (c_b1prot); break; case cxfv_B2PROT: m_Len += 2; dprint ("-cxfv_B2PROT(%x,%p)-", m_Len, pSData); pSData += sizeof (c_b2prot); break; case cxfv_B3PROT: m_Len += 2; dprint ("-cxfv_B3PROT(%x,%p)-", m_Len, pSData); pSData += sizeof (c_b3prot); break; case cxfv_FACIL: m_Len += 2; dprint ("-cxfv_FACIL(%x,%p)-", m_Len, pSData); pSData += sizeof (c_facilselect); break; case cxfv_SUPSRV: m_Len += 2; dprint ("-cxfv_SUPSERV(%x,%p)-", m_Len, pSData); pSData += sizeof (c_supplserv); break; case cxfv_Z_06: m_Len += 6; dprint ("-cxfv_Z_06(%x)-", m_Len); break; case cxfv_Z_05: m_Len += 5; dprint ("-cxfv_Z_05(%x)-", m_Len); break; case cxfv_Z_04: m_Len += 4; dprint ("-cxfv_Z_04(%x)-", m_Len); break; case cxfv_Z_03: m_Len += 3; dprint ("-cxfv_Z_03(%x)-", m_Len); break; case cxfv_Z_02: m_Len += 2; dprint ("-cxfv_Z_02(%x)-", m_Len); break; case cxfv_Z_01: case cxfv_Z_STRUCT: m_Len += 1; dprint ("-cxfv_Z_01(%x)-", m_Len); break; case cxfv_I_12: case cxfv_I_10: case cxfv_I_0E: case cxfv_I_0C: case cxfv_I_04: case cxfv_I_03: case cxfv_I_02: // Nothing to do! break; default: dassert ((tUByte)*format < 0x10); m_Len += (tUByte)*format; dprint ("-cxfv_%x(%x)-", (tUByte)*format, m_Len); pSData += (tUByte)*format; break; } } break; } } dassert (m_Len <= MAXVAL_tUShort); switch (*m_Format) { case cxfv_NOLEN: RETURN ('x', m_Len); case cxfv_MSGLEN: RETURN ('x', m_Len + 2); } RETURN ('x', m_Len + ((m_Len > 254) ? 3 : 1)); } /*===========================================================================*\ \*===========================================================================*/ void CCStruct::ResetStructSize (tBool recursive) { dhead ("CCStruct::ResetStructSize", DCON_CCStruct); tFormatChar *format = m_Format; switch (*format) { case cxfv_CONST: break; case cxfv_NOLEN: case cxfv_MSGLEN: format++; if (*format == cxfv_CONST) { break; } // no break! default: m_Len = 0; if (recursive == vFalse) { break; } tUByte *pSData = m_pData; dassert (pSData != 0); for (; *format != '\0'; format++) { switch (*format) { case cxfv_CONST: case cxfv_NOLEN: case cxfv_MSGLEN: dassert (0); break; case cxfv_STRUCT: if (*(CCStruct **)pSData) { (*(CCStruct **)pSData)->ResetStructSize(); } // no break! case cxfv_STRING: case cxfv_PACKET: pSData += sizeof (void *); break; case cxfv_ARRAY: { c_word count = *(c_word *)pSData; pSData += sizeof (c_word); CCStruct **lauf = *(CCStruct ***)pSData; pSData += sizeof (CCStruct **); dwarning (lauf != 0); if (lauf) { for (; count > 0; count--, lauf++) { if (*lauf) { (*lauf)->ResetStructSize(); } } } break; } case cxfv_MULTIPLY: { // ignore counter pSData += sizeof (c_word); if (*(CCStruct **)pSData) { (*(CCStruct **)pSData)->ResetStructSize(); } pSData += sizeof (CCStruct **); break; } case cxfv_INFO: pSData += sizeof (c_info); break; case cxfv_REJECT: pSData += sizeof (c_reject); break; case cxfv_CIPVAL: pSData += sizeof (c_cipvalue); break; case cxfv_B1PROT: pSData += sizeof (c_b1prot); break; case cxfv_B2PROT: pSData += sizeof (c_b2prot); break; case cxfv_B3PROT: pSData += sizeof (c_b3prot); break; case cxfv_FACIL: pSData += sizeof (c_facilselect); break; case cxfv_SUPSRV: pSData += sizeof (c_supplserv); break; case cxfv_Z_06: case cxfv_Z_05: case cxfv_Z_04: case cxfv_Z_03: case cxfv_Z_02: case cxfv_Z_01: case cxfv_Z_STRUCT: // nothing to do! break; case cxfv_I_12: pSData += 0x12; break; case cxfv_I_10: pSData += 0x10; break; case cxfv_I_0E: pSData += 0x0E; break; case cxfv_I_0C: pSData += 0x0C; break; case cxfv_I_04: pSData += 0x04; break; case cxfv_I_03: pSData += 0x03; break; case cxfv_I_02: pSData += 0x02; break; default: pSData += (tUByte)*format; break; } } } } /*===========================================================================*\ \*===========================================================================*/ void CCStruct::FillBuffer (tUByte **ppBuffer) { dhead ("CCStruct::FillBuffer", DCON_CCStruct); dassert (ppBuffer != 0); dassert (*ppBuffer != 0); //dwarning (m_Len > 0); dassert (m_Len <= MAXVAL_tUShort); dassert ((m_pData != 0) || (m_Len == 0)); dassert (m_Format != 0); switch (*m_Format) { case cxfv_NOLEN: // nothing to do! break; case cxfv_MSGLEN: set16 (*ppBuffer, (tUShort)(m_Len + 2)); *ppBuffer += 2; break; default: if (m_Len > 254) { set8 (*ppBuffer, 255); (*ppBuffer)++; set16 (*ppBuffer, (tUShort)m_Len); *ppBuffer += 2; } else { set8 (*ppBuffer, (tUByte)m_Len); (*ppBuffer)++; } break; } FillData (ppBuffer); } /*===========================================================================*\ \*===========================================================================*/ tSInfo CCStruct::ParseStruct (CCStruct *pStruct) { dhead ("CCStruct::ParseStruct", DCON_CCStruct); tSInfo fret = i_Okay; if (m_ClassType == cxt_RawData) { if (pStruct) { if (pStruct->CalcStructSize() > MAXVAL_tUShort) { dassert (0); fret = iErr_Struct_LenOutOfRange; } else if ( (m_MaxLen < pStruct->m_Len) && (Resize (pStruct->m_Len) == vFalse)) { fret = iErr_OutOfMemory; } else { dassert (m_pData != 0); m_Len = pStruct->m_Len; m_DataType = pStruct->m_DataType; tUByte *pData = m_pData; pStruct->FillData (&pData); } } else { m_Len = 0; m_DataType = cxt_RawData; } } else if (pStruct->GetClassType() != cxt_RawData) { dassert (0); fret = iErr_Struct_WrongFormat; } else { dassert (m_MaxLen == 0) ; dassert (m_pData != 0); if (pStruct) { dassert (pStruct->m_DataType == cxt_RawData); dassert (pStruct->m_Len <= MAXVAL_tUShort); if (pStruct->m_Len && pStruct->m_pData) { if (m_Len > pStruct->m_Len) { fret = iErr_Struct_LenToSmall; } else { tUByte *pData = pStruct->m_pData; fret = ParseData (&pData, pStruct->m_Len); } } else { fret = iWrn_Struct_NoChanges; } } else { fret = iWrn_Struct_NoChanges; } } RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ tSInfo CCStruct::ParseBuffer (tUByte **ppBuffer, tUInt *pLen) { dhead ("CCStruct::ParseBuffer", DCON_CCStruct); dassert (pLen != 0); dassert (ppBuffer != 0); dassert (*ppBuffer != 0); // TODO: ??????????????????? if (*pLen == 0) { dwarning (0); RETURN ('x', iErr_Struct_LenToSmall); } dassert (m_Format != 0); tUInt len; switch (*m_Format) { case cxfv_NOLEN: len = ((m_Format[1] == cxfv_CONST) && (m_Len) && (m_pData)) ? m_Len : *pLen; break; case cxfv_MSGLEN: if (*pLen < 0x10) { // Test for complete Messageheader! dwarning (0); RETURN ('x', iErr_Struct_WrongLength); } len = get16 (*ppBuffer); *ppBuffer += 2; *pLen -= 2; break; default: len = get8 (*ppBuffer); (*ppBuffer)++; (*pLen)--; if (len > 254) { if (*pLen < 2) { dwarning (0); RETURN ('x', iErr_Struct_WrongLength); } len = get16 (*ppBuffer); *ppBuffer += 2; *pLen -= 2; } if (len > *pLen) { dwarning (0); RETURN ('x', iErr_Struct_WrongLength); } break; } if (m_Len > len) { dwarning (0); RETURN ('x', iErr_Struct_LenToSmall); } if (!len) { // Detected an empty Struct Reset(); return i_Okay; } *pLen -= len; return ParseData (ppBuffer, len); } /*===========================================================================*\ \*===========================================================================*/ void CCStruct::FillData (tUByte **ppBuffer) { dhead ("CCStruct::FillData", DCON_CCStruct); dassert (ppBuffer != 0); dassert (*ppBuffer != 0); //dwarning (m_Len > 0); dassert (m_Len <= MAXVAL_tUShort); dassert ((m_pData != 0) || (m_Len == 0)); dassert (m_Format != 0); tFormatChar *format = m_Format; switch (*format) { case cxfv_NOLEN: case cxfv_MSGLEN: format++; break; } if (*format == cxfv_CONST) { s_memcpy (*ppBuffer, m_pData, m_Len); *ppBuffer += m_Len; } else { tUByte *pSData = m_pData; dassert (pSData != 0); for (; *format != '\0'; format++) { switch (*format) { case cxfv_CONST: case cxfv_NOLEN: case cxfv_MSGLEN: dassert (0); break; case cxfv_STRUCT: if (*(CCStruct **)pSData) { (*(CCStruct **)pSData)->FillBuffer (ppBuffer); } else { set8 (*ppBuffer, 0); (*ppBuffer)++; } pSData += sizeof (CCStruct *); break; case cxfv_STRING: if (*(CDynamicString **)pSData) { CDynamicString *pString = *(CDynamicString **)pSData; dassert (m_Len >= pString->GetLen()); s_memcpy (*ppBuffer, pString->GetPointer(), pString->GetLen()); *ppBuffer += pString->GetLen(); } pSData += sizeof (CDynamicString *); break; case cxfv_PACKET: if (*(CDataPacket **)pSData) { CDataPacket *pPacket = *(CDataPacket **)pSData; dassert (m_Len > pPacket->GetLen()); s_memcpy (*ppBuffer, pPacket->GetPointer(), pPacket->GetLen()); *ppBuffer += pPacket->GetLen(); } pSData += sizeof (CDataPacket *); break; case cxfv_ARRAY: { c_word count = *(c_word *)pSData; pSData += sizeof (c_word); CCStruct **lauf = *(CCStruct ***)pSData; pSData += sizeof (CCStruct **); dwarning (lauf != 0); if (lauf) { for (; count > 0; count--, lauf++) { if (*lauf) { (*lauf)->FillBuffer (ppBuffer); } else { set8 (*ppBuffer, 0); (*ppBuffer)++; } } } break; } case cxfv_MULTIPLY: { c_word count = *(c_word *)pSData; pSData += sizeof (c_word); if (*(CCStruct **)pSData) { for (; count > 0; count--) { (*(CCStruct **)pSData)->FillBuffer (ppBuffer); } } else { s_memzero (ppBuffer, count); *ppBuffer += count; } pSData += sizeof (CCStruct *); break; } case cxfv_INFO: set16 (*ppBuffer, (tUInt16)*(c_info *)pSData); pSData += sizeof (c_info); *ppBuffer += 2; break; case cxfv_REJECT: set16 (*ppBuffer, (tUInt16)*(c_reject *)pSData); pSData += sizeof (c_reject); *ppBuffer += 2; break; case cxfv_CIPVAL: set16 (*ppBuffer, (tUInt16)*(c_cipvalue *)pSData); pSData += sizeof (c_cipvalue); *ppBuffer += 2; break; case cxfv_B1PROT: set16 (*ppBuffer, (tUInt16)*(c_b1prot *)pSData); pSData += sizeof (c_b1prot); *ppBuffer += 2; break; case cxfv_B2PROT: set16 (*ppBuffer, (tUInt16)*(c_b2prot *)pSData); pSData += sizeof (c_b2prot); *ppBuffer += 2; break; case cxfv_B3PROT: set16 (*ppBuffer, (tUInt16)*(c_b3prot *)pSData); pSData += sizeof (c_b3prot); *ppBuffer += 2; break; case cxfv_FACIL: set16 (*ppBuffer, (tUInt16)*(c_facilselect *)pSData); pSData += sizeof (c_facilselect); *ppBuffer += 2; break; case cxfv_SUPSRV: set16 (*ppBuffer, (tUInt16)*(c_supplserv *)pSData); pSData += sizeof (c_supplserv); *ppBuffer += 2; break; case cxfv_Z_06: s_memzero (*ppBuffer, 6); *ppBuffer += 0x06; break; case cxfv_Z_05: s_memzero (*ppBuffer, 5); *ppBuffer += 0x05; break; case cxfv_Z_04: set32 (*ppBuffer, 0); *ppBuffer += 0x04; break; case cxfv_Z_03: s_memzero (*ppBuffer, 3); *ppBuffer += 0x03; break; case cxfv_Z_02: set16 (*ppBuffer, 0); *ppBuffer += 0x02; break; case cxfv_Z_01: case cxfv_Z_STRUCT: set8 (*ppBuffer, 0); *ppBuffer += 0x01; break; case cxfv_I_12: pSData += 0x12; break; case cxfv_I_10: pSData += 0x10; break; case cxfv_I_0E: pSData += 0x0E; break; case cxfv_I_0C: pSData += 0x0C; break; case cxfv_I_04: pSData += 0x04; break; case cxfv_I_03: pSData += 0x03; break; case cxfv_I_02: pSData += 0x02; break; default: dassert ((tUByte)*format < 0x10); s_memcpy (*ppBuffer, pSData, (tUByte)*format); pSData += *format; *ppBuffer += *format; break; } } } } /*===========================================================================*\ \*===========================================================================*/ tSInfo CCStruct::ParseData (tUByte **ppBuffer, tUInt len) { dhead ("CCStruct::ParseData", DCON_CCStruct); dassert (len > 0); dassert (ppBuffer != 0); dassert (*ppBuffer != 0); dassert (m_Format != 0); dprintBuf (*ppBuffer, len); tFormatChar *format = m_Format; switch (*format) { case cxfv_NOLEN: case cxfv_MSGLEN: format++; break; } if (*format == cxfv_CONST) { if (m_pData == 0) { m_pData = *ppBuffer; m_Len = len; } else { if (m_Len == 0) { if ((m_MaxLen < len) && (Resize (len) == vFalse)) { RETURN ('x', iErr_OutOfMemory); } m_Len = len; } dassert (m_Len <= len); s_memcpy (m_pData, *ppBuffer, len); } *ppBuffer += len; } else { tUByte *pSData = m_pData; m_Len = len; dassert (pSData != 0); for (; *format != '\0'; format++) { dprint ("%x.", **ppBuffer); switch (*format) { case cxfv_CONST: case cxfv_NOLEN: case cxfv_MSGLEN: dassert (0); break; case cxfv_STRUCT: if (*(CCStruct **)pSData) { tSInfo fret = (*(CCStruct **)pSData)->ParseBuffer (ppBuffer, &len); if (infoError (fret)) { dwarning (0); RETURN ('x', fret); } pSData += sizeof (CCStruct *); break; } else if (**ppBuffer != '\0') { dassert (0); RETURN ('x', iErr_Struct_WrongFormat); } else { (*ppBuffer)++; len--; } break; case cxfv_STRING: if (*(CDynamicString **)pSData) { if ((*(CDynamicString **)pSData)->Set (*ppBuffer, len) == vFalse) { dwarning (0); RETURN ('x', iErr_OutOfMemory); } } else { dassert (0); // Ist das ein assert, warning oder gar nichts?? } RETURN ('x', i_Okay); case cxfv_PACKET: if (*(CDataPacket **)pSData) { if ( ((*(CDataPacket **)pSData)->GetMaxLen() < len) && ((*(CDataPacket **)pSData)->Resize (len) == vFalse)) { dwarning (0); RETURN ('x', iErr_OutOfMemory); } s_memcpy ((*(CDataPacket **)pSData)->GetPointer(), *ppBuffer, len); (*(CDataPacket **)pSData)->SetLen (len); } else { dassert (0); // Ist das ein assert, warning oder gar nichts?? } RETURN ('x', i_Okay); case cxfv_ARRAY: { tSInfo fret; c_word count = *(c_word *)pSData; pSData += sizeof (c_word); CCStruct **lauf = *(CCStruct ***)pSData; pSData += sizeof (CCStruct **); dwarning (lauf != 0); if (lauf) { for (; count > 0; count--, lauf++) { if (*lauf) { fret = (*lauf)->ParseBuffer (ppBuffer, &len); if (infoError (fret)) { dwarning (0); RETURN ('x', fret); } break; } else if (**ppBuffer != '\0') { dassert (0); RETURN ('x', iErr_Struct_WrongFormat); } else { (*ppBuffer)++; len--; } } } break; } case cxfv_MULTIPLY: dassert (0); // MULTIPLY is not parseable!!! RETURN ('x', iErr_Struct_WrongFormat); case cxfv_INFO: if (len < 2) { dassert (0); RETURN ('x', iErr_Struct_LenToSmall); } *(c_info *)pSData = (c_info)get16 (*ppBuffer); pSData += sizeof (c_info); *ppBuffer += 2; len -= 2; break; case cxfv_REJECT: if (len < 2) { dassert (0); RETURN ('x', iErr_Struct_LenToSmall); } *(c_reject *)pSData = (c_reject)get16 (*ppBuffer); pSData += sizeof (c_reject); *ppBuffer += 2; len -= 2; break; case cxfv_CIPVAL: if (len < 2) { dassert (0); RETURN ('x', iErr_Struct_LenToSmall); } *(c_cipvalue *)pSData = (c_cipvalue)get16 (*ppBuffer); pSData += sizeof (c_cipvalue); *ppBuffer += 2; len -= 2; break; case cxfv_B1PROT: if (len < 2) { dassert (0); RETURN ('x', iErr_Struct_LenToSmall); } *(c_b1prot *)pSData = (c_b1prot)get16 (*ppBuffer); pSData += sizeof (c_b1prot); *ppBuffer += 2; len -= 2; break; case cxfv_B2PROT: if (len < 2) { dassert (0); RETURN ('x', iErr_Struct_LenToSmall); } *(c_b2prot *)pSData = (c_b2prot)get16 (*ppBuffer); pSData += sizeof (c_b2prot); *ppBuffer += 2; len -= 2; break; case cxfv_B3PROT: if (len < 2) { dassert (0); RETURN ('x', iErr_Struct_LenToSmall); } *(c_b3prot *)pSData = (c_b3prot)get16 (*ppBuffer); pSData += sizeof (c_b3prot); *ppBuffer += 2; len -= 2; break; case cxfv_FACIL: if (len < 2) { dassert (0); RETURN ('x', iErr_Struct_LenToSmall); } *(c_facilselect *)pSData = (c_facilselect)get16 (*ppBuffer); pSData += sizeof (c_facilselect); *ppBuffer += 2; len -= 2; break; case cxfv_SUPSRV: if (len < 2) { dassert (0); RETURN ('x', iErr_Struct_LenToSmall); } *(c_supplserv *)pSData = (c_supplserv)get16 (*ppBuffer); pSData += sizeof (c_supplserv); *ppBuffer += 2; len -= 2; break; case cxfv_Z_06: if (len < 0x06) { dassert (0); RETURN ('x', iErr_Struct_LenToSmall); } *ppBuffer += 0x06; break; case cxfv_Z_05: if (len < 0x05) { dassert (0); RETURN ('x', iErr_Struct_LenToSmall); } *ppBuffer += 0x05; break; case cxfv_Z_04: if (len < 0x04) { dassert (0); RETURN ('x', iErr_Struct_LenToSmall); } *ppBuffer += 0x04; break; case cxfv_Z_03: if (len < 0x03) { dassert (0); RETURN ('x', iErr_Struct_LenToSmall); } *ppBuffer += 0x03; break; case cxfv_Z_02: if (len < 0x02) { dassert (0); RETURN ('x', iErr_Struct_LenToSmall); } *ppBuffer += 0x02; break; case cxfv_Z_01: if (len < 0x01) { dassert (0); RETURN ('x', iErr_Struct_LenToSmall); } *ppBuffer += 0x01; break; case cxfv_Z_STRUCT: if (len < sizeof (c_byte)) { dassert (0); RETURN ('x', iErr_Struct_LenToSmall); } else { tUInt dlen = **ppBuffer; (*ppBuffer)++; len--; if (dlen > 254) { if (len < 2) { dwarning (0); RETURN ('x', iErr_Struct_WrongLength); } dlen = get16 (*ppBuffer); *ppBuffer += 2; len -= 2; } if (dlen > len) { dwarning (0); RETURN ('x', iErr_Struct_WrongLength); } *ppBuffer += dlen; len -= dlen; } break; case cxfv_I_12: pSData += 0x12; break; case cxfv_I_10: pSData += 0x10; break; case cxfv_I_0E: pSData += 0x0E; break; case cxfv_I_0C: pSData += 0x0C; break; case cxfv_I_04: pSData += 0x04; break; case cxfv_I_03: pSData += 0x03; break; case cxfv_I_02: pSData += 0x02; break; default: dassert ((tUByte)*format < cxfv_I_02); if (len < (tUByte)*format) { dassert (0); RETURN ('x', iErr_Struct_LenToSmall); } s_memcpy (pSData, *ppBuffer, (tUByte)*format); pSData += (tUByte)*format; *ppBuffer += (tUByte)*format; len -= (tUByte)*format; break; } } if (len) { m_Len -= len; if (*m_Format != cxfv_NOLEN) { *ppBuffer += len; } } } RETURN ('x', i_Okay); } /*===========================================================================*\ \*===========================================================================*/ tBool CCStruct::Resize (tUInt maxlen) { dhead ("CCStruct::Resize", DCON_CCStruct); dparams ("%x", maxlen); dassert (maxlen > 0); dwarning (m_ClassType == cxt_RawData); if (maxlen) { tUByte *newData = new tUByte [maxlen]; if (!newData) { RETURN ('x', vFalse); } if (m_MaxLen) { dprint ("-old deleted- "); delete [] m_pData; } m_pData = newData; m_Len = 0; m_MaxLen = maxlen; } RETURN ('x', vTrue); } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/capi/MSNList.h0000644000175000017500000001162510470310075016756 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _MSNLIST_H_ #define _MSNLIST_H_ #include "capi2def.h" #include "CCStruct.h" #include "SortList.h" #include "InfoType.h" #include "MultiStr.h" /*---------------------------------------------------------------------------*\ tSInfo \*---------------------------------------------------------------------------*/ #define iWrn_MSNList_RejectCall CalculateInfoValue (infoType_MSNList, infoKind_Warning, 1) #define iWrn_MSNList_DDICall CalculateInfoValue (infoType_MSNList, infoKind_Warning, 2) #define iErr_MSNList_MSNEqual CalculateInfoValue (infoType_MSNList, infoKind_Error, 1) #define iErr_MSNList_MSNOverlap CalculateInfoValue (infoType_MSNList, infoKind_Error, 2) #define iErr_MSNList_InvalidValue CalculateInfoValue (infoType_MSNList, infoKind_Error, 3) /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class CMSNRange : public COneMultiString { public: CDynamicString m_End; }; /*===========================================================================*\ CCntrlMSNList \*===========================================================================*/ class CCntrlMSNList : private CSortPointerList { public: CCntrlMSNList (void); // Set remove every previous entry for the controller. Add integrate the new values to the previous one. // Set and Add doesn't change anything for the entries from SetMSN and AddMSN and vice versa. tBool Set (tUInt Controller, tUInt InfoMask, tUInt CIPMask); tBool Add (tUInt Controller, tUInt InfoMask, tUInt CIPMask); tBool SetDDI (tUInt Controller, CConstString *pTelNumPrefix, tUInt MaxDDILen = 0); tSInfo SetMSN (tUInt Controller, CConstString *aMSN, CConstString *bMSN = 0); tSInfo AddMSN (tUInt Controller, CConstString *aMSN, CConstString *bMSN = 0); // if MaxDDILen is 0, some MSN/DDI numbers must be entered in SetMSN/AddMSN! // if bMSN is set, it is used as a range [aMSN - bMSN] void Remove (tUInt Controller); void RemoveAll (void); tSInfo FindCallInfo (tUInt Controller, c_cipvalue CIPValue, CCStruct *MSN, tUInt *pDDIPrefixLen); tSInfo TestDDINumber (tUInt Controller, CConstString *DDINumber); // *pMainNumLen only valid if return = i_AccpeptCall void ResetGetNextMask (void); tBool GetNextMask (tUInt *pController, tUInt *pInfoMask, tUInt *pCIPMask); // vFalse == no more masks tBool GetMask (tUInt Controller, tUInt *pInfoMask, tUInt *pCIPMask); // vFalse == Controller is not in the list CMultiString *GetAllMSNs (tUInt Controller); // Elements: CMSNRange CMSNRange *GetMSN (tUInt Controller, tUInt pos); CDynamicString *GetDDIOffset (tUInt Controller); tUInt GetDDILen (tUInt Controller); tUInt GetCountMSN (tUInt Controller); tBool ExistMSNRange (tUInt Controller); void SetWakeupSupport (tUInt Controller, tBool IsSupported); tBool GetWakeupSupport (tUInt Controller); tBool IsEmpty (void); tBool ExistController (tUInt Controller); void SetGlobalCallOpt (tBool value); private: class CControllerInfo *pCurPos; tBool AllowGlobalCall; }; /*===========================================================================*\ inline functions from CCntrlMSNList \*===========================================================================*/ inline CCntrlMSNList::CCntrlMSNList (void) : AllowGlobalCall (vTrue) { ResetGetNextMask(); } inline void CCntrlMSNList::RemoveAll (void) { RemoveAndDeleteAll(); } inline void CCntrlMSNList::ResetGetNextMask (void) { pCurPos = 0; } inline tBool CCntrlMSNList::IsEmpty (void) { return CSortPointerList::IsEmpty(); } inline tBool CCntrlMSNList::ExistController (tUInt Controller) { return (FindHigher (&Controller) != 0); } inline void CCntrlMSNList::SetGlobalCallOpt (tBool value) { AllowGlobalCall = value; } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/capi/CCSParam.h0000644000175000017500000004007610470310075017060 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _CCSPARAM_H_ #define _CCSPARAM_H_ #include "CCStruct.h" #pragma pack(1) /*===========================================================================*\ \*===========================================================================*/ class cp_content_dword : public CCStruct { public: cp_content_dword (c_dword val = 0) : CCStruct (cxt_StructData, &Value, sizeof (c_dword)), Value (val) {} c_dword Value; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cp_content_string : public CCStruct { public: cp_content_string (CDynamicString *str = 0) : CCStruct (&pString, cxf_STRING), pString (str) {} CDynamicString *pString; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cp_content_packet : public CCStruct { public: cp_content_packet (CDataPacket *pack = 0) : CCStruct (&pPacket, cxf_PACKET), pPacket (pack) {} CDataPacket *pPacket; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cp_content_selector : public CCStruct { public: cp_content_selector (c_dword select = 0, CCStruct *param = 0) : CCStruct (&Selector, cxf_04 cxf_STRUCT), Selector (select), pParameter (param) {} c_dword Selector; CCStruct *pParameter; }; class cp_content_selector_store : public cp_content_selector { public: cp_content_selector_store (c_dword select = 0) : cp_content_selector (select, &m_Parameter) {} private: CCStructStore m_Parameter; }; /*===========================================================================*\ \*===========================================================================*/ class cp_callednumber : public CCStruct { public: cp_callednumber (CDynamicString *num = 0) : CCStruct (cxt_CalledPartyNumber, &Type, cxf_01 cxf_STRING), Type (0x80), pNumber (num) {} c_byte Type; CDynamicString *pNumber; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cp_callingnumber : public CCStruct { public: cp_callingnumber (c_byte indicator = CALLNUM_INDICATOR_DEFAULT) : CCStruct (cxt_CallingPartyNumber, &Type, cxf_02 cxf_STRING), Type (0x00), Indicator (indicator), pNumber (&m_Number) {} c_byte Type; c_byte Indicator; CDynamicString *pNumber; void ResetNumber (void) { Type = 0x00; Indicator = CALLNUM_INDICATOR_DEFAULT; pNumber = &m_Number; m_Number.RemoveAll(); }; private: CDynamicString m_Number; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ typedef cp_callingnumber cp_connectednumber; /*===========================================================================*\ \*===========================================================================*/ class cp_bprotocol : public CCStruct { public: cp_bprotocol (c_b1prot b1prot = b1prot_HDLC, c_b2prot b2prot = b2prot_X75, c_b3prot b3prot = b3prot_Transparent, CCStruct *pb1config = 0, CCStruct *pb2config = 0, CCStruct *pb3config = 0, CCStruct *pgconfig = 0) : CCStruct (cxt_BProtocol, &B1Protocol, cxf_B1PROT cxf_B2PROT cxf_B3PROT cxf_STRUCT cxf_STRUCT cxf_STRUCT cxf_STRUCT), B1Protocol (b1prot), B2Protocol (b2prot), B3Protocol (b3prot), pB1Configuration (pb1config), pB2Configuration (pb2config), pB3Configuration (pb3config), pGlobalConfiguration (pgconfig) {} c_b1prot B1Protocol; c_b2prot B2Protocol; c_b3prot B3Protocol; CCStruct *pB1Configuration; CCStruct *pB2Configuration; CCStruct *pB3Configuration; CCStruct *pGlobalConfiguration; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cp_bprotocol_store : public cp_bprotocol { public: cp_bprotocol_store (void) : cp_bprotocol (b1prot_HDLC, b2prot_X75, b3prot_Transparent, &m_B1Configuration, &m_B2Configuration, &m_B3Configuration, &m_GlobalConfiguration) {} private: CCStructStore m_B1Configuration; CCStructStore m_B2Configuration; CCStructStore m_B3Configuration; CCStructStore m_GlobalConfiguration; }; /*===========================================================================*\ \*===========================================================================*/ class cp_b1configuration : public CCStruct { protected: cp_b1configuration (tCapiStructType type, void *data, tFormatChar *format) : CCStruct (type, data, format) {} }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cp_b1configuration_atm : public cp_b1configuration { public: cp_b1configuration_atm (c_word vcc = 0, c_word vpi = 0, c_word vci = 0) : cp_b1configuration (cxt_B1Config, &VCC, cxf_06), VCC (vcc), VPI (vpi), VCI (vci) {} c_word VCC; c_word VPI; c_word VCI; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cp_b1configuration_all : public cp_b1configuration { public: cp_b1configuration_all (c_b1prot b1prot) : cp_b1configuration (cxt_B1Config, &MaximumBitRate, &m_Format[0]), MaximumBitRate (0), BitsPerCharacter (0), Parity (0), StopBits (0), Options (0), SpeedNegotiation (0), TransmitLevelInDB (0), ATM_VCC (0), ATM_VPI (0), ATM_VCI (0) { switch (b1prot) { default: // dwarning (0); // no break; case b1prot_HDLC: case b1prot_Transparent: case b1prot_invertedHDLC: case b1prot_56kBitTransparent: s_strncpy (&m_Format[0], cxf_CONST, 2); break; case b1prot_V110_asynch: case b1prot_V110_synch: s_strncpy (&m_Format[0], cxf_08, 2); break; case b1prot_G3Fax: s_strncpy (&m_Format[0], cxf_08 cxf_I_04 cxf_02, 4); break; case b1prot_Modem_negotiate: case b1prot_Modem_asynch: case b1prot_Modem_synch: s_strncpy (&m_Format[0], cxf_0C, 2); break; case b1prot_ATM: s_strncpy (&m_Format[0], cxf_I_0E cxf_06, 3); break; } } c_word MaximumBitRate; // 2, 3, 4, 7, 8, 9 c_word BitsPerCharacter; // 2, 7, 8 c_word Parity; // 2, 7, 8 c_word StopBits; // 2, 7, 8 c_word Options; // 7, 8, 9 c_word SpeedNegotiation; // 7, 8, 9 c_word TransmitLevelInDB; // 4 c_word ATM_VCC; // 28 c_word ATM_VPI; // 28 c_word ATM_VCI; // 28 private: tFormatChar m_Format[4]; }; /*===========================================================================*\ \*===========================================================================*/ class cp_b3configuration : public CCStruct { protected: cp_b3configuration (void *data, tFormatChar *format) : CCStruct (cxt_B1Config, data, format) {} }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cp_b3configuration_faxext : public cp_b3configuration { public: cp_b3configuration_faxext (c_word opts = 0, CDynamicString *station = 0, CDynamicString *head = 0) : cp_b3configuration (&Options, cxf_02 cxf_Z_02 cxf_STRUCT cxf_STRUCT), Options (opts), pStationID (&m_StationID), pHeadLine (&m_HeadLine), m_StationID (station), m_HeadLine (head) {} c_word Options; cp_content_string *pStationID; cp_content_string *pHeadLine; private: tFormatChar m_Format[7]; cp_content_string m_StationID; cp_content_string m_HeadLine; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cp_b3configuration_all : public cp_b3configuration { public: cp_b3configuration_all (c_b3prot b3prot, CDynamicString *station = 0, CDynamicString *head = 0) : cp_b3configuration (&LIC, &m_Format[0]), LIC (0), HIC (0), LTC (0), HTC (0), LOC (0), HOC (0), ModuloMode (0), WindowSize (0), Resolution (0), Options (0), Format (0), pStationID (&m_StationID), pHeadLine (&m_HeadLine), m_StationID (station), m_HeadLine (head) { switch (b3prot) { default: // dwarning (0); // no break! case b3prot_Transparent: case b3prot_Modem: case b3prot_ADSL: s_strncpy (&m_Format[0], cxf_CONST, 2); break; case b3prot_T90NL: case b3prot_ISO8208: case b3prot_X25: s_strncpy (&m_Format[0], cxf_10, 2); break; case b3prot_G3Fax: s_strncpy (&m_Format[0], cxf_I_10 cxf_02 cxf_I_02 cxf_02 cxf_STRUCT cxf_STRUCT, 7); break; case b3prot_G3Fax_extended: s_strncpy (&m_Format[0], cxf_I_12 cxf_04 cxf_STRUCT cxf_STRUCT, 5); break; } } c_word LIC; // 1, 2, 3 c_word HIC; // 1, 2, 3 c_word LTC; // 1, 2, 3 c_word HTC; // 1, 2, 3 c_word LOC; // 1, 2, 3 c_word HOC; // 1, 2, 3 c_word ModuloMode; // 1, 2, 3 c_word WindowSize; // 1, 2, 3 c_word Resolution; // 4 c_word Options; // 5 c_word Format; // 4, 5 cp_content_string *pStationID; // 4, 5 cp_content_string *pHeadLine; // 4, 5 private: tFormatChar m_Format[7]; cp_content_string m_StationID; cp_content_string m_HeadLine; }; /*===========================================================================*\ \*===========================================================================*/ class cp_addinfo : public CCStruct { public: cp_addinfo (CCStruct *chinfo = 0, CCStruct *keyfac = 0, CCStruct *useruser = 0, CCStruct *facdata = 0, CCStruct *sendcomp = 0) : CCStruct (cxt_AdditionalInfo, &pBChannelInformation, cxf_STRUCT cxf_STRUCT cxf_STRUCT cxf_STRUCT), pBChannelInformation (chinfo), pKeypadFacility (keyfac), pUserUserData (useruser), pFacilityDataArray (facdata), pSendingComplete (sendcomp) {} CCStruct *pBChannelInformation; CCStruct *pKeypadFacility; CCStruct *pUserUserData; CCStruct *pFacilityDataArray; CCStruct *pSendingComplete; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cp_addinfo_store : public cp_addinfo { public: cp_addinfo_store (void) : cp_addinfo (&m_BChannelInformation, &m_KeypadFacility, &m_UserUserData, &m_FacilityDataArray, &m_SendingComplete) {} private: CCStructStore m_BChannelInformation; CCStructStore m_KeypadFacility; CCStructStore m_UserUserData; CCStructStore m_FacilityDataArray; CCStructStore m_SendingComplete; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cp_addinfo_ref : public cp_addinfo { public: cp_addinfo_ref (void) : cp_addinfo (&m_BChannelInformation, &m_KeypadFacility, &m_UserUserData, &m_FacilityDataArray, &m_SendingComplete) {} private: CCStruct m_BChannelInformation; CCStruct m_KeypadFacility; CCStruct m_UserUserData; CCStruct m_FacilityDataArray; CCStruct m_SendingComplete; }; /*===========================================================================*\ \*===========================================================================*/ class cp_ncpi : public CCStruct { protected: cp_ncpi (void *data, tFormatChar *format) : CCStruct (cxt_Ncpi, data, format) {} }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cp_ncpi_faxext : public cp_ncpi { public: cp_ncpi_faxext (c_word opt = 0) : cp_ncpi (&Options, cxf_Z_02 cxf_02 cxf_Z_05), Options (opt) {} c_word Options; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class cp_ncpi_all : public cp_ncpi { public: cp_ncpi_all (c_b3prot b3prot) : cp_ncpi (&Rate, &m_Format[0]), Rate (0), Protocol (0), Options (0), Resolution (0), Format (0), Pages (0), Flags (0), Group (0), Channel (0), pReceiveID (&m_ReceiveID) { switch (b3prot) { case b3prot_ISO8208: case b3prot_X25: s_strncpy (&m_Format[0], cxf_I_0C cxf_03, 3); break; case b3prot_G3Fax: s_strncpy (&m_Format[0], cxf_02 cxf_I_04 cxf_06 cxf_I_03 cxf_STRUCT, 6); break; case b3prot_G3Fax_extended: s_strncpy (&m_Format[0], cxf_02 cxf_I_02 cxf_02 cxf_I_02 cxf_04 cxf_I_03 cxf_STRUCT, 8); break; case b3prot_Modem: s_strncpy (&m_Format[0], cxf_04, 2); break; default: // nothing to do break; } } c_word Rate; // 4, 5, 7 c_word Protocol; // 7 c_word Options; // 5 c_word Resolution; // 4 c_word Format; // 4, 5 c_word Pages; // 4, 5 c_byte Flags; // 2, 3 c_byte Group; // 2, 3 c_byte Channel; // 2, 3 CCStruct *pReceiveID; // 4, 5 private: tFormatChar m_Format[8]; CCStruct m_ReceiveID; }; /*===========================================================================*\ \*===========================================================================*/ #pragma pack() #endif capi4hylafax-svn/src/capi/c2msgdef.h0000644000175000017500000001670210470310075017160 0ustar mastermaster /*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _C2MSGDEF_H_ #define _C2MSGDEF_H_ #include "capi2def.h" #include "aString.h" /*===========================================================================*\ \*===========================================================================*/ /*----- CAPI commands -----*/ #define CAPI_ALERT 0x01 #define CAPI_CONNECT 0x02 #define CAPI_CONNECT_ACTIVE 0x03 #define CAPI_CONNECT_B3_ACTIVE 0x83 #define CAPI_CONNECT_B3 0x82 #define CAPI_CONNECT_B3_T90_ACTIVE 0x88 #define CAPI_DATA_B3 0x86 #define CAPI_DISCONNECT_B3 0x84 #define CAPI_DISCONNECT 0x04 #define CAPI_FACILITY 0x80 #define CAPI_INFO 0x08 #define CAPI_LISTEN 0x05 #define CAPI_MANUFACTURER 0xff #define CAPI_RESET_B3 0x87 #define CAPI_SELECT_B_PROTOCOL 0x41 /*----- CAPI subcommands -----*/ #define CAPI_REQ 0x80 #define CAPI_CONF 0x81 #define CAPI_IND 0x82 #define CAPI_RESP 0x83 /*----- CAPI full commands -----*/ #define CAPI_ALERT_REQ ((CAPI_REQ << 8) | CAPI_ALERT) #define CAPI_ALERT_CONF ((CAPI_REQ << 8) | CAPI_ALERT) #define CAPI_CONNECT_REQ ((CAPI_REQ << 8) | CAPI_CONNECT) #define CAPI_CONNECT_CONF ((CAPI_CONF << 8) | CAPI_CONNECT) #define CAPI_CONNECT_IND ((CAPI_IND << 8) | CAPI_CONNECT) #define CAPI_CONNECT_RESP ((CAPI_RESP << 8) | CAPI_CONNECT) #define CAPI_CONNECT_ACTIVE_IND ((CAPI_IND << 8) | CAPI_CONNECT_ACTIVE) #define CAPI_CONNECT_ACTIVE_RESP ((CAPI_RESP << 8) | CAPI_CONNECT_ACTIVE) #define CAPI_CONNECT_B3_ACTIVE_IND ((CAPI_IND << 8) | CAPI_CONNECT_B3_ACTIVE) #define CAPI_CONNECT_B3_ACTIVE_RESP ((CAPI_RESP << 8) | CAPI_CONNECT_B3_ACTIVE) #define CAPI_CONNECT_B3_REQ ((CAPI_REQ << 8) | CAPI_CONNECT_B3) #define CAPI_CONNECT_B3_CONF ((CAPI_CONF << 8) | CAPI_CONNECT_B3) #define CAPI_CONNECT_B3_IND ((CAPI_IND << 8) | CAPI_CONNECT_B3) #define CAPI_CONNECT_B3_RESP ((CAPI_RESP << 8) | CAPI_CONNECT_B3) #define CAPI_CONNECT_B3_T90_ACTIVE_IND ((CAPI_IND << 8) | CAPI_CONNECT_B3_T90_ACTIVE) #define CAPI_CONNECT_B3_T90_ACTIVE_RESP ((CAPI_RESP << 8) | CAPI_CONNECT_B3_T90_ACTIVE) #define CAPI_DATA_B3_REQ ((CAPI_REQ << 8) | CAPI_DATA_B3) #define CAPI_DATA_B3_CONF ((CAPI_CONF << 8) | CAPI_DATA_B3) #define CAPI_DATA_B3_IND ((CAPI_IND << 8) | CAPI_DATA_B3) #define CAPI_DATA_B3_RESP ((CAPI_RESP << 8) | CAPI_DATA_B3) #define CAPI_DISCONNECT_B3_REQ ((CAPI_REQ << 8) | CAPI_DISCONNECT_B3) #define CAPI_DISCONNECT_B3_CONF ((CAPI_CONF << 8) | CAPI_DISCONNECT_B3) #define CAPI_DISCONNECT_B3_IND ((CAPI_IND << 8) | CAPI_DISCONNECT_B3) #define CAPI_DISCONNECT_B3_RESP ((CAPI_RESP << 8) | CAPI_DISCONNECT_B3) #define CAPI_DISCONNECT_REQ ((CAPI_REQ << 8) | CAPI_DISCONNECT) #define CAPI_DISCONNECT_CONF ((CAPI_CONF << 8) | CAPI_DISCONNECT) #define CAPI_DISCONNECT_IND ((CAPI_IND << 8) | CAPI_DISCONNECT) #define CAPI_DISCONNECT_RESP ((CAPI_RESP << 8) | CAPI_DISCONNECT) #define CAPI_FACILITY_REQ ((CAPI_REQ << 8) | CAPI_CAPI_FACILITY) #define CAPI_FACILITY_CONF ((CAPI_CONF << 8) | CAPI_CAPI_FACILITY) #define CAPI_FACILITY_IND ((CAPI_IND << 8) | CAPI_CAPI_FACILITY) #define CAPI_FACILITY_RESP ((CAPI_RESP << 8) | CAPI_CAPI_FACILITY) #define CAPI_INFO_REQ ((CAPI_REQ << 8) | CAPI_INFO) #define CAPI_INFO_CONF ((CAPI_CONF << 8) | CAPI_INFO) #define CAPI_INFO_IND ((CAPI_IND << 8) | CAPI_INFO) #define CAPI_INFO_RESP ((CAPI_RESP << 8) | CAPI_INFO) #define CAPI_LISTEN_REQ ((CAPI_REQ << 8) | CAPI_LISTEN) #define CAPI_LISTEN_CONF ((CAPI_CONF << 8) | CAPI_LISTEN) #define CAPI_MANUFACTURER_REQ ((CAPI_REQ << 8) | CAPI_MANUFACTURER) #define CAPI_MANUFACTURER_CONF ((CAPI_CONF << 8) | CAPI_MANUFACTURER) #define CAPI_MANUFACTURER_IND ((CAPI_IND << 8) | CAPI_MANUFACTURER) #define CAPI_MANUFACTURER_RESP ((CAPI_RESP << 8) | CAPI_MANUFACTURER) #define CAPI_RESET_B3_REQ ((CAPI_REQ << 8) | CAPI_RESET_B3) #define CAPI_RESET_B3_CONF ((CAPI_CONF << 8) | CAPI_RESET_B3) #define CAPI_RESET_B3_IND ((CAPI_IND << 8) | CAPI_RESET_B3) #define CAPI_RESET_B3_RESP ((CAPI_RESP << 8) | CAPI_RESET_B3) #define CAPI_SELECT_B_PROTOCOL_REQ ((CAPI_REQ << 8) | CAPI_SELECT_B_PROTOCOL) #define CAPI_SELECT_B_PROTOCOL_CONF ((CAPI_CONF << 8) | CAPI_SELECT_B_PROTOCOL) /*===========================================================================*\ \*===========================================================================*/ #define CAPI_MSG_HEADER_SIZE 8 #define CAPI_MSG_HEADER_ADDR_SIZE 12 // Header + Controller/NCCI/PLCI #define CAPI_MAX_MESSAGE_COUNTER (CAPI_MAX_OUTSTANDING_FRAMES * CAPI_DEFAULT_S0_LINES_COUNT) #ifdef C_PLATFORM_64 #define CAPI_MSG_DATA_POS (CAPI_MSG_HEADER_ADDR_SIZE + 10) #else #define CAPI_MSG_DATA_POS CAPI_MSG_HEADER_ADDR_SIZE #endif /*===========================================================================*\ \*===========================================================================*/ #define CapiMsg_GetMsgLen(name) get16 (name) #define CapiMsg_GetApplID(name) get16 ((name) + 2) #define CapiMsg_GetCmd(name) get8 ((name) + 4) #define CapiMsg_GetSubCmd(name) get8 ((name) + 5) #define CapiMsg_GetFullCmd(name) get16 ((name) + 4) #define CapiMsg_GetMsgNr(name) get16 ((name) + 6) #define CapiMsg_GetAddr(name) get32 ((name) + 8) #define CapiMsg_GetWord(name, pos) get16 ((name) + (pos) + CAPI_MSG_HEADER_ADDR_SIZE) #define CapiMsg_GetInfo(name, pos) ((c_info)CapiMsg_GetWord (name, pos)) #define CapiMsg_GetData(name) ((c_dataptr)getPtr ((name) + CAPI_MSG_DATA_POS)) /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/capi/DataHand.cpp0000644000175000017500000001461010470310075017461 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "DataHand.h" #include "dbgCAPI.h" /*===========================================================================*\ CDataHandleAdmin - Constructor \*===========================================================================*/ CDataHandleAdmin::CDataHandleAdmin (void) : m_Array (0), m_maxEntries (0), m_curEntries (0), m_nextOne (0) { dhead ("CDataHandleAdmin-Constructor", DCON_CTransferChannel); m_Protect.Init(); } /*===========================================================================*\ CDataHandleAdmin - Destructor \*===========================================================================*/ CDataHandleAdmin::~CDataHandleAdmin (void) { dhead ("CDataHandleAdmin-Destructor", DCON_CTransferChannel); if (m_Protect.IsInitialized() == vTrue) { m_Protect.BeginWrite(); HandleArray *tmpArray = m_Array; m_nextOne = 0; m_curEntries = 0; m_maxEntries = 0; m_Array = 0; m_Protect.EndWrite(); delete [] tmpArray; } else { dassert (m_Array == 0); } } /*===========================================================================*\ CDataHandleAdmin::New \*===========================================================================*/ tBool CDataHandleAdmin::InitEntries (tUShort MaxEntries) { dhead ("CDataHandleAdmin::New", DCON_CTransferChannel); dassert (MaxEntries > 0); dassert (m_Array == 0); tBool fret = vFalse; if (m_Protect.Init()) { m_Array = new HandleArray [MaxEntries]; if (m_Array) { m_Array[MaxEntries - 1].pointer = 0; m_Array[MaxEntries - 1].inuse = vFalse; m_Array[MaxEntries - 1].next = 0; for (tUShort i = (tUShort)(MaxEntries - 1); i > 0; i--) { m_Array[i - 1].pointer = 0; m_Array[i - 1].inuse = vFalse; m_Array[i - 1].next = (tUShort) (i + 1); } m_nextOne = 1; m_maxEntries = MaxEntries; fret = vTrue; } } RETURN ('x', fret); } /*===========================================================================*\ CDataHandleAdmin::New \*===========================================================================*/ tBool CDataHandleAdmin::New (void *NewDataHandle, tUShort *RetHandle) { dhead ("CDataHandleAdmin::New", DCON_CTransferChannel); dassert (m_curEntries < m_maxEntries); dassert (RetHandle != 0); dassert (m_nextOne <= m_maxEntries); tBool fret = vFalse; m_Protect.BeginWrite(); if (m_nextOne) { tUShort get = (tUShort)(m_nextOne - 1); m_nextOne = m_Array[get].next; m_Array[get].next = 0; m_Array[get].inuse = vTrue; m_Array[get].pointer = NewDataHandle; *RetHandle = get; fret = vTrue; m_curEntries++; } m_Protect.EndWrite(); RETURN ('x', fret); } /*===========================================================================*\ CDataHandleAdmin::Free \*===========================================================================*/ tBool CDataHandleAdmin::Free (tUShort InHandle, void **RetDataHandle) { dhead ("CDataHandleAdmin::Free", DCON_CTransferChannel); dassert (RetDataHandle != 0); dassert (InHandle < m_maxEntries); dassert (m_curEntries > 0); dassert (m_nextOne <= m_maxEntries); dassert (m_Array[InHandle].inuse == vTrue); dassert (m_Array[InHandle].next == 0); tBool fret = vTrue; m_Protect.BeginWrite(); if ((InHandle < m_maxEntries) && (m_Array[InHandle].inuse == vTrue)) { *RetDataHandle = m_Array[InHandle].pointer; m_Array[InHandle].pointer = 0; m_Array[InHandle].inuse = vFalse; m_Array[InHandle].next = m_nextOne; m_nextOne = (tUShort)(InHandle + 1); m_curEntries--; } else { fret = vFalse; } m_Protect.EndWrite(); RETURN ('x', fret); } /*===========================================================================*\ CDataHandleAdmin::DelNextEntry \*===========================================================================*/ tBool CDataHandleAdmin::DelNextEntry (void **HandleToDel) { dhead ("CDataHandleAdmin::DelNextEntry", DCON_CTransferChannel); dassert (m_nextOne <= m_maxEntries); tBool fret = vFalse; m_Protect.BeginWrite(); if (m_curEntries) { tUShort lauf; for (tUShort i = 1; i <= m_maxEntries; i++) { lauf = m_nextOne; while (lauf != 0) { if (lauf == i) { break; } else { lauf = m_Array[lauf - 1].next; dassert (lauf <= m_maxEntries); dinfo (lauf <= m_maxEntries, "lauf=%x ", lauf); } } if (lauf == 0) { if (HandleToDel) { dwarning (m_Array[i - 1].pointer != 0); *HandleToDel = m_Array[i - 1].pointer; } m_Array[i - 1].pointer = 0; m_Array[i - 1].inuse = vFalse; m_Array[i - 1].next = m_nextOne; m_nextOne = i; fret = vTrue; m_curEntries--; break; } } } m_Protect.EndWrite(); RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/capi/CapiStat.cpp0000644000175000017500000006621010470310075017530 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "CapiStat.h" #include "CCSFacil.h" #include "aString.h" #include "aFlags.h" #include "dbgCAPI.h" /*---------------------------------------------------------------------------*\ #define MODEM_STARTED 1 #define MODEM_SYNCED 2 #define MODEM_SELFTEST_FAILED 3 #define MODEM_RETRAIN 4 #define MODEM_DATAPHASE 8 #define MODEM_RETRAIN_OPTIONS_FAILED 16 #define MODEM_RETRAIN_TIMEOUT 17 #define MODEM_RETRAIN_WRONG_CRC 18 #define MODEM_RETRAIN_LOF 19 #define MODEM_RETRAIN_LOS 20 #define MODEM_RETRAIN_BITSRATE_TOO_HIGH 21 #define MODEM_RETRAIN_SELFTEST 22 \*---------------------------------------------------------------------------*/ #define CAPI_MANU_ID_AVM 0x214D5641 #define CAPI_MANU_FUNCTION_ADSL 0x07 /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #pragma pack(1) class cp_Manu_DSLParameter : public CCStruct { public: cp_Manu_DSLParameter (void) : CCStruct (cxt_Manufacturer, &ModemState, 6, cxf_04 cxf_STRUCT cxf_STRUCT), ModemState (0), pIdentification (&m_Identification), pLineParameters (&m_LineParameters) {} c_dword ModemState; CCStruct *pIdentification; CCStruct *pLineParameters; private: CCStruct m_Identification; CCStruct m_LineParameters; }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ struct cManu_LineParameters { c_word AttainableKBitrateUS; /* in KBit/s */ c_word AttainableKBitrateDS; /* in KBit/s */ c_word UsedOptionUS; /* [-1,3] */ c_word UsedOptionDS; /* [-1,3] */ c_byte US_FastUsed[4]; /* bool */ c_word US_DatabytesPerSymbol[4]; /* dezimal */ c_byte US_CheckbytesPerCodeword[4]; /* dezimal */ c_byte US_SymbolsPerCodeword[4]; /* dezimal */ c_word US_InterleaveDepth[4]; /* dezimal */ c_byte DS_FastUsed[4]; /* bool */ c_word DS_DatabytesPerSymbol[4]; /* dezimal */ //c_byte DS_CheckbytesPerCodeword[4]; /* dezimal */ //c_byte DS_SymbolsPerCodeword[4]; /* dezimal */ //c_word DS_InterleaveDepth[4]; /* dezimal */ }; #pragma pack() /*===========================================================================*\ \*===========================================================================*/ CCAPI20_Statistic::CCAPI20_Statistic (ctStatDeep statdeep) : m_pCurrentData (0), m_pFreshingData (0), m_FreshingController (0), m_Deep (statdeep), m_CountReqCalls (0), m_CallBackFunc (0), m_CallBackHandle (0), m_FreshOnError (vFalse) { dhead ("CCAPI20_Statistic-Constructor", DCON_CCAPI20_Statistic); m_Protect.Init(); } /*===========================================================================*\ \*===========================================================================*/ CCAPI20_Statistic::~CCAPI20_Statistic (void) { dhead ("CCAPI20_Statistic-Destructor", DCON_CCAPI20_Statistic); dassert (m_pFreshingData == 0); if (m_Protect.IsInitialized()) { m_Protect.BeginWrite(); ctIntCapiData *pDelData = m_pCurrentData; m_pCurrentData = 0; m_Protect.EndWrite(); if (pDelData) { delete [] pDelData->pControllerData; delete pDelData; } } else { dassert (m_pCurrentData == 0); } } /*===========================================================================*\ \*===========================================================================*/ void CCAPI20_Statistic::FreshUp (tBool FreshUpOnError) { dhead ("CCAPI20_Statistic::FreshUp", DCON_CCAPI20_Statistic); if (m_Protect.Init()) { m_Protect.BeginWrite(); if (!m_pFreshingData) { m_pFreshingData = new ctIntCapiData; m_Protect.EndWrite(); dassert (m_pFreshingData != 0); // this case not handled at the moment dassert (m_CountReqCalls == 0); if (m_pFreshingData) { m_pFreshingData->CapiInstalled = ci_Reg_NotInstalled; m_pFreshingData->CountControllers = 0; m_pFreshingData->pControllerData = 0; m_FreshingController = 0; m_CountReqCalls = 0; m_FreshOnError = FreshUpOnError; REGISTER (1, 2, CAPI_MAX_MESSAGE_SIZE); } else { FreshUpComplete (ci_Int_MemoryFullErr); } } else { m_Protect.EndWrite(); } } else { FreshUpComplete (ci_Int_MemoryFullErr); } } /*===========================================================================*\ \*===========================================================================*/ void CCAPI20_Statistic::FreshUpComplete (c_info Info) { dhead ("CCAPI20_Statistic::FreshUpComplete", DCON_CCAPI20_Statistic); if (m_CallBackFunc) { m_CallBackFunc (m_CallBackHandle, Info); } } /*===========================================================================*\ \*===========================================================================*/ c_info CCAPI20_Statistic::CapiInstalled (void) { dhead ("CCAPI20_Statistic::CapiInstalled", DCON_CCAPI20_Statistic); c_info fret = ci_Reg_Busy; m_Protect.BeginRead(); if (m_pCurrentData) { fret = m_pCurrentData->CapiInstalled; } m_Protect.EndRead(); RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ tUInt CCAPI20_Statistic::CountControllers (void) { dhead ("CCAPI20_Statistic::CountControllers", DCON_CCAPI20_Statistic); dassert (m_Deep >= StatDeep_CountCntrl); tUInt fret = 0; m_Protect.BeginRead(); if (m_pCurrentData) { fret = m_pCurrentData->CountControllers; } m_Protect.EndRead(); return fret; } /*===========================================================================*\ \*===========================================================================*/ tUInt CCAPI20_Statistic::CountBChannels (tUInt Controller) { dhead ("CCAPI20_Statistic::CountBChannels", DCON_CCAPI20_Statistic); dassert (m_Deep >= StatDeep_CntrlProps); tUInt fret = 0; m_Protect.BeginRead(); if (m_pCurrentData && m_pCurrentData->CountControllers) { dassert (Controller > 0); dassert (Controller <= m_pCurrentData->CountControllers); fret = m_pCurrentData->pControllerData[Controller - 1].NumBChannels; } m_Protect.EndRead(); return fret; } /*===========================================================================*\ \*===========================================================================*/ c_dword CCAPI20_Statistic::Profile_GlobalOptions (tUInt Controller) { dhead ("CCAPI20_Statistic::Profile_GlobalOptions", DCON_CCAPI20_Statistic); dassert (m_Deep >= StatDeep_CntrlProps); c_dword fret = 0; m_Protect.BeginRead(); if (m_pCurrentData && m_pCurrentData->pControllerData) { dassert (Controller > 0); dassert (Controller <= m_pCurrentData->CountControllers); fret = m_pCurrentData->pControllerData[Controller - 1].GlobalOptions; } m_Protect.EndRead(); return fret; } /*===========================================================================*\ \*===========================================================================*/ c_dword CCAPI20_Statistic::Profile_B1Protocol (tUInt Controller) { dhead ("CCAPI20_Statistic::Profile_B1Protocol", DCON_CCAPI20_Statistic); dassert (m_Deep >= StatDeep_CntrlProps); c_dword fret = 0; m_Protect.BeginRead(); if (m_pCurrentData && m_pCurrentData->pControllerData) { dassert (Controller > 0); dassert (Controller <= m_pCurrentData->CountControllers); fret = m_pCurrentData->pControllerData[Controller - 1].B1ProtocolSupport; } m_Protect.EndRead(); return fret; } /*===========================================================================*\ \*===========================================================================*/ c_dword CCAPI20_Statistic::Profile_B2Protocol (tUInt Controller) { dhead ("CCAPI20_Statistic::Profile_B2Protocol", DCON_CCAPI20_Statistic); dassert (m_Deep >= StatDeep_CntrlProps); c_dword fret = 0; m_Protect.BeginRead(); if (m_pCurrentData && m_pCurrentData->pControllerData) { dassert (Controller > 0); dassert (Controller <= m_pCurrentData->CountControllers); fret = m_pCurrentData->pControllerData[Controller - 1].B2ProtocolSupport; } m_Protect.EndRead(); return fret; } /*===========================================================================*\ \*===========================================================================*/ c_dword CCAPI20_Statistic::Profile_B3Protocol (tUInt Controller) { dhead ("CCAPI20_Statistic::Profile_B3Protocol", DCON_CCAPI20_Statistic); dassert (m_Deep >= StatDeep_CntrlProps); c_dword fret = 0; m_Protect.BeginRead(); if (m_pCurrentData && m_pCurrentData->pControllerData) { dassert (Controller > 0); dassert (Controller <= m_pCurrentData->CountControllers); fret = m_pCurrentData->pControllerData[Controller - 1].B3ProtocolSupport; } m_Protect.EndRead(); return fret; } /*===========================================================================*\ \*===========================================================================*/ c_dword CCAPI20_Statistic::SupplServices (tUInt Controller) { dhead ("CCAPI20_Statistic::SupplServices", DCON_CCAPI20_Statistic); dassert (m_Deep >= StatDeep_CntrlFacilities); c_dword fret = 0; m_Protect.BeginRead(); if (m_pCurrentData && m_pCurrentData->pControllerData) { dassert (Controller > 0); dassert (Controller <= m_pCurrentData->CountControllers); fret = m_pCurrentData->pControllerData[Controller - 1].SupplServices; } m_Protect.EndRead(); return fret; } /*===========================================================================*\ \*===========================================================================*/ tUInt CCAPI20_Statistic::DSL_FindController (tUInt Controller) { dhead ("CCAPI20_Statistic::DSL_FindController", DCON_CCAPI20_Statistic); tUInt fret = 0; m_Protect.BeginRead(); if (m_pCurrentData && m_pCurrentData->pControllerData) { dassert (Controller <= m_pCurrentData->CountControllers); for (; Controller < m_pCurrentData->CountControllers; Controller++) { if (CheckOneFlag (m_pCurrentData->pControllerData[Controller].B1ProtocolSupport, b1prot_ATM) == vTrue) { fret = Controller + 1; break; } } } m_Protect.EndRead(); RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ tUInt CCAPI20_Statistic::DSL_GetModemState (tUInt Controller) { dhead ("CCAPI20_Statistic::DSL_GetModemState", DCON_CCAPI20_Statistic); tUInt fret = 0; m_Protect.BeginRead(); if (m_pCurrentData && m_pCurrentData->pControllerData) { dassert (Controller > 0); dassert (Controller <= m_pCurrentData->CountControllers); if (CheckOneFlag (m_pCurrentData->pControllerData[Controller - 1].B1ProtocolSupport, b1prot_ATM) == vTrue) { fret = m_pCurrentData->pControllerData[Controller - 1].DSL_ModemState; } } m_Protect.EndRead(); RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ tUInt CCAPI20_Statistic::DSL_GetSpeed (tUInt Controller) { dhead ("CCAPI20_Statistic::DSL_GetSpeed", DCON_CCAPI20_Statistic); tUInt fret = 0; m_Protect.BeginRead(); if (m_pCurrentData && m_pCurrentData->pControllerData) { dassert (Controller > 0); dassert (Controller <= m_pCurrentData->CountControllers); if (CheckOneFlag (m_pCurrentData->pControllerData[Controller - 1].B1ProtocolSupport, b1prot_ATM) == vTrue) { fret = m_pCurrentData->pControllerData[Controller - 1].DSL_Speed; // Korregiere DSL_Speed (s. MANUFACTURER_IND) if (fret) { fret--; } } } m_Protect.EndRead(); RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ tBool CCAPI20_Statistic::DSL_GetMACAddress (tUInt Controller, tUByte *pAddress) { dhead ("CCAPI20_Statistic::DSL_GetMACAddress", DCON_CCAPI20_Statistic); tBool fret = vFalse; m_Protect.BeginRead(); if (m_pCurrentData && m_pCurrentData->pControllerData) { dassert (Controller > 0); dassert (Controller <= m_pCurrentData->CountControllers); if ( (CheckOneFlag (m_pCurrentData->pControllerData[Controller - 1].B1ProtocolSupport, b1prot_ATM) == vTrue) && (*(tUInt32 *)m_pCurrentData->pControllerData[Controller - 1].DSL_MACAddress != 0)) { // seems to be a valid MAC Address s_memcpy (pAddress, m_pCurrentData->pControllerData[Controller - 1].DSL_MACAddress, 6); fret = vTrue; } } m_Protect.EndRead(); RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ void CCAPI20_Statistic::REGISTER_COMPLETE (c_info ErrorCode) { dhead ("CCAPI20_Statistic::REGISTER_COMPLETE", DCON_CCAPI20_Statistic); dparams ("%x", ErrorCode); dassert (m_pFreshingData != 0); dassert (m_FreshingController == 0); m_pFreshingData->CapiInstalled = ErrorCode; if (ErrorCode == ci_NoError) { if (m_Deep > StatDeep_OnlyInstall) { GET_PROFILE (1); } else { RELEASE(); } } else { UpdateCurrent (ErrorCode); } } /*===========================================================================*\ \*===========================================================================*/ void CCAPI20_Statistic::RELEASE_COMPLETE (void) { dhead ("CCAPI20_Statistic::RELEASE_COMPLETE", DCON_CCAPI20_Statistic); dassert (m_pFreshingData != 0); UpdateCurrent (ci_NoError); } /*===========================================================================*\ \*===========================================================================*/ void CCAPI20_Statistic::GET_PROFILE_COMPLETE (tUInt /*Controller*/, cm_getprofile *pProfile, c_info ErrorCode) { dhead ("CCAPI20_Statistic::GET_PROFILE_COMPLETE", DCON_CCAPI20_Statistic); dparams ("%p,%x", pProfile, ErrorCode); dassert (m_pFreshingData != 0); if (ErrorCode != ci_NoError) { //TODO?: Return error error code in Complete? RELEASE(); return; } dassert (pProfile != 0); //dprintBuf (pProfile, sizeof (*pProfile)); // Is this the first get profile call? Then check the numbers of controllers if (!m_pFreshingData->pControllerData) { dprint ("NumContrl=%x ", pProfile->NumControllers); m_pFreshingData->CountControllers = pProfile->NumControllers; if ((m_Deep <= StatDeep_CountCntrl) || (!pProfile->NumControllers)) { RELEASE(); return; } m_pFreshingData->pControllerData = new ctIntCntrlData [pProfile->NumControllers]; if (!m_pFreshingData->pControllerData) { delete m_pFreshingData; m_pFreshingData = 0; //TODO: FreshUpComplete (ci_Int_MemoryFullErr); dwarning (0); RELEASE(); return; } s_memzero (m_pFreshingData->pControllerData, sizeof (ctIntCntrlData) * pProfile->NumControllers); } m_pFreshingData->pControllerData[m_FreshingController].NumBChannels = pProfile->NumBChannels; s_memcpy (&m_pFreshingData->pControllerData[m_FreshingController].GlobalOptions, &pProfile->GlobalOptions, 4 * sizeof (c_dword)); if (++m_FreshingController < m_pFreshingData->CountControllers) { GET_PROFILE (m_FreshingController + 1); } else if (m_Deep >= StatDeep_DSLProps) { // GetProfile is finished, now start manu- and facility req's CCStruct manudata_speed ("\x03\x00", 2); CCStruct manudata_mac ("\x08\x06\x00\x00\x00\x00\x00\x00\x00", 8); tUInt i; dassert (m_CountReqCalls == 0); m_Protect.Inc (&m_CountReqCalls); dprint ("m_CountReqCalls-Inc=%x ", m_CountReqCalls); for (i = 0; i < m_pFreshingData->CountControllers; ) { if (CheckOneFlag (m_pFreshingData->pControllerData[i++].B1ProtocolSupport, b1prot_ATM) == vTrue) { // Found DSL Controller m_Protect.Add (&m_CountReqCalls, (tUInt)3); // 3 for the req's and one for the ind / nolisten-req m_pFreshingData->pControllerData[i - 1].DSL_Retries = 5; // 5 Tries to get the DSL Informations DSLManuReq (i, &manudata_speed); DSLManuReq (i, &manudata_mac); } } if (m_Deep >= StatDeep_CntrlFacilities) { CCStruct FacilGetSupplServ ("\x00\x00\x00", 3); cm_facilityreq FacParams (facilselect_SupplServices, &FacilGetSupplServ); for (i = 0; i < m_pFreshingData->CountControllers; ) { if (CheckOneFlag (m_pFreshingData->pControllerData[i++].GlobalOptions, gof_SupplementaryServices) == vTrue) { // Supplementary Services are supported m_Protect.Inc (&m_CountReqCalls); FACILITY_REQ (GetNextMsgNr(), i, &FacParams); } } } CallFinished(); } else { RELEASE(); } } /*===========================================================================*\ \*===========================================================================*/ void CCAPI20_Statistic::FACILITY_CONF (c_word, c_dword Address, cm_facilityconf *Params) { dhead ("CCAPI20_Statistic::FACILITY_CONF", DCON_CCAPI20_Statistic); dassert (Address > 0); dassert (Params != 0); dassert (Params->pFacilityParam != 0); dassert (m_pFreshingData != 0); dassert (Address <= m_pFreshingData->CountControllers); if ( CapiInfoIsSuccess (Params->Info) && (Params->FacilitySelector == facilselect_SupplServices)) { cp_facility_supplserv_conf SupplConf; if ( infoSuccess (SupplConf.ParseStruct (Params->pFacilityParam)) && (SupplConf.Function == supplserv_GetSupportedServices) && CapiInfoIsSuccess (SupplConf.pParameter->Info)) { m_pFreshingData->pControllerData[Address - 1].SupplServices = SupplConf.pParameter->SupportedServices; } } CallFinished(); } /*===========================================================================*\ \*===========================================================================*/ void CCAPI20_Statistic::MANUFACTURER_CONF (c_word, c_dword Controller, cm_manufacturer *Params) { dhead ("CCAPI20_Statistic::MANUFACTURER_CONF", DCON_CCAPI20_Statistic); dassert (Params != 0); dassert (Params->ManuID == CAPI_MANU_ID_AVM); dassert (m_pFreshingData != 0); dwarning (Params->Class == 0); if ( (Params->ManuID == CAPI_MANU_ID_AVM) && (Params->Function == CAPI_MANU_FUNCTION_ADSL)) { dassert (Params->pManuData != 0); dwarning (Params->pManuData->GetLen() > 0); if (Params->pManuData->GetLen()) { switch (*(c_word *)Params->pManuData->GetData()) { case 0x06: dwarning (Params->pManuData->GetLen() >= 8); if ((Params->Class == ci_NoError) && (Params->pManuData->GetLen() >= 8)) { s_memcpy (m_pFreshingData->pControllerData[Controller - 1].DSL_MACAddress, Params->pManuData->GetData() + 2, 6); } break; case 0x03: if (CapiInfoIsError (Params->Class)) { if (m_pFreshingData->pControllerData[Controller - 1].DSL_Retries) { m_pFreshingData->pControllerData[Controller - 1].DSL_Retries--; m_Protect.Inc (&m_CountReqCalls); CCStruct manudata_speed ("\x03\x00", 2); DSLManuReq (Controller, &manudata_speed); } else { dwarning (0); dassert (m_CountReqCalls > 1); m_Protect.Dec (&m_CountReqCalls); } } break; default: dprintWrn ("Unexpected Service=%x ", *(c_word *)Params->pManuData->GetData()); break; } } } CallFinished(); } /*===========================================================================*\ \*===========================================================================*/ tBool CCAPI20_Statistic::MANUFACTURER_IND (c_word, c_dword Controller, cm_manufacturer *Params) { dhead ("CCAPI20_Statistic::MANUFACTURER_IND", DCON_CCAPI20_Statistic); dassert (Params != 0); dassert (Params->pManuData != 0); dassert (Params->ManuID == CAPI_MANU_ID_AVM); dassert (m_pFreshingData != 0); dprint ("Cntrl=%x, Func=%x, Speed=%x, Len=%x ", Controller, Params->Function, m_pFreshingData->pControllerData[Controller - 1].DSL_Speed, Params->pManuData->GetLen()); if ( (Params->ManuID != CAPI_MANU_ID_AVM) || (Controller > m_pFreshingData->CountControllers) || (Params->Function != CAPI_MANU_FUNCTION_ADSL)) { return vFalse; } { cm_manufacturer RespParams (CAPI_MANU_ID_AVM, 0, CAPI_MANU_FUNCTION_ADSL, 0); MANUFACTURER_RESP (GetNextMsgNr(), Controller, &RespParams); } if (!m_pFreshingData->pControllerData[Controller - 1].DSL_Speed) { cp_Manu_DSLParameter dslparam; if (infoSuccess (dslparam.ParseStruct (Params->pManuData))) { m_pFreshingData->pControllerData[Controller - 1].DSL_ModemState = dslparam.ModemState; if (dslparam.ModemState < 8) { // DSL not ready => stop all m_pFreshingData->pControllerData[Controller - 1].DSL_Retries = 0; } else { dassert (dslparam.pLineParameters != 0); dinfo (dslparam.pLineParameters->GetLen() >= sizeof (cManu_LineParameters), "To Short=%x!! ", dslparam.pLineParameters->GetLen()); cManu_LineParameters *pLineParams = (cManu_LineParameters *)dslparam.pLineParameters->GetData(); if ( (dslparam.pLineParameters->GetLen() >= sizeof (cManu_LineParameters)) && (pLineParams->UsedOptionDS < 4)) { dassert (pLineParams != 0); m_pFreshingData->pControllerData[Controller - 1].DSL_Speed = (pLineParams->DS_DatabytesPerSymbol[pLineParams->UsedOptionDS] * 48 / 53 * 32) * 1000 + 1; // Damit CallFinished nicht zu oft aufgerufen wird, nutzte ich DSL_Speed als Testmerkmal. // Dafür muß obige Zuweisung immer != 0 sein. Deshalb wird vorsorglich eine 1 addiert, // die später wieder abgezogen wird. dprint ("Controller=%x,DSL_Speed=%x ", Controller, m_pFreshingData->pControllerData[Controller - 1].DSL_Speed); // stop dsl listen m_pFreshingData->pControllerData[Controller - 1].DSL_Retries = 0; } } } dwarning (0); if (m_pFreshingData->pControllerData[Controller - 1].DSL_Retries) { m_pFreshingData->pControllerData[Controller - 1].DSL_Retries--; m_Protect.Inc (&m_CountReqCalls); CCStruct manudata_speed ("\x03\x00", 2); DSLManuReq (Controller, &manudata_speed); } else { CallFinished(); } } return vTrue; } /*===========================================================================*\ \*===========================================================================*/ void CCAPI20_Statistic::DSLManuReq (tUInt Controller, CCStruct *pManuData) { dhead ("CCAPI20_Statistic::DSLManuReq", DCON_CCAPI20_Statistic); dassert (Controller > IllegalController); dassert (pManuData != 0); cm_manufacturer pm (CAPI_MANU_ID_AVM, 0, CAPI_MANU_FUNCTION_ADSL, pManuData); MANUFACTURER_REQ (GetNextMsgNr(), Controller, &pm); } /*===========================================================================*\ \*===========================================================================*/ void CCAPI20_Statistic::CallFinished (void) { dhead ("CCAPI20_Statistic::CallFinished", DCON_CCAPI20_Statistic); dparams ("%x", m_CountReqCalls); dassert (m_CountReqCalls > 0); dassert (m_pFreshingData != 0); if (m_Protect.Dec (&m_CountReqCalls) == 1) { RELEASE(); } dprint ("new_count=%x ", m_CountReqCalls); } /*===========================================================================*\ \*===========================================================================*/ void CCAPI20_Statistic::UpdateCurrent (c_info Info) { dhead ("CCAPI20_Statistic::UpdateCurrent", DCON_CCAPI20_Statistic); ctIntCapiData *pDelData = 0; m_Protect.BeginWrite(); if ((Info != ci_NoError) && (m_FreshOnError == vFalse)) { // ignore this m_pFreshingData if (m_pFreshingData) { pDelData = m_pFreshingData; m_pFreshingData = 0; } } else if (m_pFreshingData) { pDelData = m_pCurrentData; m_pCurrentData = m_pFreshingData; m_pFreshingData = 0; } m_Protect.EndWrite(); if (pDelData) { delete [] pDelData->pControllerData; delete pDelData; } FreshUpComplete (Info); } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/capi/Facility.h0000644000175000017500000001556210470310075017235 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _FACILITY_H_ #define _FACILITY_H_ #include "CapiChan.h" #include "CCSFacil.h" #define USE_SUPPLEMENTARY_SERVICES /*===========================================================================*\ \*===========================================================================*/ class CCAPI20_Facility : protected CCAPI20_Channel { public: /*-----------------------------------------------------------------------*\ Facility Req, Conf & Ind except Supplementary Services \*-----------------------------------------------------------------------*/ void fReq_DTMF (c_dtmffunction Function, c_word ToneDuration, c_word GapDuration, CDynamicString *pDTMFDigits, CCStruct *pDTMFCharacteristics); virtual void fConf_DTMF (c_info /*Info*/) {} // DTMF information mapping into c_info: // 0 = ci_NoError // 1 = ci_Int_IncorrectDTMFDigit // 2 = ci_Int_UnknownDTMFRequest virtual void fInd_DTMF (CCStruct * /*pDTMFdigits*/) {} /*-----------------------------------------------------------------------*/ void fReq_PMWakeup (c_dword Controller, c_word NumberRequested, cp_facilityreq_wakeupparam *NumberList); virtual void fConf_PMWakeup (c_dword /*Controller*/, c_info /*Info*/, c_word /*NumberAccepted*/) {} /*-----------------------------------------------------------------------*\ Supplementary Services - REQUEST \*-----------------------------------------------------------------------*/ #ifdef USE_SUPPLEMENTARY_SERVICES void fReq_Listen (c_dword Controller, c_dword NotificationMask); void fReq_Hold (void); void fReq_Retrieve (void); void fReq_Suspend (CDynamicString *pCallIdentity); void fReq_Resume (c_dword Controller, CDynamicString *pCallIdentity); void fReq_ECT (CCAPI20_Channel *pChannel); void fReq_3PTY_Begin (CCAPI20_Channel *pChannel); void fReq_3PTY_End (CCAPI20_Channel *pChannel); void fReq_CD (tBool PresentationAllowed, CDynamicString *pDeflectToNumber); void fReq_MCID (void); //void fReq_CCBS_Request (???); //void fReq_CCBS_Deactivate (???); //void fReq_CCBS_Interrogate (???); //void fReq_CCBS_Call (c_cipvalue CIPValue, cm_bprotocol BProtocol); /*-----------------------------------------------------------------------*\ Supplementary Services - CONFIRMATION \*-----------------------------------------------------------------------*/ virtual void fConf_Listen (c_info /*Info*/) {} /*-----------------------------------------------------------------------*\ Supplementary Services - INDICATION \*-----------------------------------------------------------------------*/ virtual void fInd_Hold (c_info /*Reason*/) {} virtual void fInd_Retrieve (c_info /*Reason*/) {} virtual void fInd_Suspend (c_info /*Reason*/) {} virtual void fInd_Resume (c_info /*Reason*/) {} virtual void fInd_ECT (c_info /*Reason*/) {} virtual void fInd_3PTY_Begin (c_info /*Reason*/) {} virtual void fInd_3PTY_End (c_info /*Reason*/) {} virtual void fInd_CD (c_info /*Reason*/) {} virtual void fInd_MCID (c_info /*Reason*/) {} //virtual void fInd_CCBS_Request (c_info /*Reason*/, ???); //virtual void fInd_CCBS_Deactivate (c_info /*Reason*/, ???); //virtual void fInd_CCBS_Interrogate (c_info /*Reason*/, ???); //virtual void fInd_CCBS_Call (c_info /*Reason*/); virtual void fInd_Hold_Notify (void) {} virtual void fInd_Retrieve_Notify (void) {} virtual void fInd_Suspend_Notify (void) {} virtual void fInd_Resume_Notify (void) {} virtual void fInd_CallIsDiverting_Notify (void) {} virtual void fInd_DiversionActive_Notify (void) {} //virtual void fInd_DiversionInformation_Notify //virtual void fInd_CT_Alerted_Notify //virtual void fInd_CT_Active_Notify virtual void fInd_ConferenceEstablished (void) {} virtual void fInd_ConferenceDisconnected (void) {} //virtual void fInd_CCBS_EraseCallLinkageID (???); //virtual void fInd_CCBS_Status (???); //virtual void fInd_CCBS_RemoteUserFree (???); //virtual void fInd_CCBS_BFree (???); //virtual void fInd_CCBS_Erase (???); //virtual void fInd_CCBS_StopAlerting (???); //virtual void fInd_CCBS_InfoRetain (???); /*-----------------------------------------------------------------------*\ Supplementary Services - RESPONSES \*-----------------------------------------------------------------------*/ private: /*-----------------------------------------------------------------------*\ internal functions for Supplementary Services \*-----------------------------------------------------------------------*/ void CallSupplServFacilityReq (c_dword Address, c_supplserv Function, CCStruct *pSupplService); tBool HandleSupplServicesInd (c_dword Address, c_supplserv Function, CCStruct *pParams); #endif // #ifdef USE_SUPPLEMENTARY_SERVICES private: /*-----------------------------------------------------------------------*\ virtual functions from CCAPI20_ChannelForManager \*-----------------------------------------------------------------------*/ void FACILITY_CONF (c_word Messagenumber, c_dword Address, cm_facilityconf *Params); tBool FACILITY_IND (c_word Messagenumber, c_dword Address, cm_facilityind *Params); }; /*===========================================================================*\ CCAPI20_Facility - inline functions \*===========================================================================*/ #ifdef USE_SUPPLEMENTARY_SERVICES inline void CCAPI20_Facility::CallSupplServFacilityReq (c_dword Address, c_supplserv Function, CCStruct *pSupplService) { cp_facility_supplserv supplserv (Function, pSupplService); cm_facilityreq cpfac (facilselect_SupplServices, &supplserv); FACILITY_REQ (GetNextMsgNr(), Address, &cpfac); } #endif /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/capi/CapiChan.h0000644000175000017500000002344410470310075017135 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _CAPICHAN_H_ #define _CAPICHAN_H_ #include "CapiLay.h" #include "SecTimer.h" #include "ProtClas.h" /*===========================================================================*\ \*===========================================================================*/ class CCAPI20_Channel : protected CCAPI20_Layer { public: CCAPI20_Channel (void); virtual ~CCAPI20_Channel (void); void SetRingingTimeout (tUInt secs); // secs == 0 no timeout, wait-time after ConnectConf tCapiState GetState (void); c_dword GetController (void); c_dword GetPLCI (void); c_dword GetNCCI (void); void SetNCPI (CCStruct *pNCPI); tBool AcceptIncomingCall (void); // AcceptIncommingCall have to be called before AlertReq and ConnectResp // return: vTrue - allow to accept incoming call // vFalse - don't accept incoming call /*-----------------------------------------------------------------------*\ Anmeldung \*-----------------------------------------------------------------------*/ void Register (tUInt MaxDataSize = CAPI_MAX_DATA_SIZE, tUInt MaxInFrames = CAPI_MAX_OUTSTANDING_FRAMES); void Release (void); virtual void Register_Complete (c_info ErrorCode) = 0; virtual void Release_Complete (void) = 0; /*-----------------------------------------------------------------------*\ CAPI - Requests \*-----------------------------------------------------------------------*/ void AlertReq (CCStruct *pAdditionalInfo); tBool ConnectReq (c_dword Controller, cm_connectreq *Params); void DataB3Req (cm_datab3 *Params); void DisconnectReq (tBool FastDisconnect = vFalse); // Fast == Disconnect directly the D-Channel void ListenReq (c_dword Controller, cm_listenreq *Params); void ManufacturerReq (c_dword Controller, cm_manufacturer *Params); void SelectBProtocolReq (cp_bprotocol *Params); /*-----------------------------------------------------------------------*\ virtual CAPI - Confirmations \*-----------------------------------------------------------------------*/ virtual void ConnectConf (void) {} virtual void DataB3Conf (cm_datab3conf * /*Params*/) {} virtual void ListenConf (c_dword /*Controller*/, c_info /*Info*/) {} virtual void ManufacturerConf (c_dword /*Controller*/, cm_manufacturer * /*Params*/) {} virtual void SelectBProtocolConf (c_info /*Info*/) {} /*-----------------------------------------------------------------------*\ virtual CAPI - Indications \*-----------------------------------------------------------------------*/ virtual void ConnectInd (c_dword /*Controller*/, cm_connectind * /*Params*/) {} virtual void ConnectActiveInd (CCStruct * /*pConnectedNumber*/) {} virtual void ConnectB3ActiveInd (CCStruct * /*pNCPI*/) {} virtual void DataB3Ind (cm_datab3 * /*Params*/) {} virtual void DisconnectB3Ind (cm_disconnectb3ind * /*Params*/) {} virtual void DisconnectInd (c_info /*Reason*/) {} virtual void InfoInd (cm_infoind * /*Params*/) {} virtual void ManufacturerInd (c_dword /*Controller*/, cm_manufacturer * /*Params*/) {} /*-----------------------------------------------------------------------*\ CAPI - Responses \*-----------------------------------------------------------------------*/ void ConnectResp (cm_connectresp *Params); void DataB3Resp (c_word DataHandle); void DisconnectB3Resp (void); protected: void ConnectB3Req (void); tBool SetState (tCapiState newState, tCapiState oldState); void SetController (c_dword cntrl); void SetPLCI (c_dword PLCI); void SetNCCI (c_dword NCCI); void SetInitiator (tBool activate); tBool GetInitiator (void); CProtectClass *GetProtectClass (void); private: /*-----------------------------------------------------------------------*\ virtuelle Funktionen der CCAPI20_ChannelForManager \*-----------------------------------------------------------------------*/ void REGISTER_COMPLETE (c_info ErrorCode); void RELEASE_COMPLETE (void); void CONNECT_CONF (c_word Messagenumber, c_dword PLCI, c_info Info); void CONNECT_B3_CONF (c_word Messagenumber, c_dword NCCI, c_info Info); void DATA_B3_CONF (c_word Messagenumber, c_dword NCCI, cm_datab3conf *Params); void DISCONNECT_B3_CONF (c_word Messagenumber, c_dword NCCI, c_info Info); void DISCONNECT_CONF (c_word Messagenumber, c_dword PLCI, c_info Info); void LISTEN_CONF (c_word Messagenumber, c_dword Controller, c_info Info); void MANUFACTURER_CONF (c_word Messagenumber, c_dword Controller, cm_manufacturer *Params); void SELECT_B_PROTOCOL_CONF (c_word Messagenumber, c_dword PLCI, c_info Info); tBool CONNECT_IND (c_word Messagenumber, c_dword PLCI, cm_connectind *Params); tBool CONNECT_ACTIVE_IND (c_word Messagenumber, c_dword PLCI, cm_connectactiveind *Params); tBool CONNECT_B3_IND (c_word Messagenumber, c_dword NCCI, CCStruct *pNCPI); tBool CONNECT_B3_ACTIVE_IND (c_word Messagenumber, c_dword NCCI, CCStruct *pNCPI); tBool DATA_B3_IND (c_word Messagenumber, c_dword NCCI, cm_datab3 *Params); tBool DISCONNECT_B3_IND (c_word Messagenumber, c_dword NCCI, cm_disconnectb3ind *Params); tBool DISCONNECT_IND (c_word Messagenumber, c_dword PLCI, c_info Reason); tBool INFO_IND (c_word Messagenumber, c_dword Address, cm_infoind *Params); tBool MANUFACTURER_IND (c_word Messagenumber, c_dword Controller, cm_manufacturer *Params); /*-----------------------------------------------------------------------*\ interne Funktionen & Variablen \*-----------------------------------------------------------------------*/ void ResetValues (void); CProtectClass m_Protect; thSecTimer hStateChangeTimer; tCapiState curState; c_dword controller; c_dword plci; c_dword ncci; CCStructStore m_NCPIout; tUInt RingingTimeout; tBool Initiator; }; /*===========================================================================*\ inline Funktionen \*===========================================================================*/ inline void CCAPI20_Channel::SetRingingTimeout (tUInt secs) { RingingTimeout = secs; } inline tCapiState CCAPI20_Channel::GetState (void) { return curState; } inline c_dword CCAPI20_Channel::GetController (void) { return controller; } inline c_dword CCAPI20_Channel::GetPLCI (void) { return plci; } inline c_dword CCAPI20_Channel::GetNCCI (void) { return ncci; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline void CCAPI20_Channel::AlertReq (CCStruct *pAdditionalInfo) { if (GetState() == cs_D_ConnectIndication) { // assert (plci != IllegalPLCI); ALERT_REQ (GetNextMsgNr(), GetPLCI(), pAdditionalInfo); } } inline void CCAPI20_Channel::ListenReq (c_dword Controller, cm_listenreq *Params) { LISTEN_REQ (GetNextMsgNr(), Controller, Params); } inline void CCAPI20_Channel::ManufacturerReq (c_dword Controller, cm_manufacturer *Params) { MANUFACTURER_REQ (GetNextMsgNr(), Controller, Params); } inline void CCAPI20_Channel::SelectBProtocolReq (cp_bprotocol *Params) { // assert (plci != IllegalPLCI); // assert (GetState() == cs_D_Connected); if (SetState (cs_ProtocolPending, cs_D_Connected) == vTrue) { SELECT_B_PROTOCOL_REQ (GetNextMsgNr(), GetPLCI(), Params); } else { SelectBProtocolConf (ci_Int_IllegalState); } } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline void CCAPI20_Channel::ConnectB3Req (void) { CONNECT_B3_REQ (GetNextMsgNr(), GetPLCI(), &m_NCPIout); } //inline void CCAPI20_Channel::DisconnectB3Req (void) { // DISCONNECT_B3_REQ (GetNextMsgNr(), GetNCCI(), &m_NCPIout); //} /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tBool CCAPI20_Channel::SetState (tCapiState newState, tCapiState oldState) { return m_Protect.TestAndSet (&curState, oldState, newState); } inline void CCAPI20_Channel::SetController (c_dword cntrl) { controller = cntrl; } inline void CCAPI20_Channel::SetPLCI (c_dword PLCI) { plci = PLCI; } inline void CCAPI20_Channel::SetNCCI (c_dword NCCI) { ncci = NCCI; } inline void CCAPI20_Channel::SetInitiator (tBool activate) { Initiator = activate; } inline tBool CCAPI20_Channel::GetInitiator (void) { return Initiator; } inline CProtectClass *CCAPI20_Channel::GetProtectClass (void) { return &m_Protect; } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/capi/Channel.h0000644000175000017500000003714510470310075017042 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _CHANNEL_H_ #define _CHANNEL_H_ #include "Facility.h" #include "DataHand.h" #include "MSNList.h" #include "aFlags.h" /*===========================================================================*\ \*===========================================================================*/ class CTransferChannel : private CCAPI20_Facility { public: enum tDisconnectKind { DisconnectKind_Hard = 1, // Makes Release DisconnectKind_Fast, // Makes DisconnectReq (FastDisconnect = vTrue) DisconnectKind_Normal, // Makes DisconnectReq DisconnectKind_WaitNoPut, // Wait for all Outstanding DATA_B3_CONF's (without new PutData's) DisconnectKind_WaitWithPut // Wait for all Outstanding DATA_B3_CONF's (with new PutData's) }; CTransferChannel (void); virtual ~CTransferChannel (void); tCapiState CurState (void); tUShort CountPutQueueItems (void); tBool IsPutQueueEmpty (void); tBool IsPutQueueFull (void); void SetMaxDataSize (tUInt MaxDataSize); // MaxDataSize == 0 => CAPI_MAX_DATA_SIZE void SetRingingTimeout (tUInt secs); void SetOutController (tUInt Controller); // OutController is used by MakeCall and UnparkCall tUInt GetOutController (void); // ActiveController is the Controller who is currently in use tUInt GetActiveController (void); // both can differ if listen is active for another Controller void SetOwnNumber (CConstString *pMyNumber, tUByte Indicator = CALLNUM_INDICATOR_DEFAULT); CConstString *GetOwnNumber (void); void SetB1Parameters (c_b1prot B1Protocol, cp_b1configuration *pB1Config = 0); void SetB2Parameters (c_b2prot B2Protocol); void SetB3Parameters (c_b3prot B3Protocol, cp_b3configuration *pB3Config = 0); void SetAdditionalInfo (tUInt setflags, CCStruct *pBChannelInfo, CCStruct *pKeypadFacility = 0, CCStruct *pUserUserData = 0, CCStruct *pFacilityDataArray = 0, CCStruct *pSendingComplete = 0); void SetNCPI (cp_ncpi *pNCPI); tBool SetMSNList (CCntrlMSNList *pCntrlMSNList); CCntrlMSNList *GetMSNList (void); void CheckListen (void); virtual void ListenError (tUInt /*Controller*/, c_info /*Info*/) {} // Controller == 0 => For all Controller tBool MakeCall (CConstString *pTelNumber, c_cipvalue CIPValue); // vFalse => Illegal state void AlertCall (void); void AnswerCall (c_reject Reject = creject_Accept); tBool PutData (tUByte *Data, tUShort DataLength, void *hDataID); // vFalse => QueueFull or Disconnect void GetDataComplete (tUShort DataHandle); void Disconnect (tDisconnectKind kind = DisconnectKind_Normal); void DisconnectConfirm (void); // async answer for DisconnectInquiry void ResetChannel (void); // Call ResetChannel always before deleting this class !!! void UpdateBParameters (void); virtual void IncomingCall (c_cipvalue CIPValue, CConstString *pOppositeNumber, CConstString *pMyCalledNumber) = 0; virtual void DialingBegin (void) {} // (ConnectReq) virtual void DialingEnd (void) {} // (ConnectConf) virtual void ConnectProceeding (CConstString * /*ConnectedNumber */) {} // (ConnectActiveInd) virtual void IsConnected (cp_ncpi_all *pNCPI) = 0; virtual void PutDataComplete (void *hDataID, c_info Info) = 0; virtual void GetData (tUByte *Data, tUShort DataLength, tUShort DataHandle) = 0; virtual void DisconnectInquiry (c_info /*ReasonB3*/, cp_ncpi_all * /*pNCPI*/); // needs DisconnectConfirm answer virtual void IsDisconnected (c_info Reason) = 0; virtual void IsReseted (void) = 0; virtual void UpdateBParametersComplete (c_info /*Info*/) {} #ifdef USE_SUPPLEMENTARY_SERVICES void HoldCall (void); void UnholdCall (void); void ParkCall (CConstString *pIDStr); void UnparkCall (CConstString *pIDStr); void RedirectCall (CDynamicString *pTelNumber); void TransferCall (CTransferChannel *pChannel); // this is in hold, pChannel is active void Conference (CTransferChannel *pChannel, tBool doBegin); // this is in hold, pChannel is active void DTMFListen (tBool activate); void DTMFSend (CConstString *pDTMFDigits, tUShort ToneDuration = 0, tUShort GapDuration = 0); virtual void CallHolded (c_info /*Info*/) {} virtual void CallUnholded (c_info /*Info*/) {} virtual void CallParked (c_info /*Info*/) {} virtual void CallUnparked (c_info /*Info*/) {} virtual void CallRedirected (c_info /*Info*/) {} virtual void CallTransfered (c_info /*Info*/) {} virtual void ConferenceComplete (tBool /*Begin*/, c_info /*Info*/) {} virtual void DTMFReceived (tUInt /*count*/, tUChar * /*pDTMFChars*/) {} virtual void DTMFSendComplete (c_info /*Info*/) {} virtual void DTMFListenError (c_info /*Info*/) {} private: /*-----------------------------------------------------------------------*\ virtual functions from CCAPI20_Facility \*-----------------------------------------------------------------------*/ void fConf_DTMF (c_info Info); void fInd_DTMF (CCStruct *pDTMFdigits); void fInd_Hold (c_info Reason); void fInd_Retrieve (c_info Reason); void fInd_Suspend (c_info Reason); void fInd_Resume (c_info Reason); void fInd_CD (c_info Reason); void fInd_ECT (c_info Reason); void fInd_3PTY_Begin (c_info Reason); void fInd_3PTY_End (c_info Reason); #endif protected: // enhanced functionality, only needed in very special cases void CapiStart (void); void CapiStop (void); void GetProfile (tUInt Controller = 0); void ManufacturerCall (c_dword Function, CCStruct *pData); virtual void CapiStarted (c_info /*ErrorCode*/) {} virtual void GetProfileComplete (tUInt/* Controller*/, cm_getprofile * /*pProfile*/, c_info /*ErrorCode*/) {} virtual void ManufacturerCallComplete (c_dword /*Error*/, c_dword /*Function*/, CCStruct * /*pData*/) {} virtual void ManufacturerNotify (c_dword /*Function*/, CCStruct * /*pData*/) {} private: /*-----------------------------------------------------------------------*\ virtual functions from CCAPI20_Channel \*-----------------------------------------------------------------------*/ void Register_Complete (c_info ErrorCode); void Release_Complete (void); void ConnectConf (void); void DataB3Conf (cm_datab3conf *Params); void ListenConf (c_dword Controller, c_info Info); void ManufacturerConf (c_dword Controller, cm_manufacturer *Params); void SelectBProtocolConf (c_info Info); void ConnectInd (c_dword Controller, cm_connectind *Params); void ConnectActiveInd (CCStruct *pConnectedNumber); void ConnectB3ActiveInd (CCStruct *pNCPI); void DataB3Ind (cm_datab3 *Params); void DisconnectB3Ind (cm_disconnectb3ind *Params); void DisconnectInd (c_info Reason); void InfoInd (cm_infoind *Params); void ManufacturerInd (c_dword Controller, cm_manufacturer *Params); void fConf_PMWakeup (c_dword Controller, c_info Info, c_word NumberAccepted); void GET_PROFILE_COMPLETE (tUInt Controller, cm_getprofile *pProfile, c_info ErrorCode); /*-----------------------------------------------------------------------*\ Interne Funktionen \*-----------------------------------------------------------------------*/ void ResetSendBlock (void); tUInt CheckFinishReset (tUInt NewResetState); // 0 state set, 1 reset wait, 2 reset done /*-----------------------------------------------------------------------*\ Interne Variablen \*-----------------------------------------------------------------------*/ CDataHandleAdmin m_SendBlock; CCntrlMSNList *m_pMSNList; tBool m_deleteMSNList; tBool m_WaitForDDINumbers; c_dword m_OutController; c_dword m_ActiveController; c_cipvalue m_CIPValue; cp_bprotocol_store m_BProtocol; cp_addinfo_store m_AdditionalInfo; cp_callingnumber m_sMSN; CDynamicString m_CalledPartyNum; CDynamicString m_CallingNumber; CDynamicString m_ParkIdentity; CDynamicString m_DTMFDigits; tUInt m_MaxDataSize; tUInt m_DDIPrefixLen; tUInt m_SupplServType; tUInt m_DTMFState; tUShort m_DTMFToneDuration; tUShort m_DTMFGapDuration; tBool m_DTMFListen; tBool m_ManualRegister; tUInt m_Reseting; tUInt m_CheckListenInUse; }; /*===========================================================================*\ Inline Funktionen \*===========================================================================*/ inline tCapiState CTransferChannel::CurState (void) { return GetState(); } inline tUShort CTransferChannel::CountPutQueueItems (void) { return m_SendBlock.CurCount(); } inline tBool CTransferChannel::IsPutQueueEmpty (void) { return m_SendBlock.IsEmpty(); } inline tBool CTransferChannel::IsPutQueueFull (void) { return m_SendBlock.IsFull(); } inline void CTransferChannel::SetMaxDataSize (tUInt MaxDataSize) { if (!MaxDataSize || (MaxDataSize > CAPI_MAX_DATA_SIZE)) { MaxDataSize = CAPI_MAX_DATA_SIZE; } m_MaxDataSize = MaxDataSize; } inline void CTransferChannel::SetRingingTimeout (tUInt secs) { CCAPI20_Channel::SetRingingTimeout (secs); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline void CTransferChannel::SetOutController (tUInt Controller) { // dassert (Controller != IllegalController); m_OutController = Controller; } inline tUInt CTransferChannel::GetOutController (void) { return m_OutController; } inline tUInt CTransferChannel::GetActiveController (void) { return m_ActiveController; } inline void CTransferChannel::SetOwnNumber (CConstString *pMyNumber, tUByte Indicator) { // dassert (pMyNumber != 0); if (m_sMSN.pNumber->Set (pMyNumber) == vTrue) { m_sMSN.Indicator = Indicator; } } inline CConstString *CTransferChannel::GetOwnNumber (void) { return m_sMSN.pNumber; } inline void CTransferChannel::SetB1Parameters (c_b1prot B1Protocol, cp_b1configuration *pB1Config) { if (infoSuccess (m_BProtocol.pB1Configuration->ParseStruct (pB1Config))) { m_BProtocol.B1Protocol = B1Protocol; } } inline void CTransferChannel::SetB2Parameters (c_b2prot B2Protocol) { m_BProtocol.B2Protocol = B2Protocol; } inline void CTransferChannel::SetB3Parameters (c_b3prot B3Protocol, cp_b3configuration *pB3Config) { if (infoSuccess (m_BProtocol.pB3Configuration->ParseStruct (pB3Config))) { m_BProtocol.B3Protocol = B3Protocol; } } inline void CTransferChannel::SetAdditionalInfo (tUInt setflags, CCStruct *pBChannelInfo, CCStruct *pKeypadFacility, CCStruct *pUserUserData, CCStruct *pFacilityDataArray, CCStruct *pSendingComplete) { if (CheckOneFlag (setflags, 0)) { m_AdditionalInfo.pBChannelInformation->ParseStruct (pBChannelInfo); } if (CheckOneFlag (setflags, 1)) { m_AdditionalInfo.pKeypadFacility->ParseStruct (pKeypadFacility); } if (CheckOneFlag (setflags, 2)) { m_AdditionalInfo.pUserUserData->ParseStruct (pUserUserData); } if (CheckOneFlag (setflags, 3)) { m_AdditionalInfo.pFacilityDataArray->ParseStruct (pFacilityDataArray); } if (CheckOneFlag (setflags, 4)) { m_AdditionalInfo.pSendingComplete->ParseStruct (pSendingComplete); } } inline void CTransferChannel::SetNCPI (cp_ncpi *pNCPI) { CCAPI20_Channel::SetNCPI (pNCPI); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline tBool CTransferChannel::SetMSNList (CCntrlMSNList *pCntrlMSNList) { if (m_deleteMSNList == vTrue) { delete m_pMSNList; } m_pMSNList = pCntrlMSNList; m_deleteMSNList = vFalse; CheckListen(); return vTrue; } inline CCntrlMSNList *CTransferChannel::GetMSNList (void) { if (!m_pMSNList) { m_pMSNList = new CCntrlMSNList; m_deleteMSNList = vTrue; } return m_pMSNList; } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ inline void CTransferChannel::AlertCall (void) { if (GetState() == cs_D_ConnectIndication) { AlertReq (0); } } inline void CTransferChannel::GetDataComplete (tUShort DataHandle) { DataB3Resp (DataHandle); } inline void CTransferChannel::DisconnectConfirm (void) { switch (CurState()) { case cs_B_DisconnectRespPending: case cs_D_DisconnectRespPending: DisconnectB3Resp(); break; default: break; } } inline void CTransferChannel::ConnectConf (void) { DialingEnd(); } inline void CTransferChannel::DisconnectInquiry (c_info /*ReasonB3*/, cp_ncpi_all * /*pNCPI*/) { DisconnectConfirm(); } inline void CTransferChannel::GET_PROFILE_COMPLETE (tUInt Controller, cm_getprofile *pProfile, c_info ErrorCode) { GetProfileComplete (Controller, pProfile, ErrorCode); } /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #ifdef USE_SUPPLEMENTARY_SERVICES inline void CTransferChannel::fInd_DTMF (CCStruct *pDTMFdigits) { // dassert (pDTMFdigits == 0); // dwarning (m_DTMFListen == vTrue); if ((m_DTMFListen == vTrue) && (pDTMFdigits->GetLen())) { DTMFReceived (pDTMFdigits->GetLen(), pDTMFdigits->GetData()); } } inline void CTransferChannel::fInd_Hold (c_info Reason) { CallHolded (Reason); } inline void CTransferChannel::fInd_Retrieve (c_info Reason) { CallUnholded (Reason); } inline void CTransferChannel::fInd_Suspend (c_info Reason) { CallParked (Reason); } inline void CTransferChannel::fInd_Resume (c_info Reason) { if (CapiInfoIsSuccess (Reason)) { SelectBProtocolReq (&m_BProtocol); } CallUnparked (Reason); } inline void CTransferChannel::fInd_CD (c_info Reason) { CallRedirected (Reason); } inline void CTransferChannel::fInd_ECT (c_info Reason) { CallTransfered (Reason); } inline void CTransferChannel::fInd_3PTY_Begin (c_info Reason) { ConferenceComplete (vTrue, Reason); } inline void CTransferChannel::fInd_3PTY_End (c_info Reason) { ConferenceComplete (vFalse, Reason); } #endif // USE_SUPPLEMENTARY_SERVICES /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/capi/DCMTrace.cpp0000644000175000017500000002626010470310075017403 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "DCMTrace.h" #include "c2msgdef.h" #include "dbgCAPI.h" #ifndef NDEBUG /*===========================================================================*\ \*===========================================================================*/ static tUChar *DbgStrCapiCommand (c_byte Command, c_byte SubCommand) { char *fret; switch (SubCommand) { case CAPI_REQ: switch (Command) { case CAPI_ALERT: fret = "ALERT_REQ"; break; case CAPI_CONNECT: fret = "CONNECT_REQ"; break; case CAPI_CONNECT_ACTIVE: fret = "CONNECT_ACTIVE_REQ"; break; case CAPI_CONNECT_B3_ACTIVE: fret = "CONNECT_B3_ACTIVE_REQ"; break; case CAPI_CONNECT_B3: fret = "CONNECT_B3_REQ"; break; case CAPI_CONNECT_B3_T90_ACTIVE: fret = "CONNECT_B3_T90_ACTIVE_REQ"; break; case CAPI_DATA_B3: fret = "DATA_B3_REQ"; break; case CAPI_DISCONNECT_B3: fret = "DISCONNECT_B3_REQ"; break; case CAPI_DISCONNECT: fret = "DISCONNECT_REQ"; break; case CAPI_FACILITY: fret = "FACILITY_REQ"; break; case CAPI_INFO: fret = "INFO_REQ"; break; case CAPI_LISTEN: fret = "LISTEN_REQ"; break; case CAPI_MANUFACTURER: fret = "MANUFACTURER_REQ"; break; case CAPI_RESET_B3: fret = "RESET_B3_REQ"; break; case CAPI_SELECT_B_PROTOCOL: fret = "SELECT_B_PROTOCOL_REQ"; break; default: fret = "Wrong REQ-Command!"; break; } break; case CAPI_CONF: switch (Command) { case CAPI_ALERT: fret = "ALERT_CONF"; break; case CAPI_CONNECT: fret = "CONNECT_CONF"; break; case CAPI_CONNECT_ACTIVE: fret = "CONNECT_ACTIVE_CONF"; break; case CAPI_CONNECT_B3_ACTIVE: fret = "CONNECT_B3_ACTIVE_CONF"; break; case CAPI_CONNECT_B3: fret = "CONNECT_B3_CONF"; break; case CAPI_CONNECT_B3_T90_ACTIVE: fret = "CONNECT_B3_T90_ACTIVE_CONF"; break; case CAPI_DATA_B3: fret = "DATA_B3_CONF"; break; case CAPI_DISCONNECT_B3: fret = "DISCONNECT_B3_CONF"; break; case CAPI_DISCONNECT: fret = "DISCONNECT_CONF"; break; case CAPI_FACILITY: fret = "FACILITY_CONF"; break; case CAPI_INFO: fret = "INFO_CONF"; break; case CAPI_LISTEN: fret = "LISTEN_CONF"; break; case CAPI_MANUFACTURER: fret = "MANUFACTURER_CONF"; break; case CAPI_RESET_B3: fret = "RESET_B3_CONF"; break; case CAPI_SELECT_B_PROTOCOL: fret = "SELECT_B_PROTOCOL_CONF"; break; default: fret = "Wrong CONF-Command!"; break; } break; case CAPI_IND: switch (Command) { case CAPI_ALERT: fret = "ALERT_IND"; break; case CAPI_CONNECT: fret = "CONNECT_IND"; break; case CAPI_CONNECT_ACTIVE: fret = "CONNECT_ACTIVE_IND"; break; case CAPI_CONNECT_B3_ACTIVE: fret = "CONNECT_B3_ACTIVE_IND"; break; case CAPI_CONNECT_B3: fret = "CONNECT_B3_IND"; break; case CAPI_CONNECT_B3_T90_ACTIVE: fret = "CONNECT_B3_T90_ACTIVE_IND"; break; case CAPI_DATA_B3: fret = "DATA_B3_IND"; break; case CAPI_DISCONNECT_B3: fret = "DISCONNECT_B3_IND"; break; case CAPI_DISCONNECT: fret = "DISCONNECT_IND"; break; case CAPI_FACILITY: fret = "FACILITY_IND"; break; case CAPI_INFO: fret = "INFO_IND"; break; case CAPI_LISTEN: fret = "LISTEN_IND"; break; case CAPI_MANUFACTURER: fret = "MANUFACTURER_IND"; break; case CAPI_RESET_B3: fret = "RESET_B3_IND"; break; case CAPI_SELECT_B_PROTOCOL: fret = "SELECT_B_PROTOCOL_IND"; break; default: fret = "Wrong IND-Command!"; break; } break; case CAPI_RESP: switch (Command) { case CAPI_ALERT: fret = "ALERT_RESP"; break; case CAPI_CONNECT: fret = "CONNECT_RESP"; break; case CAPI_CONNECT_ACTIVE: fret = "CONNECT_ACTIVE_RESP"; break; case CAPI_CONNECT_B3_ACTIVE: fret = "CONNECT_B3_ACTIVE_RESP"; break; case CAPI_CONNECT_B3: fret = "CONNECT_B3_RESP"; break; case CAPI_CONNECT_B3_T90_ACTIVE: fret = "CONNECT_B3_T90_ACTIVE_RESP"; break; case CAPI_DATA_B3: fret = "DATA_B3_RESP"; break; case CAPI_DISCONNECT_B3: fret = "DISCONNECT_B3_RESP"; break; case CAPI_DISCONNECT: fret = "DISCONNECT_RESP"; break; case CAPI_FACILITY: fret = "FACILITY_RESP"; break; case CAPI_INFO: fret = "INFO_RESP"; break; case CAPI_LISTEN: fret = "LISTEN_RESP"; break; case CAPI_MANUFACTURER: fret = "MANUFACTURER_RESP"; break; case CAPI_RESET_B3: fret = "RESET_B3_RESP"; break; case CAPI_SELECT_B_PROTOCOL: fret = "SELECT_B_PROTOCOL_RESP"; break; default: fret = "Wrong RESP-Command!"; break; } break; default: fret = "Wrong SubCommand!"; break; } return (tUChar *)fret; } /*===========================================================================*\ \*===========================================================================*/ void DbgCapiMsgTrace (c_message theMsg, c_info error, unsigned kind) { if (DCON_CAPITrace > Dbg_Level_Nothing) { if (error) { // Ein Fehler ist passiert switch (kind) { case CMTRACE_Register: dwriteErr (DCON_CAPITrace, "CapiTrace: CAPI_REGISTER Error=%x!\n", error); break; case CMTRACE_Release: dwriteErr (DCON_CAPITrace, "CapiTrace: CAPI_RELEASE Error=%x!\n", error); break; case CMTRACE_GetProfile: dwriteErr (DCON_CAPITrace, "CapiTrace: CAPI_GET_PROFILE Error=%x!\n", error); break; case CMTRACE_PutMessage: dwriteErr (DCON_CAPITrace, "CapiTrace: CAPI_PUT_MESSAGE Error=%x!\n", error); break; case CMTRACE_GetMessage: dwriteErr (DCON_CAPITrace, "CapiTrace: CAPI_GET_MESSAGE Error=%x!\n", error); break; default: // TODO: theMSG auswerten dwriteErr (DCON_CAPITrace, "CapiTrace: CAPI_???_MESSAGE Error=%x!\n", error); break; } } else { switch (kind) { case CMTRACE_Register: dwriteLog (DCON_CAPITrace, "CapiTrace: CAPI_REGISTER Success\n"); break; case CMTRACE_Release: dwriteLog (DCON_CAPITrace, "CapiTrace: CAPI_RELEASE Success\n"); break; case CMTRACE_GetProfile: dwriteLog (DCON_CAPITrace, "CapiTrace: CAPI_GET_PROFILE Success!\n"); break; default: if (theMsg) { if (CapiMsg_GetCmd (theMsg) == CAPI_DATA_B3) { dwriteE (DCON_CAPITrace, "CapiTrace: %s(%x) ", DbgStrCapiCommand (CapiMsg_GetCmd (theMsg), CapiMsg_GetSubCmd (theMsg)), CapiMsg_GetAddr (theMsg)); switch (CapiMsg_GetSubCmd (theMsg)) { case CAPI_REQ: case CAPI_IND: dwriteE (DCON_CAPITrace, "-Length=%x -Handle=%x ", CapiMsg_GetWord (theMsg, sizeof (c_dword)), CapiMsg_GetWord (theMsg, sizeof (c_dword) + sizeof (c_word))); break; case CAPI_CONF: case CAPI_RESP: dwriteE (DCON_CAPITrace, "-Handle=%x ", CapiMsg_GetWord (theMsg, 0)); break; } if (DCON_CAPITrace > Dbg_Level_Entry) { dhead ("DbgCapiMsgTrace", DCON_CAPITrace); dprintBuf (theMsg, CapiMsg_GetMsgLen (theMsg)); } } else { dwriteLog (DCON_CAPITrace, "CapiTrace: %s(%x) ", DbgStrCapiCommand (CapiMsg_GetCmd (theMsg), CapiMsg_GetSubCmd (theMsg)), CapiMsg_GetAddr (theMsg)); switch (CapiMsg_GetFullCmd (theMsg)) { case CAPI_DISCONNECT_B3_IND: case CAPI_DISCONNECT_IND: dwriteLog (DCON_CAPITrace, "-Reason=%x ", CapiMsg_GetWord (theMsg, 0)); break; case CAPI_CONNECT_RESP: dwriteLog (DCON_CAPITrace, "-Reject=%x ", CapiMsg_GetWord (theMsg, 0)); break; } if (DCON_CAPITrace > Dbg_Level_Entry) { dhead ("DbgCapiMsgTrace", DCON_CAPITrace); dprintBuf (theMsg, CapiMsg_GetMsgLen (theMsg)); } } } } } } } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/capi/CapiLay.cpp0000644000175000017500000000235210470310075017337 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "CapiLay.h" #include "dbgCAPI.h" /*===========================================================================*\ \*===========================================================================*/ tUInt CCAPI20_Layer::CountLayers = 0; /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/capi/PLCIList.cpp0000644000175000017500000001303210470310075017375 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "PLCIList.h" #include "SortList.h" #include "Protect.h" #include "dbgCAPI.h" #include /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class CPLCIListerElement : public CSortPListElement { public: tUInt Counter; tUByte Controller; tUByte PLCIField[32]; CPLCIListerElement (void) { Counter = 0; Controller = 0; memset (PLCIField, '\0', 32 * sizeof (tUByte)); } tCompare Compare (void *RefCompData) { if (((tUByte)(tULong)RefCompData) < Controller) { return vLower; } else if (((tUByte)(tULong)RefCompData) == Controller) { return vEqual; } return vHigher; } void *GetRefCompData (void) { return (void *)(tULong)Controller; } }; /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ Protect_DefineInit (static hProtect); static CSortPointerList *pPLCIList = 0; /*===========================================================================*\ \*===========================================================================*/ tBool InitPLCIList (void) { dhead ("InitPLCIList", DCON_PLCIList); dassert (pPLCIList == vIllegalHandle); if ( (Protect_IsCreated (hProtect) == vFalse) && (Protect_Create (&hProtect) == vFalse)) { RETURN ('x', vFalse); } pPLCIList = new CSortPointerList; if (pPLCIList) { RETURN ('x', vTrue); } pPLCIList = 0; Protect_Destroy (&hProtect); RETURN ('x', vFalse); } /*===========================================================================*\ \*===========================================================================*/ void DeinitPLCIList (void) { dhead ("DeinitPLCIList", DCON_PLCIList); dassert (pPLCIList != 0); dassert (pPLCIList->IsEmpty() == vTrue); delete pPLCIList; pPLCIList = 0; Protect_Destroy (&hProtect); } /*===========================================================================*\ \*===========================================================================*/ tBool TestAndSetPLCIEntry (tUInt PLCI) { dhead ("TestAndSetPLCI", DCON_PLCIList); dparams ("%x", PLCI); dassert (PLCI > 0); dassert (PLCI <= 0xFFFF); dwarning (pPLCIList != 0); tBool fret = vFalse; if (pPLCIList != 0) { tUByte cntrl = (tUByte)(PLCI & 0x7F); tUByte fieldPos = (tUByte)((PLCI >> 11) & 0x1F); tUByte fieldBit = (tUByte)(1 << ((PLCI >> 8) & 0x7)); dassert (cntrl != 0); dassert (fieldBit != 0); Protect_BeginWrite (hProtect); CPLCIListerElement *pElement = (CPLCIListerElement *)pPLCIList->FindHigher ((void *)(tULong)cntrl); if (pElement == 0) { pElement = new CPLCIListerElement; if (pElement) { pElement->Counter = 1; pElement->Controller = cntrl; pElement->PLCIField[fieldPos] = fieldBit; pPLCIList->AddFromLow (pElement); fret = vTrue; } } else { if (!(pElement->PLCIField[fieldPos] & fieldBit)) { pElement->Counter++; pElement->PLCIField[fieldPos] |= fieldBit; fret = vTrue; } } Protect_EndWrite (hProtect); } RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ void UnsetPLCIEntry (tUInt PLCI) { dhead ("UnsetPLCIEntry", DCON_PLCIList); dparams ("%x", PLCI); dassert (PLCI > 0); dassert (PLCI <= 0xFFFF); tUByte fieldPos = (tUByte)((PLCI >> 11) & 0x1F); tUByte fieldBit = (tUByte)(1 << ((PLCI >> 8) & 0x7)); dassert ((PLCI & 0x7F) != 0); dassert (fieldBit != 0); dassert (pPLCIList != 0); if (pPLCIList != 0) { Protect_BeginWrite (hProtect); CPLCIListerElement *pElement = (CPLCIListerElement *)pPLCIList->FindHigher ((void *)(tULong)(PLCI & 0x7F)); if (pElement && (pElement->PLCIField[fieldPos] & fieldBit)) { dassert (pElement->Counter > 0); pElement->Counter--; if (pElement->Counter == 0) { delete pElement; } else { pElement->PLCIField[fieldPos] &= ~fieldBit; } } Protect_EndWrite (hProtect); } } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/capi/CapiMsg.cpp0000644000175000017500000006017510470310075017347 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "CapiMsg.h" #include "c2msgdef.h" #include "DCMTrace.h" #include "osmem.h" #include "dbgCAPI.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #ifndef NDEBUG #define REGISTER_STATE_RELEASED 0 #define REGISTER_STATE_RELEASING 1 #define REGISTER_STATE_REGISTERING 2 #define REGISTER_STATE_REGISTERED 3 #endif /*===========================================================================*\ Interne Makros \*===========================================================================*/ // NOTE: 1024 could be to small in some situations //#define CapiCalcRegMsgBufSize(chans) (1024 * (1 + (chans))) #define CapiCalcRegMsgBufSize(chans) (4096 * (1 + (chans))) #define CapiMsg_SetMsgLen(name, len) \ set16 ((name), (len)) #define CapiMsg_SetApplID(name, applid) \ set16 ((name) + 2, (applid)) #define CapiMsg_SetCmd(name, capiCmd) \ (name)[4] = (capiCmd) #define CapiMsg_SetSubCmd(name, capiSubCmd) \ (name)[5] = (capiSubCmd) #define CapiMsg_SetHeader(name, cmd, subcmd, msgnr, addr) \ CapiMsg_SetCmd (name, cmd); \ CapiMsg_SetSubCmd (name, subcmd); \ set16 ((name) + 6, (msgnr)); \ set32 ((name) + 8, (addr)) #define CapiMsg_SetFullHeader(name, applid, cmd, subcmd, msgnr, addr) \ CapiMsg_SetMsgLen (name, CAPI_MSG_HEADER_ADDR_SIZE); \ CapiMsg_SetApplID (name, applid); \ CapiMsg_SetHeader (name, cmd, subcmd, msgnr, addr); /*===========================================================================*\ CCAPI20_MsgBase Konstruktor \*===========================================================================*/ CCAPI20_MsgBase::CCAPI20_MsgBase (void) : m_hCapiBase (vIllegalHandle), m_CurPutMessage (0) { dhead ("CCAPI20_MsgBase-Konstruktor", DCON_CCAPI20_MsgBase); // TODO!!!: Error handling!!!! m_Protect.Init(); PutMsgbufferQueue.Init (CAPI_MAX_MESSAGE_SIZE, CAPI_MAX_MESSAGE_COUNTER); #ifndef NDEBUG m_RegisterState = REGISTER_STATE_RELEASED; #endif } /*===========================================================================*\ CCAPI20_MsgBase Destruktor \*===========================================================================*/ CCAPI20_MsgBase::~CCAPI20_MsgBase (void) { dhead ("CCAPI20_MsgBase-Destruktor", DCON_CCAPI20_MsgBase); dassert (m_hCapiBase == vIllegalHandle); dassert (GetApplID() == IllegalApplID); //dassert (m_hCapiBase != vIllegalHandle); #ifndef NDEBUG dassert (m_RegisterState == REGISTER_STATE_RELEASED); #endif dwarning (m_CurPutMessage == 0); FreeCurPutMsg(); } /*===========================================================================*\ CCAPI20_MsgBase::REGISTER \*===========================================================================*/ void CCAPI20_MsgBase::REGISTER (tUInt MaxB3Connection, tUInt MaxB3Blks, tUInt MaxSizeB3) { dhead ("CCAPI20_MsgBase::REGISTER", DCON_CCAPI20_MsgBase); dassert (GetApplID() == IllegalApplID); dassert (m_hCapiBase == vIllegalHandle); dassert (MaxB3Blks >= CAPI_MIN_OUTSTANDING_FRAMES); // Check for to small values dassert (MaxSizeB3 >= CAPI_MIN_DATA_SIZE); dassert (MaxB3Blks <= CAPI_MAX_OUTSTANDING_FRAMES); // Check for to great values dassert (MaxSizeB3 <= CAPI_MAX_DATA_SIZE); dwarning (m_CurPutMessage == 0); dwarning (PutMsgbufferQueue.IsQueueEmpty() == vTrue); #ifndef NDEBUG dassert (m_RegisterState == REGISTER_STATE_RELEASED); m_RegisterState = REGISTER_STATE_REGISTERING; #endif // TODO: Adjust size of PutMsgbufferQueue or MaxB3Connection! PutMsgbufferQueue.FreeQueue(); FreeCurPutMsg(); CapiBase_Register (this, CapiCalcRegMsgBufSize (MaxB3Connection), MaxB3Connection, MaxB3Blks, MaxSizeB3); } /*===========================================================================*\ CCAPI20_MsgBase::RELEASE \*===========================================================================*/ void CCAPI20_MsgBase::RELEASE (void) { dhead ("CCAPI20_MsgBase::RELEASE", DCON_CCAPI20_MsgBase); #ifndef NDEBUG dwarning (m_RegisterState == REGISTER_STATE_REGISTERED); m_RegisterState = REGISTER_STATE_RELEASING; #endif dwarning (GetApplID() != IllegalApplID); dwarning (m_hCapiBase != vIllegalHandle); dwarning (PutMsgbufferQueue.IsQueueEmpty() == vTrue); PutMsgbufferQueue.FreeQueue(); // queue a illegal Message to indicate EmptyPutMsgbufferQueue that it must call Release AllocAndPutMsg (0xFF, 0xFF, 0, 0, vFalse, 0); } /*===========================================================================*\ CCAPI20_MsgBase::HandleMessageError \*===========================================================================*/ void CCAPI20_MsgBase::HandleMessageError (tUInt type, c_info ErrorCode, c_message cmsg) { dhead ("CCAPI20_MsgBase::HandleMessageError", DCON_CCAPI20_MsgBase); dparams ("%x,%x", ErrorCode); if (ErrorCode == ci_Msg_IllAppNr) { if (GetApplID() != IllegalApplID) { RELEASE(); } } else { switch (type) { case 0: // PutMessage Error if (!cmsg) { dassert (0); break; } switch (CapiMsg_GetSubCmd (cmsg)) { case CAPI_REQ: CapiMsg_SetSubCmd (cmsg, CAPI_CONF); switch (CapiMsg_GetCmd (cmsg)) { case CAPI_ALERT: case CAPI_CONNECT: case CAPI_DISCONNECT_B3: case CAPI_DISCONNECT: case CAPI_CONNECT_B3: case CAPI_INFO: case CAPI_LISTEN: case CAPI_RESET_B3: case CAPI_SELECT_B_PROTOCOL: set16 (cmsg + CAPI_MSG_HEADER_ADDR_SIZE, (tUShort)ErrorCode); CapiMsg_SetMsgLen (cmsg, CAPI_MSG_HEADER_ADDR_SIZE + sizeof (c_word)); break; case CAPI_DATA_B3: set16 (cmsg + CAPI_MSG_HEADER_ADDR_SIZE, CapiMsg_GetWord (cmsg, sizeof (c_dword) + sizeof (c_word))); set16 (cmsg + CAPI_MSG_HEADER_ADDR_SIZE + sizeof (c_word), (tUShort)ErrorCode); CapiMsg_SetMsgLen (cmsg, CAPI_MSG_HEADER_ADDR_SIZE + 2 * sizeof (c_word)); break; case CAPI_FACILITY: { for (tUInt i = CAPI_MSG_HEADER_ADDR_SIZE; i < CapiMsg_GetMsgLen (cmsg); i++) { set8 (cmsg + i + sizeof (c_word), cmsg[i]); } set16 (cmsg + CAPI_MSG_HEADER_ADDR_SIZE, (tUShort)ErrorCode); CapiMsg_SetMsgLen (cmsg, (c_word)(CapiMsg_GetMsgLen (cmsg) + sizeof (c_word))); break; } case CAPI_MANUFACTURER: set32 (cmsg + CAPI_MSG_HEADER_ADDR_SIZE + sizeof (c_dword), ErrorCode); /*----- I hope it's enough to set class to ErrorCode -----*/ dprintErr ("MANUFACTURER_REQ-Error detected!!"); break; default: dprintErr ("Illegal Command for a CAPI-Request!"); break; } HandleGetMessage (cmsg); break; case CAPI_RESP: dprintErr ("RESP-Error: MsgNr=%x, Address=%x, Command=%x, Error=%x!", CapiMsg_GetMsgNr (cmsg), CapiMsg_GetAddr (cmsg), CapiMsg_GetCmd(cmsg), ErrorCode); break; default: dprintErr ("Wrong Subcommand!"); break; } break; case 1: // GetMessage Error RELEASE(); // or make a GetMessage(); break; case 2: // GetProfile Error break; default: dwarning (0); break; } } } /*===========================================================================*\ CCAPI20_MsgBase::AllocAndPutMsg \*===========================================================================*/ void CCAPI20_MsgBase::AllocAndPutMsg (c_byte Command, c_byte SubCommand, c_word Messagenumber, c_dword Address, tBool ZeroIsEmptyStruct, CCStruct *Params) { dhead ("CCAPI20_MsgBase::AllocAndPutMsg", DCON_CCAPI20_MsgBase); dparams ("%x,%x,%x,%x", Command, SubCommand, Messagenumber, Address); dassert (Command != 0); dassert (SubCommand != 0); //dassert (Address != 0); c_message cmsg = PutMsgbufferQueue.Alloc(); dwarning (cmsg != 0); if (cmsg) { dprint ("Message(%x,%x) ", Command, SubCommand); CapiMsg_SetFullHeader (cmsg, GetApplID(), Command, SubCommand, Messagenumber, Address); tUInt slen = CAPI_MSG_HEADER_ADDR_SIZE; if (Params) { slen += Params->CalcStructSize(); dassert (slen <= CAPI_MAX_MESSAGE_SIZE); if (slen <= CAPI_MAX_MESSAGE_SIZE) { Params->FillBuffer (cmsg + CAPI_MSG_HEADER_ADDR_SIZE); } } else if (ZeroIsEmptyStruct) { cmsg[CAPI_MSG_HEADER_ADDR_SIZE] = 0; slen += 1; } CapiMsg_SetMsgLen (cmsg, (c_word)slen); //dprint ("Buffer=%x, Len=%x", cmsg, CapiMsg_GetMsgLen (cmsg)); //dprintBuf (cmsg, CapiMsg_GetMsgLen(cmsg)); PutMsgbufferQueue.InQueue (cmsg); EmptyPutMsgbufferQueue(); } else { dwarning (0); dassert (SubCommand != 0xFF); // alloc lMessage on the stack is worse so we use static, thats only a little better // because for all MsgBase-classes exit only one lMessage //static c_byte lMessage[CAPI_MAX_MESSAGE_SIZE]; HandleMessageError (0, ci_Int_MemoryFullErr, 0); } } /*===========================================================================*\ CCAPI20_MsgBase::EmptyPutMsgbufferQueue \*===========================================================================*/ void CCAPI20_MsgBase::EmptyPutMsgbufferQueue (void) { dhead ("CCAPI20_MsgBase::EmptyPutMsgbufferQueue", DCON_CCAPI20_MsgBase); m_Protect.BeginWrite(); if (m_CurPutMessage == 0) { m_CurPutMessage = PutMsgbufferQueue.OutQueue(); dassert ((m_CurPutMessage == 0) || (CapiMsg_GetMsgLen (m_CurPutMessage) >= CAPI_MSG_HEADER_ADDR_SIZE)); if (m_CurPutMessage) { m_Protect.EndWrite(); dassert (m_hCapiBase != vIllegalHandle); if (CapiMsg_GetSubCmd (m_CurPutMessage) != 0xFF) { dassert (CapiMsg_GetApplID (m_CurPutMessage) != IllegalApplID); if (GetApplID() != IllegalApplID) { CapiBase_PutMessage (m_hCapiBase, m_CurPutMessage); } else { FreeCurPutMsg(); } } else { // an RELASE was queued!! FreeCurPutMsg(); CapiBase_Release (m_hCapiBase); } return; } } m_Protect.EndWrite(); } /*===========================================================================*\ CCAPI20_MsgBase::RegisterComplete \*===========================================================================*/ void CCAPI20_MsgBase::RegisterComplete (thCapiBase Base, c_info ErrorCode) { dhead ("CCAPI20_MsgBase::RegisterComplete", DCON_CCAPI20_MsgBase); dparams ("hBase=%p,ApplId=%x,ErrorCode=%x", Base, ApplID(), ErrorCode); dassert (m_CurPutMessage == 0); #if !defined NDEBUG && defined USE_DEBUG_INFO_CLASS && (USE_DEBUG_INFO_CLASS > _USE_DEBUG_INFO_CLASS_NONE) DbgCapiMsgTrace (0, ErrorCode, CMTRACE_Register); #endif if (Base != vIllegalHandle) { dassert ((m_hCapiBase == 0) || (m_hCapiBase == Base)); dassert ((ErrorCode == ci_Int_RegisterDelayed) || (CapiInfoIsSuccess (ErrorCode) == vTrue)); dassert ((ErrorCode == ci_Int_RegisterDelayed) || (ApplID() != IllegalApplID)); m_hCapiBase = Base; #ifndef NDEBUG if (ErrorCode != ci_Int_RegisterDelayed) { dassert (m_RegisterState == REGISTER_STATE_REGISTERING); m_RegisterState = REGISTER_STATE_REGISTERED; } #endif } else { m_hCapiBase = vIllegalHandle; dassert (CapiInfoIsRegError (ErrorCode) == vTrue); dassert (ErrorCode != ci_Reg_Busy); dassert (ApplID() == IllegalApplID); #ifndef NDEBUG dassert (m_RegisterState == REGISTER_STATE_REGISTERING); m_RegisterState = REGISTER_STATE_RELEASED; #endif } REGISTER_COMPLETE (ErrorCode); } /*===========================================================================*\ CCAPI20_MsgBase::ReleaseComplete \*===========================================================================*/ void CCAPI20_MsgBase::ReleaseComplete (void) { dhead ("CCAPI20_MsgBase::ReleaseComplete", DCON_CCAPI20_MsgBase); dwarning (m_CurPutMessage == 0); dwarning (GetApplID() == IllegalApplID); dwarning (PutMsgbufferQueue.IsQueueEmpty() == vTrue); dassert (m_hCapiBase != vIllegalHandle); #if !defined NDEBUG && defined USE_DEBUG_INFO_CLASS && (USE_DEBUG_INFO_CLASS > _USE_DEBUG_INFO_CLASS_NONE) DbgCapiMsgTrace (0, ci_NoError, CMTRACE_Release); #endif #ifndef NDEBUG dassert (m_RegisterState == REGISTER_STATE_RELEASING); m_RegisterState = REGISTER_STATE_RELEASED; #endif m_hCapiBase = vIllegalHandle; PutMsgbufferQueue.FreeQueue(); FreeCurPutMsg(); RELEASE_COMPLETE(); } /*===========================================================================*\ CCAPI20_MsgBase::PutMessageComplete \*===========================================================================*/ void CCAPI20_MsgBase::PutMessageComplete (c_info ErrorCode) { dhead ("CCAPI20_MsgBase::PutMessageComplete", DCON_CCAPI20_MsgBase); dassert (m_CurPutMessage != 0); dassert ((m_CurPutMessage == 0) || (CapiMsg_GetMsgLen (m_CurPutMessage) >= CAPI_MSG_HEADER_ADDR_SIZE)); #if !defined NDEBUG && defined USE_DEBUG_INFO_CLASS && (USE_DEBUG_INFO_CLASS > _USE_DEBUG_INFO_CLASS_NONE) DbgCapiMsgTrace (m_CurPutMessage, ErrorCode, CMTRACE_PutMessage); #endif if (ErrorCode != ci_NoError) { dassert (ErrorCode != ci_Msg_Busy); dassert (ErrorCode != ci_Msg_SendQueueFull); HandleMessageError (0, ErrorCode, m_CurPutMessage); } FreeCurPutMsg(); EmptyPutMsgbufferQueue(); } /*===========================================================================*\ CCAPI20_MsgBase::GetMessageReceived \*===========================================================================*/ void CCAPI20_MsgBase::GetMessageReceived (c_byte *pMessage, c_info ErrorCode) { dhead ("CCAPI20_MsgBase::GetMessageReceived", DCON_CCAPI20_MsgBase); dparams ("buf=%p, len=%x, err=%x", pMessage, (pMessage) ? CapiMsg_GetMsgLen(pMessage) : 0, ErrorCode); dassert (ErrorCode != ci_Msg_Busy); dassert (ErrorCode != ci_Msg_SendQueueFull); #if !defined NDEBUG && defined USE_DEBUG_INFO_CLASS && (USE_DEBUG_INFO_CLASS > _USE_DEBUG_INFO_CLASS_NONE) DbgCapiMsgTrace (pMessage, ErrorCode, CMTRACE_GetMessage); #endif #ifdef NDEBUG dwarning (m_RegisterState == REGISTER_STATE_REGISTERED); #endif if (ErrorCode == ci_NoError) { dassert (m_hCapiBase != vIllegalHandle); dassert (pMessage != 0); HandleGetMessage (pMessage); } else { dassert (ErrorCode != ci_Msg_Busy); dassert (ErrorCode != ci_Msg_SendQueueFull); HandleMessageError (1, ErrorCode, 0); } } /*===========================================================================*\ CCAPI20_MsgBase::HandleGetMessage \*===========================================================================*/ void CCAPI20_MsgBase::HandleGetMessage (c_byte *Message) { dhead ("CCAPI20_MsgBase::HandleGetMessage", DCON_CCAPI20_MsgBase); dassert (Message != 0); dassert (CapiMsg_GetMsgLen (Message) >= CAPI_MSG_HEADER_ADDR_SIZE); //dprintBuf (Message, CapiMsg_GetMsgLen(Message)); switch (CapiMsg_GetSubCmd (Message)) { /*-------------------------------------------------------------------*\ CAPI - Confirmations \*-------------------------------------------------------------------*/ case CAPI_CONF: switch (CapiMsg_GetCmd (Message)) { case CAPI_ALERT: ALERT_CONF (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), CapiMsg_GetInfo (Message, 0)); break; case CAPI_CONNECT: CONNECT_CONF (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), CapiMsg_GetInfo (Message, 0)); break; case CAPI_CONNECT_B3: CONNECT_B3_CONF (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), CapiMsg_GetInfo (Message, 0)); break; case CAPI_DATA_B3: { cm_datab3conf pdc; pdc.ParseMessage (Message); DATA_B3_CONF (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), &pdc); break; } case CAPI_DISCONNECT_B3: DISCONNECT_B3_CONF (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), CapiMsg_GetInfo (Message, 0)); break; case CAPI_DISCONNECT: DISCONNECT_CONF (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), CapiMsg_GetInfo (Message, 0)); break; case CAPI_FACILITY: { cm_facilityconf pf; pf.ParseMessage (Message); FACILITY_CONF (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), &pf); break; } case CAPI_INFO: INFO_CONF (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), CapiMsg_GetInfo (Message, 0)); break; case CAPI_LISTEN: LISTEN_CONF (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), CapiMsg_GetInfo (Message, 0)); break; case CAPI_MANUFACTURER: { cm_manufacturer_ref pm; pm.ParseMessage (Message); MANUFACTURER_CONF (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), &pm); break; } case CAPI_RESET_B3: RESET_B3_CONF (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), CapiMsg_GetInfo (Message, 0)); break; case CAPI_SELECT_B_PROTOCOL: SELECT_B_PROTOCOL_CONF (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), CapiMsg_GetInfo (Message, 0)); break; } break; /*-------------------------------------------------------------------*\ CAPI - Indications \*-------------------------------------------------------------------*/ case CAPI_IND: switch (CapiMsg_GetCmd (Message)) { case CAPI_CONNECT: { cm_connectind pci; pci.ParseMessage (Message); if (CONNECT_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), &pci) == vFalse) { CCAPI20_MsgBase::CONNECT_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), &pci); } break; } case CAPI_CONNECT_ACTIVE: { cm_connectactiveind pcai; pcai.ParseMessage (Message); if (CONNECT_ACTIVE_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), &pcai) == vFalse) { CCAPI20_MsgBase::CONNECT_ACTIVE_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), &pcai); } break; } case CAPI_CONNECT_B3: { CCStruct lncpi; lncpi.ParseMessage (Message); if (CONNECT_B3_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), &lncpi) == vFalse) { CCAPI20_MsgBase::CONNECT_B3_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), &lncpi); } break; } case CAPI_CONNECT_B3_ACTIVE: { CCStruct lncpi; lncpi.ParseMessage (Message); if (CONNECT_B3_ACTIVE_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), &lncpi) == vFalse) { CCAPI20_MsgBase::CONNECT_B3_ACTIVE_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), &lncpi); } break; } case CAPI_CONNECT_B3_T90_ACTIVE: if (CONNECT_B3_T90_ACTIVE_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message)) == vFalse) { CCAPI20_MsgBase::CONNECT_B3_T90_ACTIVE_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message)); } break; case CAPI_DATA_B3: { cm_datab3 pdb3; pdb3.ParseMessage (Message); if (DATA_B3_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), &pdb3) == vFalse) { CCAPI20_MsgBase::DATA_B3_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), &pdb3); } break; } case CAPI_DISCONNECT_B3: { cm_disconnectb3ind pdbi; pdbi.ParseMessage (Message); if (DISCONNECT_B3_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), &pdbi) == vFalse) { CCAPI20_MsgBase::DISCONNECT_B3_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), &pdbi); } break; } case CAPI_DISCONNECT: if (DISCONNECT_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), CapiMsg_GetInfo (Message, 0)) == vFalse) { CCAPI20_MsgBase::DISCONNECT_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), CapiMsg_GetInfo (Message, 0)); } break; case CAPI_FACILITY: { cm_facilityind pf; pf.ParseMessage (Message); if (FACILITY_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), &pf) == vFalse) { CCAPI20_MsgBase::FACILITY_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), &pf); } break; } case CAPI_INFO: { cm_infoind pii; pii.ParseMessage (Message); if (INFO_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), &pii) == vFalse) { CCAPI20_MsgBase::INFO_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), &pii); } break; } case CAPI_MANUFACTURER: { cm_manufacturer_ref pm; pm.ParseMessage (Message); if (MANUFACTURER_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), &pm) == vFalse) { CCAPI20_MsgBase::MANUFACTURER_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), &pm); } break; } case CAPI_RESET_B3: { CCStruct lncpi; lncpi.ParseMessage (Message); if (RESET_B3_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), &lncpi) == vFalse) { CCAPI20_MsgBase::RESET_B3_IND (CapiMsg_GetMsgNr (Message), CapiMsg_GetAddr (Message), &lncpi); } break; } } } } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/capi/Makefile.am0000644000175000017500000000267410470310075017354 0ustar mastermaster## Process this file with automake to produce Makefile.in AUTOMAKE_OPTIONS = foreign CLEANFILES = *~ comperr MAINTAINERCLEANFILES = Makefile.in INCLUDES = -I$(srcdir)/../standard noinst_HEADERS = c2msgdef.h \ capi2def.h \ CapiBase.h \ CapiChan.h \ CapiLay.h \ CapiMsg.h \ CapiStat.h \ CCSFacil.h \ CCSMesg.h \ CCSParam.h \ CCStruct.h \ Channel.h \ DataHand.h \ DCMTrace.h \ dbgCAPI.h \ Facility.h \ MSNList.h \ PLCIList.h noinst_LIBRARIES = libcapi.a libcapi_a_SOURCES = CapiChan.cpp \ CapiLay.cpp \ CapiMsg.cpp \ CapiStat.cpp \ CCStruct.cpp \ Channel.cpp \ DataHand.cpp \ DCMTrace.cpp \ Facility.cpp \ MSNList.cpp \ PLCIList.cpp capi4hylafax-svn/src/capi/MSNList.cpp0000644000175000017500000006235210470310075017314 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "MSNList.h" #include "dbgCAPI.h" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ class CControllerInfo : public CSortPListElement { public: CControllerInfo (void); virtual ~CControllerInfo (void); void DelAllMSNs (void); tCompare Compare (void *RefCompData); void *GetRefCompData (void); tUInt Controller; tUInt InfoMask; tUInt CIPMask; tUInt DDILen; CDynamicString TelNumPrefix; CMultiString MSNList; tBool PMSupportable; }; /*===========================================================================*\ \*===========================================================================*/ static tCompare ArrayFindFunc_NumComp (CConstString *Num1, CConstString *Num2) { dhead ("ArrayFindFunc_NumComp", DCON_CCntrlMSNList); dassert (Num1 != 0); dassert (Num2 != 0); dparams ("%s,%s", Num1->GetPointer(), Num2->GetPointer()); dassert (Num1->IsEmpty() == vFalse); tCompare fret = vHigher; if (Num2->IsEmpty() == vFalse) { fret = a_compare (Num1->GetLen(), Num2->GetLen()); if (fret == vEqual) { fret = s_strncmp (Num1->GetPointer(), Num2->GetPointer(), Num1->GetLen()); } } RETURN ('x', fret); } static tCompare ArrayFindFunc_MSNComp (CConstString *Num1, CCStruct *Num2) { dhead ("ArrayFindFunc_MSNComp", DCON_CCntrlMSNList); dassert (Num1 != 0); dassert (Num2 != 0); dassert (Num1->IsEmpty() == vFalse); dassert (Num2->GetLen() > 1); tUInt len = a_min (Num1->GetLen(), Num2->GetLen() - 1); RETURN ('x', s_strncmp (Num1->GetPointer() + Num1->GetLen() - len, Num2->GetData() + Num2->GetLen() - len, len)); } static tCompare ArrayFindFunc_DDIComp (CConstString *Num1, CConstString *Num2) { dhead ("ArrayFindFunc_DDIComp", DCON_CCntrlMSNList); dassert (Num1 != 0); dassert (Num1->IsEmpty() == vFalse); dassert (Num2 != 0); dassert (Num2->IsEmpty() == vFalse); tCompare fret = a_compare (Num1->GetLen(), Num2->GetLen()); if (fret != vHigher) { fret = s_strncmp (Num1->GetPointer(), Num2->GetPointer(), Num1->GetLen()); } RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ static tSInfo Alloc_CntrlInfo_MSNRange (CMSNRange **ppRange, CConstString *aMSN, CConstString *bMSN) { dhead ("Alloc_CntrlInfo_MSNRange", DCON_CCntrlMSNList); dassert (ppRange != 0); dassert (aMSN != 0); dassert (aMSN->IsEmpty() == vFalse); tSInfo fret = iErr_OutOfMemory; *ppRange = new CMSNRange; if (*ppRange && ((*ppRange)->Set (aMSN) == vTrue)) { if (!bMSN || bMSN->IsEmpty()) { RETURN ('x', vTrue); } if ((*ppRange)->m_End.Set (bMSN) == vTrue) { if ( ((*ppRange)->GetLen() != (*ppRange)->m_End.GetLen()) || (ArrayFindFunc_NumComp (*ppRange, &(*ppRange)->m_End) != vLower)) { fret = iErr_MSNList_InvalidValue; } else { RETURN ('x', vTrue); } } } delete *ppRange; *ppRange = 0; RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ static tResult ArrayFindFunc_Range (CPointerListElement *pElement, void *RefData) { dhead ("ArrayFindFunc_Range", DCON_CCntrlMSNList); dparams ("%x,%x", pElement, RefData); dassert (pElement != 0); dassert (RefData != 0); dassert (((CMSNRange *)RefData)->IsEmpty() == vFalse); // sorting criterion: 1.) length ; 2.) digits switch (ArrayFindFunc_NumComp ((CMSNRange *)pElement, (CMSNRange *)RefData)) { case vEqual: // Equal values are not allowed! dwarning (0); RETURN ('x', vError); case vHigher: if (ArrayFindFunc_NumComp ((CMSNRange *)pElement, &((CMSNRange *)RefData)->m_End) != vHigher) { // Equal values or overlapping ranges are not allowed! dwarning (0); RETURN ('x', vError); } RETURN ('x', vCancel); case vLower: if ( (((CMSNRange *)pElement)->m_End.IsEmpty() == vFalse) && (ArrayFindFunc_NumComp (&((CMSNRange *)pElement)->m_End, (CMSNRange *)RefData) != vLower)) { // Equal values or overlapping ranges are not allowed! dwarning (0); RETURN ('x', vError); } break; } RETURN ('x', vNo); } /*===========================================================================*\ \*===========================================================================*/ static tResult ArrayFindFunc_MSN (CPointerListElement *pElement, void *RefData) { dhead ("ArrayFindFunc_MSN", DCON_CCntrlMSNList); dparams ("%x,%x", pElement, RefData); dassert (pElement != 0); dassert (RefData != 0); switch (ArrayFindFunc_MSNComp (((CMSNRange *)pElement), (CCStruct *)RefData)) { case vEqual: RETURN ('x', vYes); case vHigher: //RETURN ('x', vCancel); // because of the length-specific sorting we can not stop here break; case vLower: if (((CMSNRange *)pElement)->m_End.IsEmpty() == vFalse) { switch (ArrayFindFunc_MSNComp (&((CMSNRange *)pElement)->m_End, (CCStruct *)RefData)) { case vEqual: case vHigher: RETURN ('x', vYes); case vLower: break; } } break; } RETURN ('x', vNo); } /*===========================================================================*\ \*===========================================================================*/ static tResult ArrayFindFunc_DDI (CPointerListElement *pElement, void *RefData) { dhead ("ArrayFindFunc_DDI", DCON_CCntrlMSNList); dparams ("%x,%x", pElement, RefData); dassert (pElement != 0); dassert (RefData != 0); // Compare length and digits and ignore subaddresstype of MSN. switch (ArrayFindFunc_DDIComp ((CMSNRange *)pElement, (CConstString *)RefData)) { case vHigher: RETURN ('x', vCancel); case vEqual: RETURN ('x', vYes); case vLower: if (((CMSNRange *)pElement)->m_End.IsEmpty() == vFalse) { switch (ArrayFindFunc_DDIComp (&((CMSNRange *)pElement)->m_End, (CConstString *)RefData)) { case vHigher: RETURN ('x', vYes); case vEqual: RETURN ('x', vYes); break; case vLower: break; } } break; } RETURN ('x', vNo); } /*===========================================================================*\ \*===========================================================================*/ tBool CCntrlMSNList::Set (tUInt Controller, tUInt InfoMask, tUInt CIPMask) { dhead ("CCntrlMSNList::Set", DCON_CCntrlMSNList); dassert (Controller > 0); CControllerInfo *pE = (CControllerInfo *)FindHigher (&Controller); if (!pE) { dprint ("New ControllerInfo! "); if (!CIPMask && !InfoMask) { RETURN ('x', vTrue); } pE = new CControllerInfo; if (!pE) { RETURN ('x', vFalse); } pE->Controller = Controller; CSortPointerList::AddFromLow (pE); } if ((pE->DDILen > 0) || (pE->TelNumPrefix.IsEmpty() == vFalse)) { InfoMask |= infomask_CalledPartyNum | infomask_SendingComplete; } pE->CIPMask = CIPMask; pE->InfoMask = InfoMask; RETURN ('x', vTrue); } /*===========================================================================*\ \*===========================================================================*/ tBool CCntrlMSNList::Add (tUInt Controller, tUInt InfoMask, tUInt CIPMask) { dhead ("CCntrlMSNList::Add", DCON_CCntrlMSNList); dassert (Controller > 0); if (!CIPMask && !InfoMask) { return vTrue; } CControllerInfo *pE = (CControllerInfo *)FindHigher (&Controller); if (!pE) { dprint ("New ControllerInfo! "); pE = new CControllerInfo; if (!pE) { RETURN ('x', vFalse); } pE->Controller = Controller; CSortPointerList::AddFromLow (pE); } pE->CIPMask |= CIPMask; pE->InfoMask |= InfoMask; RETURN ('x', vTrue); } /*===========================================================================*\ \*===========================================================================*/ tBool CCntrlMSNList::SetDDI (tUInt Controller, CConstString *pTelNumPrefix, tUInt MaxDDILen) { dhead ("CCntrlMSNList::SetDDI", DCON_CCntrlMSNList); dassert (Controller > 0); CControllerInfo *pE = (CControllerInfo *)FindHigher (&Controller); if (!pE) { dprint ("New ControllerInfo! "); if ((MaxDDILen == 0) && ((pTelNumPrefix == 0) || (pTelNumPrefix->IsEmpty() == vTrue))) { RETURN ('x', vTrue); } pE = new CControllerInfo; if (!pE || (pE->TelNumPrefix.Set (pTelNumPrefix) == vFalse)) { delete pE; RETURN ('x', vFalse); } pE->Controller = Controller; pE->DDILen = MaxDDILen; CSortPointerList::AddFromLow (pE); } else if (pTelNumPrefix) { if (pE->TelNumPrefix.Set (pTelNumPrefix) == vFalse) { RETURN ('x', vFalse); } } else { pE->TelNumPrefix.RemoveAll(); } if (MaxDDILen || (pE->TelNumPrefix.IsEmpty() == vFalse)) { // SET DDI pE->InfoMask |= infomask_CalledPartyNum | infomask_SendingComplete; } else { // CLEAR DDI // TODO?: perhaps somebody has set the infomask-flags externally pE->InfoMask &= ~(infomask_CalledPartyNum | infomask_SendingComplete); } pE->DDILen = MaxDDILen; RETURN ('x', vTrue); } /*===========================================================================*\ \*===========================================================================*/ tSInfo CCntrlMSNList::SetMSN (tUInt Controller, CConstString *aMSN, CConstString *bMSN) { dhead ("CCntrlMSNList::SetMsn", DCON_CCntrlMSNList); dparams ("%x,%s,%s", Controller, aMSN, bMSN); dassert (Controller > 0); if (aMSN && aMSN->IsEmpty()) { aMSN = 0; } dassert ((aMSN != 0) || (bMSN == 0)); // (aMSN == 0 && bMSN != 0) is not allowed CControllerInfo *pE = (CControllerInfo *)FindHigher (&Controller); if (!pE) { if (!aMSN) { RETURN ('x', i_Okay); } pE = new CControllerInfo; if (!pE) { RETURN ('x', iErr_OutOfMemory); } pE->Controller = Controller; CSortPointerList::AddFromLow (pE); } else { pE->DelAllMSNs(); if (!aMSN) { RETURN ('x', i_Okay); } } CMSNRange *newRange = 0; tSInfo fret = Alloc_CntrlInfo_MSNRange (&newRange, aMSN, bMSN); dwarning (infoSuccess (fret)); if (infoSuccess (fret)) { dassert (newRange != 0); dassert (newRange->IsEmpty() == vFalse); // no empty MSN's allowed pE->MSNList.AddFirst (newRange); } RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ tSInfo CCntrlMSNList::AddMSN (tUInt Controller, CConstString *aMSN, CConstString *bMSN) { dhead ("CCntrlMSNList::AddMsn", DCON_CCntrlMSNList); dassert (aMSN != 0); dparams ("%x,%s,%s", Controller, aMSN->GetPointer(), (bMSN) ? bMSN->GetPointer() : 0); dassert (Controller > 0); dassert (aMSN->IsEmpty() == vFalse); CControllerInfo *pE = (CControllerInfo *)FindHigher (&Controller); if (!pE) { pE = new CControllerInfo; if (!pE) { RETURN ('x', iErr_OutOfMemory); } pE->Controller = Controller; CSortPointerList::AddFromLow (pE); } // MSNs are added to a sortedArray CPointerListElement *foundPos = 0; CMSNRange *newRange = 0; tSInfo fret = Alloc_CntrlInfo_MSNRange (&newRange, aMSN, bMSN); if (infoSuccess (fret)) { dassert (newRange != 0); dassert (newRange->IsEmpty() == vFalse); // no empty MSN's allowed switch (pE->MSNList.FindFwd (ArrayFindFunc_Range, newRange, &foundPos)) { case vNo: // Add at the end pE->MSNList.AddLast (newRange); break; case vCancel: dassert (foundPos != 0); foundPos->AddBefore (newRange); break; default: dassert (0); // no break case vError: // overlapping ranges found dwarning (0); delete newRange; fret = iErr_MSNList_MSNOverlap; break; case vYes: // dupplicate Entry found dwarning (0); delete newRange; fret = iErr_MSNList_MSNEqual; break; } } RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ void CCntrlMSNList::Remove (tUInt Controller) { dhead ("CCntrlMSNList::Remove", DCON_CCntrlMSNList); dparams ("%x", Controller); dassert (Controller > 0); CControllerInfo *pE = (CControllerInfo *)FindHigher (&Controller); if (pE) { delete pE; } } /*===========================================================================*\ \*===========================================================================*/ tSInfo CCntrlMSNList::FindCallInfo (tUInt Controller, c_cipvalue CIPValue, CCStruct *pMSN, tUInt *pDDIPrefixLen) { dhead ("CCntrlMSNList::FindCallInfo", DCON_CCntrlMSNList); dparams ("%x,%x", Controller, CIPValue); dassert (Controller > 0); dassert (pDDIPrefixLen != 0); *pDDIPrefixLen = 0; CControllerInfo *pE = (CControllerInfo *)FindHigher (&Controller); dassert (pE != 0); if (pE && ((1 << CIPValue) & pE->CIPMask)) { dprint ("Found Cntrl with valid CIPValue! "); if (pE->InfoMask & infomask_CalledPartyNum) { dwarning (pE->TelNumPrefix.IsEmpty() == vFalse); if ((pE->DDILen == 0) && (pE->MSNList.IsEmpty() == vTrue)) { dassert (0); RETURN ('x', iWrn_MSNList_RejectCall); } *pDDIPrefixLen = 0; dprint ("-Handle DDI(%x)- ", pMSN->GetLen()); dwarning (pE->TelNumPrefix.GetLen() < pMSN->GetLen()); if ((pMSN->GetLen() > 1) && (pE->TelNumPrefix.GetLen() > 0) && (pE->TelNumPrefix.GetLen() < pMSN->GetLen())) { c_byte *pFind = s_findstring (pMSN->GetData() + 1, pMSN->GetLen() - 1, pE->TelNumPrefix.GetPointer(), pE->TelNumPrefix.GetLen()); // calculate len for DDI Number Prefix dwarning (pFind != 0); if (pFind) { dassert (pFind > pMSN->GetData()); *pDDIPrefixLen = pFind - pMSN->GetData() + pE->TelNumPrefix.GetLen() - 1; // - 1 to ignore the 0xA0 Byte dprint ("DDIPrefixLen=%x ", *pDDIPrefixLen); } } //return (len > *pDDIPrefixLen) ? TestDDINumber (Controller, pData + *pDDIPrefixLen, len - *pDDIPrefixLen) : // iWrn_MSNList_DDICall; RETURN ('x', iWrn_MSNList_DDICall); } // Global Call dprint ("AllowGlobalCall=%x,MSNLen=%x,MSNList=%x ", AllowGlobalCall, pMSN->GetLen(), pE->MSNList.IsEmpty()); if (pMSN->GetLen() > 1) { if ( (pE->MSNList.IsEmpty() == vTrue) || (pE->MSNList.FindFwd (ArrayFindFunc_MSN, pMSN) == vYes)) { RETURN ('x', i_Okay); } } else if (AllowGlobalCall == vTrue) { RETURN ('x', i_Okay); } } RETURN ('x', iWrn_MSNList_RejectCall); } /*===========================================================================*\ \*===========================================================================*/ tSInfo CCntrlMSNList::TestDDINumber (tUInt Controller, CConstString *DDINumber) { dhead ("CCntrlMSNList::TestDDINumber", DCON_CCntrlMSNList); dparams ("%x,%s", Controller, DDINumber->GetPointer()); dassert (Controller > 0); dassert (DDINumber != 0); dassert (DDINumber->IsEmpty() == vFalse); tSInfo fret = iWrn_MSNList_RejectCall; CControllerInfo *pE = (CControllerInfo *)FindHigher (&Controller); dwarning (pE != 0); if (pE) { dassert (pE->InfoMask & infomask_CalledPartyNum); dwarning (pE->DDILen > 0); dprint ("%x,%x,%x ", pE->DDILen, DDINumber->GetLen(), pE->MSNList.IsEmpty()); if (pE->MSNList.IsEmpty() == vTrue) { fret = (DDINumber->GetLen() >= pE->DDILen) ? i_Okay : iWrn_MSNList_DDICall; } else { fret = (pE->MSNList.FindFwd (ArrayFindFunc_DDI, DDINumber) == vYes) ? i_Okay : iWrn_MSNList_DDICall; } } RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ tBool CCntrlMSNList::GetMask (tUInt Controller, tUInt *pInfoMask, tUInt *pCIPMask) { dhead ("CCntrlMSNList::BuildMask", DCON_CCntrlMSNList); dassert (Controller != IllegalController); dassert (pCIPMask != 0); dassert (pInfoMask != 0); CControllerInfo *pE = (CControllerInfo *)FindHigher (&Controller); if (!pE) { RETURN ('x', vFalse); } if ((pE->InfoMask & infomask_CalledPartyNum) && (pE->DDILen == 0) && (pE->MSNList.IsEmpty() == vFalse)) { dwarning (0); RETURN ('x', vFalse); } *pCIPMask = pE->CIPMask; *pInfoMask = pE->InfoMask; //if (!*pCIPMask && !*pInfoMask) { // pCurPos = (CControllerInfo *)pE->GetPrev(); // delete pE; //} RETURN ('x', vTrue); } /*===========================================================================*\ \*===========================================================================*/ tBool CCntrlMSNList::GetNextMask (tUInt *pController, tUInt *pInfoMask, tUInt *pCIPMask) { dhead ("CCntrlMSNList::BuildNextMask", DCON_CCntrlMSNList); dassert (pController != 0); dassert (pCIPMask != 0); dassert (pInfoMask != 0); tBool fret = vFalse; CControllerInfo *pE = pCurPos; pE = (CControllerInfo *)((pE != 0) ? pE->GetHigher() : GetLowest()); if (pE) { while ( (pE->InfoMask & infomask_CalledPartyNum) && (pE->DDILen == 0) && (pE->MSNList.IsEmpty() == vTrue)) { dwarning (0); pE = (CControllerInfo *)pE->GetHigher(); if (pE == 0) { pCurPos = 0; RETURN ('x', fret); } } dassert (pE != 0); *pController = pE->Controller; *pCIPMask = pE->CIPMask; *pInfoMask = pE->InfoMask; fret = vTrue; dprint ("Cntrl=%x,Info=%x,CIP=%x ", *pController, *pInfoMask, *pCIPMask); } pCurPos = pE; RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ CMultiString *CCntrlMSNList::GetAllMSNs (tUInt Controller) { dhead ("CCntrlMSNList::GetMSN", DCON_CCntrlMSNList); CControllerInfo *pE = (CControllerInfo *)FindHigher (&Controller); dwarning (pE != 0); RETURN ('x', (!pE || pE->MSNList.IsEmpty()) ? 0 : &pE->MSNList); } /*===========================================================================*\ \*===========================================================================*/ CMSNRange *CCntrlMSNList::GetMSN (tUInt Controller, tUInt pos) { dhead ("CCntrlMSNList::GetMSN", DCON_CCntrlMSNList); CMSNRange *pMSN = 0; CControllerInfo *pE = (CControllerInfo *)FindHigher (&Controller); dwarning (pE != 0); if (pE) { dassert (pE->MSNList.CountElements() > pos); pMSN = (CMSNRange *)pE->MSNList.GetFirst(); for (tUInt i = pos; (pMSN != 0) && (i > 0); i--) { pMSN = (CMSNRange *)pMSN->GetNext(); } } RETURN ('x', pMSN); } /*===========================================================================*\ \*===========================================================================*/ CDynamicString *CCntrlMSNList::GetDDIOffset (tUInt Controller) { dhead ("CCntrlMSNList::GetDDIOffset", DCON_CCntrlMSNList); CControllerInfo *pE = (CControllerInfo *)FindHigher (&Controller); dwarning (pE != 0); RETURN ('x', (!pE || pE->TelNumPrefix.IsEmpty()) ? 0 : &pE->TelNumPrefix); } /*===========================================================================*\ \*===========================================================================*/ tUInt CCntrlMSNList::GetDDILen (tUInt Controller) { dhead ("CCntrlMSNList::GetDDILen", DCON_CCntrlMSNList); CControllerInfo *pE = (CControllerInfo *)FindHigher (&Controller); dwarning (pE != 0); RETURN ('x', (!pE) ? 0 : pE->DDILen); } /*===========================================================================*\ \*===========================================================================*/ tUInt CCntrlMSNList::GetCountMSN (tUInt Controller) { dhead ("CCntrlMSNList::GetCountMSN", DCON_CCntrlMSNList); CControllerInfo *pE = (CControllerInfo *)FindHigher (&Controller); RETURN ('x', (pE) ? pE->MSNList.CountElements() : 0); } /*===========================================================================*\ \*===========================================================================*/ tBool CCntrlMSNList::ExistMSNRange (tUInt Controller) { dhead ("CCntrlMSNList::ExistMSNRange", DCON_CCntrlMSNList); tBool fret = vFalse; CControllerInfo *pE = (CControllerInfo *)FindHigher (&Controller); dwarning (pE != 0); if (pE) { for (CMSNRange *MSNRange = (CMSNRange *)pE->MSNList.GetFirst(); MSNRange != 0; MSNRange = (CMSNRange *)MSNRange->GetNext()) { if (MSNRange->m_End.IsEmpty() == vFalse) { fret = vTrue; break; } } } RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ void CCntrlMSNList::SetWakeupSupport (tUInt Controller, tBool IsSupported) { dhead ("CCntrlMSNList::SetWakeupSupport", DCON_CCntrlMSNList); dassert (Controller > 0); CControllerInfo *pE = (CControllerInfo *)FindHigher (&Controller); if (pE) { pE->PMSupportable = IsSupported; } } /*===========================================================================*\ \*===========================================================================*/ tBool CCntrlMSNList::GetWakeupSupport (tUInt Controller) { dhead ("CCntrlMSNList::GetWakeupSupport", DCON_CCntrlMSNList); dassert (Controller > 0); CControllerInfo *pE = (CControllerInfo *)FindHigher (&Controller); RETURN ('x', (pE) ? pE->PMSupportable : vFalse); } /*===========================================================================*\ CControllerInfo - Funktionen \*===========================================================================*/ CControllerInfo::CControllerInfo (void) : Controller (0), InfoMask (0), CIPMask (0), DDILen (0), PMSupportable (vTrue) { dhead ("CControllerInfo-Constructor", DCON_CCntrlMSNList); } CControllerInfo::~CControllerInfo (void) { dhead ("CControllerInfo-Destructor", DCON_CCntrlMSNList); DelAllMSNs(); } void CControllerInfo::DelAllMSNs (void) { dhead ("CControllerInfo::DelAllMSNs", DCON_CCntrlMSNList); COneMultiString *delMSN; while ((delMSN = MSNList.GetLast()) != 0) { delete delMSN; } } tCompare CControllerInfo::Compare (void *RefCompData) { dhead ("CControllerInfo::Compare", DCON_CCntrlMSNList); dparams ("%x,%x", Controller, *((tUInt *)RefCompData)); return (*((tUInt *)RefCompData) < Controller) ? vLower : (*((tUInt *)RefCompData) == Controller) ? vEqual : vHigher; } void *CControllerInfo::GetRefCompData (void) { dhead ("CControllerInfo::GetRefCompData", DCON_CCntrlMSNList); return &Controller; } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/faxrecv/0000755000175000017500000000000010470310075016031 5ustar mastermastercapi4hylafax-svn/src/faxrecv/faxrecv.cpp0000644000175000017500000005261610470310075020205 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include #include #include #include #include #include #include #include #include #include #include #include "faxrecv.h" #include "ConfPars.h" #include "aString.h" #include "osImport.h" #include "misc.h" /*---------------------------------------------------------------------------*\ from capiutils.h: \*---------------------------------------------------------------------------*/ extern "C" char *capi_info2str(c_word reason); /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define FAX_FILTER_BUFFER_SIZE 1000 #define CAPI_BUFFER_SIZE CapiMaxDataSize /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ //#define GENERATE_DEBUGSFFDATAFILE #ifdef GENERATE_DEBUGSFFDATAFILE static FILE *DebugSffDataFile = 0; #endif /*===========================================================================*\ \*===========================================================================*/ CFaxReceive::CFaxReceive (CFaxReceiveDevice *FaxRecvDevice, FaxFormatType faxtype) : jobNr (0), quitRecv (0), hJobFile (0) { dhead ("CFaxReceive - Constructor", DCON_CFaxReceive); FaxDevice = FaxRecvDevice; SetFormat (faxtype); SetReceiveID (&ONumber); } /*===========================================================================*\ \*===========================================================================*/ CFaxReceive::~CFaxReceive (void) { dhead ("CFaxReceive - Destructor", DCON_CFaxReceive); CloseRecv(); if (hJobFile > 0) { fclose (hJobFile); hJobFile = 0; } } /*===========================================================================*\ \*===========================================================================*/ tBool CFaxReceive::StartReceive (void) { dhead ("CFaxReceive::StartReceive", DCON_CFaxReceive); cp_b3configuration_faxext B3Config (b3_faxextopt_highres | b3_faxextopt_jbig, &FaxDevice->FaxNumber); SetB1Parameters (b1prot_G3Fax); SetB2Parameters (b2prot_G3Fax); SetB3Parameters (b3prot_G3Fax_extended, &B3Config); SetNCPI (0); return vTrue; } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceive::StopReceive (void) { dhead ("CFaxReceive::StopReceive", DCON_CFaxReceive); quitRecv = 1; StopRecv(); ResetChannel(); } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceive::ListenError (tUInt Controller, c_info Info) { dhead ("CFaxReceive::ListenError", DCON_CFaxReceive); if (Controller) { WriteLog (LOG_ERR, "Try to listen for call on Controller %d, but got error code 0x%X.\n", Controller, Info); } else if (CapiInfoIsRegError (Info)) { // Get a Register-Errror as Reason => CAPI not installed, terminate Programm dprint ("\nCAPI not installed! "); WriteLog (LOG_ERR, "CAPI not installed, started or have no access rights on it!\n"); FaxDevice->WriteStatus ("CAPI not installed, started or have no access rights on it!!"); } else { WriteLog (LOG_ERR, "Try to listen for calls but got error code 0x%X.\n", Info); } NotifyFIFO ('W'); StopReceive(); } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceive::IncomingCall (c_cipvalue CIPValue, CConstString *pOppositeNumber, CConstString *pMyCalledNumber) { dhead ("CFaxReceive::IncomingCall", DCON_CFaxReceive); dassert (pOppositeNumber != 0); dassert (pMyCalledNumber != 0); dparams ("%x,%s,%s", CIPValue, pOppositeNumber->GetPointer(), pMyCalledNumber->GetPointer()); CDynamicString InfoText ("Incoming "); ConnectionInd(); jobNr = 0; switch (CIPValue) { case cipvalue_Speech: InfoText.Append ("speech"); break; case cipvalue_3_1kHzAudio: InfoText.Append ("analog"); break; default: InfoText.Append ("fax"); break; } InfoText.PrintAppend (" call on controller %d", GetActiveController()); if (!pOppositeNumber->IsEmpty()) { ONumber.Set (pOppositeNumber); InfoText.PrintAppend (" from %S", pOppositeNumber); } else { ONumber.RemoveAll(); } if (!pMyCalledNumber->IsEmpty()) { MyNumber.Set (pMyCalledNumber); InfoText.PrintAppend (" to %S", pMyCalledNumber); } else { MyNumber.RemoveAll(); } if (GetFormat() == FaxFormat_Hylafax) { if (GetJobFile() == vFalse) { WriteLog (LOG_ERR, "Can't create log file for incomming call!\n"); // TODO: better disconnect the call? } WriteLog (LOG_INFO, "SESSION BEGIN %09u %s\n", jobNr, FaxDevice->FaxNumber.GetPointer()); } if (InfoText.ErrorDetected()) { WriteLog (LOG_ERR, "Memory Full during generation of Log output!\n"); } else { dassert (InfoText.IsEmpty() == vFalse); dassert (InfoText.GetPointer() != 0); WriteLog (LOG_INFO, "%s.\n", InfoText.GetPointer()); } FaxDevice->WriteStatus ("Answering the phone"); AnswerCall (creject_Accept); } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceive::DoConnecting (void) { dhead ("CFaxReceive::DoConnecting", DCON_CFaxReceive); // Nothing to do! } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceive::ConnectProceeding (CConstString *) { dhead ("CFaxReceive::ConnectProceeding", DCON_CFaxReceive); ConnectionStarted(); } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceive::IsConnected (cp_ncpi_all *pNCPI) { dhead ("CFaxReceive::IsConnected", DCON_CFaxReceive); ConnectLog (pNCPI); if ( (pNCPI) && ( (pNCPI->Format != 0) // no SFF format || (pNCPI->Options & 0x2))) { // fax polling not implemented yet dwarning (0); WriteLog (LOG_INFO, "Could not handle this kind of fax! Disconnect now.\n"); Disconnect (DisconnectKind_Fast); return; } if (infoError (OpenRecv())) { WriteLog (LOG_ERR, "Can't create file for the fax. Disconnecting now!\n"); Disconnect (DisconnectKind_Fast); } else { #ifdef GENERATE_DEBUGSFFDATAFILE dwarning (DebugSffDataFile == 0); if (!DebugSffDataFile) { DebugSffDataFile = fopen ("/tmp/c2faxrecv_dbgdatafile.sff", "w"); } #endif NotifyFIFO ('I'); // Comm id NotifyFIFO ('B'); // Busy + inbound call FaxDevice->WriteStatus ("Receiving facsimile"); NotifyFIFO ('S'); } } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceive::PutDataComplete (void *, c_info) { dhead ("CFaxReceive::PutDataComplete", DCON_CFaxReceive); dwarning (0); // Should never been called! // Nothing to do! } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceive::GetData (tUByte *Data, tUShort DataLength, tUShort DataHandle) { dhead ("CFaxReceive::GetData", DCON_CFaxReceive); dassert (Data != 0); dwarning (DataLength > 0); #ifdef GENERATE_DEBUGSFFDATAFILE if (DebugSffDataFile) { fwrite (Data, DataLength, 1, DebugSffDataFile); } #endif if (infoError (RecvSFF (Data, DataLength))) { Disconnect (DisconnectKind_Fast); } GetDataComplete (DataHandle); } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceive::DisconnectInquiry (c_info, cp_ncpi_all *pNCPI) { dhead ("CFaxReceive::DisconnectInquiry", DCON_CFaxReceive); dwarning (pNCPI != 0); StopRecv(); if (pNCPI) { if (GetFormat() == FaxFormat_SFF) { SetPageCount (pNCPI->Pages); } else if (GetPageCount() != pNCPI->Pages) { WriteLog (LOG_ERR, "Discrepance between CAPI's (%d) and internal (%d) number of pages!\n", pNCPI->Pages, GetPageCount()); //SetPageCount (pNCPI->Pages); } } DisconnectConfirm(); } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceive::IsDisconnected (c_info Reason) { dhead ("CFaxReceive::IsDisconnected", DCON_CFaxReceive); dparams ("%x", Reason); CloseRecv(); #ifdef GENERATE_DEBUGSFFDATAFILE if (DebugSffDataFile) { fclose (DebugSffDataFile); DebugSffDataFile = 0; } #endif if (GetRecvFiles() && (GetRecvFiles()->IsEmpty() == vFalse)) { tUInt CountIllegalLines = 0; tUInt CountAllLines = 0; if ((GetFormat() != FaxFormat_SFF) && (GetRecvIllegalLines (&CountIllegalLines, &CountAllLines))) { if (!CountAllLines) { WriteLog (LOG_ERR, "No fax data was received!\n"); } else { tUInt percent = CountIllegalLines * 100 / CountAllLines; if (percent > 10) { WriteLog (LOG_ERR, "Around %d%% of the received fax is corrupt (%d lines)!\n", percent, CountIllegalLines); } else { WriteLog (LOG_INFO, "Received some illegal lines (%d lines = %d%% of fax),\n", CountIllegalLines, percent); } } } if (GetReceiveID()->IsEmpty()) { dwarning (0); GetReceiveID()->Set ("-"); } if (FaxDevice->MainClass->FaxRcvdCmd.IsEmpty() == vFalse) { CDynamicString executeCommand; executeCommand.Set (&FaxDevice->MainClass->FaxRcvdCmd); char *StateText = ""; if (GetFormat() == FaxFormat_Hylafax) { switch (GetRecvState()) { default: case 0: StateText = "Can't build up connection for incoming call."; break; case 3: if (CountAllLines != 0) { if (CountIllegalLines * 100 / CountAllLines > 50) { StateText = "More than half of the fax is corrupted!"; } break; } // no break! case 1: StateText = "Connection was established but no fax data was received."; break; case 2: StateText = "Connection droped unexpected during fax receiving."; break; } // Hylafax: executeCommand.PrintAppend (" \"%S\" \"%S\" \"%09u\" \"%s\" \"%S\" \"\" \"%S\"", GetRecvFiles()->GetFirst(), &FaxDevice->DeviceName, jobNr, StateText, GetReceiveID(), &MyNumber); WriteXferLog ("RECV", jobNr, 0, 0, (char *)FaxDevice->DeviceName.GetPointer(), 0, &MyNumber, StateText); } else { // mgetty: "" "" tUInt recvStatus = 0; switch (GetRecvState()) { default: case 0: recvStatus = 6; break; case 3: if (CountAllLines != 0) { if (CountIllegalLines * 100 / CountAllLines > 50) { recvStatus = 12; } break; } // no break! case 1: recvStatus = 7; break; case 2: recvStatus = 12; break; } executeCommand.PrintAppend (" %u 0x%X \"", recvStatus, Reason); executeCommand.Append (GetReceiveID()); executeCommand.Append ("\" \""); if (!MyNumber.IsEmpty()) { executeCommand.Append (&MyNumber); } executeCommand.PrintAppend ("\" %u", GetPageCount()); for (COneMultiString *pLauf = GetRecvFiles()->GetFirst(); (pLauf != 0); pLauf = pLauf->GetNext()) { executeCommand.PrintAppend (" \"%S\"", pLauf); } } if (executeCommand.ErrorDetected() == vTrue) { WriteLog (LOG_INFO, "Fax received and stored under %s.\n", GetRecvFiles()->GetFirst()->GetPointer()); WriteLog (LOG_ERR, "Allocating memory error! Can't notify new received fax!\n"); FaxDevice->WriteStatus ("Allocating memory error! Can't notify new received fax!"); NotifyFIFO ('W'); quitRecv = 1; } else { WriteLog (LOG_INFO, "Fax received and calling '%s'.\n", executeCommand.GetPointer()); fflush (0); runCmd ((char *)executeCommand.GetPointer(), vTrue); } } else { WriteLog (LOG_INFO, "Fax received and stored under %s.\n", GetRecvFiles()->GetFirst()->GetPointer()); } GetRecvFiles()->RemoveAndDeleteAll(); } WriteLog (LOG_INFO, "Connection is droped with reason 0x%X (%s).\n", Reason, capi_info2str (Reason)); if (hJobFile > 0) { WriteLog (LOG_INFO, "SESSION END\n"); fclose (hJobFile); hJobFile = 0; } jobNr = 0; ONumber.RemoveAll(); MyNumber.RemoveAll(); FaxDevice->WriteStatus ("Running and idle"); NotifyFIFO ('I'); NotifyFIFO ('R'); } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceive::IsReseted (void) { dhead ("CFaxReceive::IsReseted", DCON_CFaxReceive); //dassert (CapiInfoIsSuccess (Info)); if (quitRecv == 0) { WriteLog (LOG_ERR, "Can't register at CAPI! Is CAPI loaded and accessible from this program?\n"); } else { quitRecv = 0; } CFaxReceiveDevice *fd = FaxDevice; delete this; fd->ReceiveStoped(); } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceive::PageEndReached (tBool /*IsLastPage*/) { dhead ("CFaxReceive::PageEndReached", DCON_CFaxReceive); NotifyFIFO ('P'); } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceive::WriteLog (tSInt priority, char *text, ...) { dhead ("CFaxReceive::WriteLog", DCON_CFaxReceive); char timebuf[MAX_STRING_SIZE]; timeval tv; va_list params; va_start (params, text); gettimeofday (&tv, 0); strftime (timebuf, MAX_STRING_SIZE, "%h %d %T", localtime((time_t*) &tv.tv_sec)); sprintf (timebuf + strlen(timebuf), ".%02lu: [%5d]: ", tv.tv_usec / 10000, getpid()); if (hJobFile) { fprintf (hJobFile, timebuf); vfprintf (hJobFile, text, params); va_end (params); va_start (params, text); } FaxDevice->vWriteLog (priority , text, params); va_end (params); } /*===========================================================================*\ \*===========================================================================*/ tUInt CFaxReceive::GetRecvFileMode (void) { dhead ("CFaxReceive::GetRecvFileMode", DCON_CFaxReceive); return FaxDevice->RecvFileMode; } /*===========================================================================*\ \*===========================================================================*/ CDynamicString *CFaxReceive::GetSpoolDir (void) { dhead ("CFaxReceive::GetSpoolDir", DCON_CFaxReceive); return &FaxDevice->MainClass->SpoolDir; } /*===========================================================================*\ \*===========================================================================*/ tBool CFaxReceive::NotifyFIFO (char Type) { dhead ("CFaxReceive::NotifyFIFO", DCON_CFaxReceive); dparams ("%c", Type); if (GetFormat() != FaxFormat_Hylafax) { return vTrue; } CDynamicString FaxInfo; tBool recv = vFalse; char *text = 0; switch (Type) { // Modem part case 'I': if (jobNr > 0) { FaxInfo.Print ("%09u", jobNr); text = (char *)FaxInfo.GetPointer(); } break; case 'C': // TODO? MSN eintragen? text = (char *)ONumber.GetPointer(); break; // Receive part case 'S': case 'P': case 'D': if (GetRecvFiles() && (GetRecvFiles()->IsEmpty() == vFalse)) { dassert (GetRecvFiles()->GetFirst()->IsEmpty() == vFalse); FaxInfo. Print ("%lx,%x,%x,%S,%09u,\"%S\",\"%S\",\"%s\"", (tUInt64)(time (0) - GetStartTime()), GetPageCount(), FaxPropEncode (GetResolution(), GetBaudRate()), GetRecvFiles()->GetFirst(), jobNr, GetReceiveID(), &ONumber, ""); text = (char *)FaxInfo.GetPointer(); recv = vTrue; } else { dassert (0); return vFalse; } break; default: return FaxDevice->NotifyFIFO (Type); } return FaxDevice->NotifyFIFO (recv, Type, text); } /*===========================================================================*\ \*===========================================================================*/ tBool CFaxReceive::GetJobFile (void) { dhead ("CFaxReceive::GetJobFile", DCON_CFaxReceive); dassert (GetFormat() == FaxFormat_Hylafax); jobNr = 0; if (hJobFile != 0) { fclose (hJobFile); hJobFile = 0; } char astring[MAX_STRING_SIZE]; tSInt len; tUInt tmpJobFileNr = 1; tSInt tmpFileD = -1; tSInt SeqFile = open (HYLAFAX_LOG_DIR HYLAFAX_SEQF_FILE, O_CREAT | O_RDWR, 0644); if (SeqFile >= 0) { flock (SeqFile, LOCK_EX); len = read (SeqFile, astring, MAX_STRING_SIZE); astring[(len <= 0) ? 0 : len] = '\0'; tmpJobFileNr = atoi (astring) + 1; } for (tUInt trys = MAX_TRY_COUNT; trys > 0; trys--, tmpJobFileNr++) { if (tmpJobFileNr < 1 || tmpJobFileNr > MAX_SEQ_NUMBER) { tmpJobFileNr = 1; } sprintf (astring, HYLAFAX_LOG_DIR "c%09u", tmpJobFileNr); tmpFileD = open (astring, O_RDWR | O_CREAT | O_EXCL, FaxDevice->MainClass->LogFileMode); dprint ("try(%s,%u,%d) ", astring, strlen (astring), tmpFileD); if (tmpFileD >= 0) { flock (tmpFileD, LOCK_EX | LOCK_NB); hJobFile = fdopen (tmpFileD, "w"); dprint ("fdopen(%x,%d) ", hJobFile, tmpFileD); if (hJobFile != 0) { jobNr = tmpJobFileNr; if (SeqFile >= 0) { sprintf (astring , "%u", tmpJobFileNr); len = strlen (astring); lseek (SeqFile, 0, SEEK_SET); write (SeqFile, astring, len); ftruncate (SeqFile, len); } break; } close (tmpFileD); tmpFileD = -1; continue; } if (errno != EEXIST) { break; } } if (SeqFile >= 0) { close (SeqFile); } return (hJobFile != 0); } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/faxrecv/recvdev.cpp0000644000175000017500000004765010470310075020207 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include "recvdev.h" #include "faxrecv.h" #include "defaults.h" #include "ConfAssi.h" #include "PathName.h" #include "osImport.h" #include #include #include #include #include #include #include #include /*===========================================================================*\ \*===========================================================================*/ void closeFIFO (int devinfo, const char * fifoName = 0) { if (devinfo != -1) { close (devinfo); } if (fifoName != 0) { unlink (fifoName); } } int openFIFO(const char* fifoName, int mode) { closeFIFO (-1, fifoName); if ( (access (fifoName, F_OK) == 0) || (mkfifo (fifoName, mode & 0777) < 0)) { return -1; } int fd = open (fifoName, O_RDWR | O_NDELAY, mode & 0777); return (fd); } /*===========================================================================*\ \*===========================================================================*/ CFaxReceiveDevice::CFaxReceiveDevice (CFaxReceiveMain *MainFaxClass, FaxFormatType faxtype) { dhead ("CFaxReceiveDevice-Constructor", DCON_CFaxReceiveDevice); DeviceName.Set (DEFAULT_DEVICE_NAME); MainClass = MainFaxClass; format = faxtype; RecvFileMode = DEFAULT_FILE_MODE; CountThreads = 2; hFIFOfile = -1; hStatusFile = 0; Starting = vFalse; } /*===========================================================================*\ \*===========================================================================*/ CFaxReceiveDevice::~CFaxReceiveDevice (void) { dhead ("CFaxReceiveDevice-Destructor", DCON_CFaxReceiveDevice); if (hFIFOfile >= 0) { closeFIFO (hFIFOfile); hFIFOfile = -1; } if (hStatusFile != 0) { fclose (hStatusFile); hStatusFile = 0; } } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceiveDevice::Config (CConfigParserSection *section) { dhead ("CFaxReceiveDevice::Config", DCON_CFaxReceiveDevice); dassert (section != 0); CDynamicString LocalIdentifier; ConfigAssignment_Item Assignments[] = { { "HylafaxDeviceName", ConfigAssignment_String, &DeviceName }, { "FAXNumber", ConfigAssignment_String, &FaxNumber }, { "LocalIdentifier", ConfigAssignment_String, &LocalIdentifier }, { "RecvFileMode", ConfigAssignment_UInt, &RecvFileMode }, { "MaxConcurrentRecvs", ConfigAssignment_UInt, &CountThreads }, { 0, ConfigAssignment_UInt, 0 } }; ConfigValuesAssignment (§ion->ValueList, &Assignments[0]); if (format == FaxFormat_Hylafax) { // Generate special Config File MainClass->GenerateHylafaxConfigFile (&DeviceName, &FaxNumber, &LocalIdentifier); } tUInt tmpController; tUInt tmpUseDDI; tUInt tmpDDILen; CDynamicString tmpDDIPrefix; tUInt tmpSpeech; tUInt tmpCIPMask; tUInt tmpGlobalCall; CMultiString tmpDDIs; CMultiString tmpMSNs; CMultiString *pMSNs; tSize FindPos; ConfigAssignment_Item CntrlAssignments[] = { { "Controller", ConfigAssignment_UInt, &tmpController }, { "AcceptSpeech", ConfigAssignment_UInt, &tmpSpeech }, { "UseDDI", ConfigAssignment_UInt, &tmpUseDDI }, { "DDILength", ConfigAssignment_UInt, &tmpDDILen }, { "DDIOffset", ConfigAssignment_String, &tmpDDIPrefix }, { "IncomingDDIs", ConfigAssignment_StringList, &tmpDDIs }, { "AcceptGlobalCall", ConfigAssignment_UInt, &tmpGlobalCall }, { "IncomingMSNs", ConfigAssignment_StringList, &tmpMSNs }, { 0, ConfigAssignment_UInt, 0 } }; for (CConfigParserSection *laufSec = (CConfigParserSection *)section->SectionList.GetFirst(); laufSec; laufSec = (CConfigParserSection *)laufSec->GetNext()) { tmpController = 1; tmpUseDDI = 0; tmpGlobalCall = 1; tmpDDILen = 0; tmpSpeech = 0; tmpCIPMask = cipmask_3_1kHzAudio | cipmask_G3Fax; tmpDDIPrefix.RemoveAll(); tmpDDIs.RemoveAndDeleteAll(); tmpMSNs.RemoveAndDeleteAll(); ConfigValuesAssignment (&laufSec->ValueList, &CntrlAssignments[0]); if ((tmpController != 0) && (CIPMSNList.ExistController (tmpController) == vFalse)) { if (tmpSpeech) { tmpCIPMask |= cipmask_Speech; } CIPMSNList.Set (tmpController, 0, tmpCIPMask); CIPMSNList.SetGlobalCallOpt(tmpGlobalCall == 1); if (tmpUseDDI != 0) { CIPMSNList.SetDDI (tmpController, &tmpDDIPrefix, tmpDDILen); pMSNs = &tmpDDIs; } else { pMSNs = &tmpMSNs; } CIPMSNList.SetMSN (tmpController, 0); if (pMSNs->IsEmpty() == vFalse) { COneMultiString *MSNlauf = pMSNs->GetFirst(); dassert (MSNlauf != 0); do { dassert (MSNlauf->GetPointer() != 0); MSNlauf->RemoveChars ((tChar *)" \t_()[]{}\"'`TtPp,.:;"); if (MSNlauf->IsEmpty() == vFalse) { FindPos = MSNlauf->FindChar ('-'); if (FindPos == MAXVAL_tSize) { dprint ("Add MSN-Value=(%s) ", MSNlauf->GetPointer()); switch (CIPMSNList.AddMSN (tmpController, MSNlauf)) { case iErr_OutOfMemory: WriteLog (LOG_ERR, "config-file: No memory to add incoming number (%s).\n", MSNlauf->GetPointer()); break; case iErr_MSNList_MSNOverlap: case iErr_MSNList_MSNEqual: WriteLog (LOG_WARNING, "config-file: Two equal incoming numbers (%s) exist.\n", MSNlauf->GetPointer()); break; case iErr_MSNList_InvalidValue: WriteLog (LOG_ERR, "config-file: Invalid incoming number (%s) detected.\n", MSNlauf->GetPointer()); break; } } else if (FindPos == 0) { WriteLog (LOG_ERR, "config-file: An invalid range (%s), with a missing begin is" " specified in %s\n", MSNlauf->GetPointer(), (tmpUseDDI) ? "IncomingDDIs" : "IncomingMSNs"); } else if (FindPos + 1 >= MSNlauf->GetLen()) { dassert (FindPos + 1 > MSNlauf->GetLen()); WriteLog (LOG_ERR, "config-file: An invalid range (%s) with a missing end is" " specified in %s\n", MSNlauf->GetPointer(), (tmpUseDDI) ? "IncomingDDIs" : "IncomingMSNs"); } else { MSNlauf->Fill ('\0', 1, FindPos); dassert (MSNlauf->GetLen() > FindPos); CConstString aStr (MSNlauf->GetPointer(), FindPos); CConstString bStr (MSNlauf->GetPointer() + FindPos + 1, MSNlauf->GetLen() - FindPos - 1); dprint ("Add MSN-Rang=(%s(%x)-%s(%x)) ", aStr.GetPointer(), aStr.GetLen(), bStr.GetPointer(), bStr.GetLen()); switch (CIPMSNList.AddMSN (tmpController, &aStr, &bStr)) { case iErr_OutOfMemory: WriteLog (LOG_ERR, "config-file: No memory to add range (%s-%s).\n", MSNlauf->GetPointer(), MSNlauf->GetPointer() + FindPos + 1); break; case iErr_MSNList_MSNOverlap: WriteLog (LOG_ERR, "config-file: Overlapping ranges are invalid, so range" " (%s-%s) wasn't added.\n", MSNlauf->GetPointer(), MSNlauf->GetPointer() + FindPos + 1); break; case iErr_MSNList_MSNEqual: WriteLog (LOG_WARNING, "config-file: Two equal ranges (%s-%s) exist.\n", MSNlauf->GetPointer(), MSNlauf->GetPointer() + FindPos + 1); break; case iErr_MSNList_InvalidValue: WriteLog (LOG_ERR, "config-file: Invalid range (%s-%s) detected.\n", MSNlauf->GetPointer(), MSNlauf->GetPointer() + FindPos + 1); break; } } } } while ((MSNlauf = MSNlauf->GetNext()) != 0); } } } } /*===========================================================================*\ \*===========================================================================*/ tBool CFaxReceiveDevice::StartReceive (void) { dhead ("CFaxReceiveDevice::StartReceive", DCON_CFaxReceiveDevice); tUInt i; Starting = vTrue; if (format == FaxFormat_Hylafax) { // Update Status File CPathName StatusFileName (HYLAFAX_STATUS_DIR); StatusFileName.SetRelative (&DeviceName); dassert (StatusFileName.IsEmpty() == vFalse); hStatusFile = fopen ((char *)StatusFileName.GetPointer(), "w"); if (hStatusFile) { fchmod (fileno (hStatusFile), MainClass->LogFileMode); WriteStatus ("Running and idle"); } else { WriteLog (LOG_ERR, "Failed to create status file \"%s\"!\n", StatusFileName.GetPointer()); } if (RecreateFIFO() == vFalse) { WriteLog (LOG_ERR, "Failed to create file \"FIFO.%s\"!\n", DeviceName.GetPointer()); } } if ((CountThreads == 0) || (CIPMSNList.IsEmpty() == vTrue)) { dassert (DeviceName.IsEmpty() == vFalse); WriteLog (LOG_WARNING, "Device \"%s\" is not configured for receiving faxes.\n", DeviceName.GetPointer()); Starting = vFalse; return vFalse; } for (i = CountThreads; i > 0; i--) { CFaxReceive *pFR = new CFaxReceive (this, format); if (pFR) { FaxThreads.AddLast (pFR); pFR->StartReceive(); pFR->SetMSNList (&CIPMSNList); } } if (FaxThreads.IsEmpty() == vTrue) { dwarning (0); WriteLog (LOG_WARNING, "\nDevice \"%s\" can't start any threads needed for receiving faxes!\n", DeviceName.GetPointer()); Starting = vFalse; return vFalse; } WriteLog (LOG_INFO, "\nDevice \"%s\" uses %d receive thread(s) with the following config:\n", DeviceName.GetPointer(), FaxThreads.CountElements()); CIPMSNList.ResetGetNextMask(); CDynamicString line; CDynamicString *pOffset; CMultiString *pMSNs; CMSNRange *pCurMSN; tUInt cntrl; tUInt info; tUInt cip; while (CIPMSNList.GetNextMask (&cntrl, &info, &cip) == vTrue) { pCurMSN = 0; pMSNs = CIPMSNList.GetAllMSNs (cntrl); if (pMSNs) { pCurMSN = (CMSNRange *)pMSNs->GetFirst(); } line.Print ("Controller=%d", cntrl); if (CheckBitsOne (info, infomask_CalledPartyNum)) { pOffset = CIPMSNList.GetDDIOffset (cntrl); if (pOffset && (pOffset->IsEmpty() == vFalse)) { line.PrintAppend (" : DDIOffset=%S", pOffset); } if (pCurMSN) { line.Append (" : IncomingDDIs="); } else { line.PrintAppend (" : DDILen=%d", CIPMSNList.GetDDILen (cntrl)); } } else if (pCurMSN) { line.Append (" : IncomingMSNs="); } else { line.Append (" : accept all"); } while (pCurMSN) { dassert (pCurMSN->IsEmpty() == vFalse); line.Append (pCurMSN); if (pCurMSN->m_End.IsEmpty() == vFalse) { line.PrintAppend ("-%S", &pCurMSN->m_End); } pCurMSN = (CMSNRange *)pCurMSN->GetNext(); if (pCurMSN) { line.Append (","); } } if (!line.ErrorDetected()) { WriteLog (LOG_INFO, "%s\n", line.GetPointer()); } else { dwarning (0); } } Starting = vFalse; return vTrue; } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceiveDevice::StopReceive (void) { dhead ("CFaxReceiveDevice::StopReceive", DCON_CFaxReceiveDevice); for (CFaxReceive *lauf = (CFaxReceive *)FaxThreads.GetFirst(); lauf != 0; lauf = (CFaxReceive *)lauf->GetNext()) { lauf->StopReceive(); } } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceiveDevice::ReceiveStoped (void) { dhead ("CFaxReceiveDevice::ReceiveStoped", DCON_CFaxReceiveDevice); WriteStatus ("Terminated"); NotifyFIFO ('Q'); if ((Starting == vFalse) && FaxThreads.IsEmpty()) { delete this; } } /*===========================================================================*\ \*===========================================================================*/ tBool CFaxReceiveDevice::RecreateFIFO (void) { dhead ("CFaxReceiveDevice::RecreateFIFO", DCON_CFaxReceiveDevice); if (hFIFOfile >= 0) { closeFIFO (hFIFOfile); hFIFOfile = -1; } char FifoName[MAX_STRING_SIZE]; sprintf (FifoName, READ_FIFO_PREFIX "%s", DeviceName.GetPointer()); hFIFOfile = openFIFO (FifoName, 0666); if (hFIFOfile < 0) { return vFalse; } NotifyFIFO ('R'); NotifyFIFO ('N'); NotifyFIFO ('R'); return vTrue; } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceiveDevice::FIFOchanged (void) { dhead ("CFaxReceiveDevice::FIFOchanged", DCON_CFaxReceiveDevice); dprint ("\n"); char ReadCmd[MAX_STRING_SIZE] = ""; tUInt len = read (hFIFOfile, ReadCmd, MAX_STRING_SIZE); dprint ("select-read(%s,%x)\n", ReadCmd, len); if (len && (len + 1)) { switch (*ReadCmd) { //case 'A': // NotifyFIFO ('I'); // AnswerCall (vTrue); // break; //case 'C': // SetConfigItem (ReadCmd + 1, ConfigParamsCount, ConfigParams); // break; case 'H': NotifyFIFO ('N'); NotifyFIFO ('R'); break; case 'S': switch (ReadCmd[1]) { case 'R': // Start Listen break; case 'B': // Stopp Listen break; case 'D': dprint ("faxstate-down -> terminate device! "); StopReceive(); break; default: dprintWrn ("Wrong faxstate value! "); break; } break; case 'Q': StopReceive(); break; //case 'Z': // Disconnect(); // break; } } } /*===========================================================================*\ \*===========================================================================*/ tBool CFaxReceiveDevice::NotifyFIFO (tBool Receive, char Type, char *Data) { dhead ("CFaxReceiveDevice::NotifyFIFO", DCON_CFaxReceive); tBool fret = vFalse; if (format != FaxFormat_Hylafax) { fret = vTrue; } else { int faxqfifo = open (WRITE_FIFO_FILE, O_WRONLY | O_NDELAY); if (faxqfifo >= 0) { char msg[MAX_STRING_SIZE]; sprintf (msg, "%c%s:%c", (Receive == vFalse) ? '+' : '@', DeviceName.GetPointer(), Type); if (Data && *Data) { strcat (msg, Data); } tUInt len = strlen (msg) + 1; if ((tSInt)len <= write (faxqfifo, msg, len)) { fret = vTrue; } else { WriteLog (LOG_WARNING, "Can't write to Hylafax FIFOs!\n"); } close (faxqfifo); } } RETURN ('x', fret); } /*===========================================================================*\ \*===========================================================================*/ tBool CFaxReceiveDevice::NotifyFIFO (char Type) { dhead ("CFaxReceiveDevice::NotifyFIFO", DCON_CFaxReceive); if (format != FaxFormat_Hylafax) { return vTrue; } tBool recv = vFalse; char *text = 0; switch (Type) { case 'N': text = (char *)FaxNumber.GetPointer(); break; case 'R': recv = vFalse; text = "P0c3dff01:ff"; break; case 'Q': Type = 'D'; break; case 'B': case 'E': recv = vTrue; break; } return NotifyFIFO (recv, Type, text); } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceiveDevice::WriteLog (tSInt priority, char *text, ...) { dhead ("CFaxReceiveDevice::WriteLog", DCON_CFaxReceive); va_list params; va_start (params, text); vWriteLog (priority, text, params); va_end (params); } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceiveDevice::vWriteLog (tSInt priority, char *text, va_list args) { dhead ("CFaxReceiveDevice::WriteLog", DCON_CFaxReceive); MainClass->vWriteLog (priority, text, args); } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceiveDevice::WriteStatus (char *text) { dhead ("CFaxReceiveDevice::WriteStatus", DCON_CFaxReceive); if (hStatusFile == 0) { return; } flock (fileno (hStatusFile), LOCK_EX); rewind (hStatusFile); fprintf (hStatusFile, "%s\n", text); fflush (hStatusFile); ftruncate (fileno (hStatusFile), ftell (hStatusFile)); flock (fileno (hStatusFile), LOCK_UN); } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/faxrecv/Makefile.in0000644000175000017500000003542210470310075020104 0ustar mastermaster# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = c2faxrecv$(EXEEXT) subdir = src/faxrecv DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_c2faxrecv_OBJECTS = faxrecv.$(OBJEXT) recvdev.$(OBJEXT) \ recvmain.$(OBJEXT) c2faxrecv_OBJECTS = $(am_c2faxrecv_OBJECTS) c2faxrecv_LDADD = $(LDADD) c2faxrecv_DEPENDENCIES = ../capi/libcapi.a ../convert/libconvert.a \ ../linuxdep/liblinuxdep.a ../standard/libstandard.a DEFAULT_INCLUDES = -I. -I$(srcdir) depcomp = $(SHELL) $(top_srcdir)/src/scripts/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(c2faxrecv_SOURCES) DIST_SOURCES = $(c2faxrecv_SOURCES) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) INSTALL = @INSTALL@ ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ hylafaxbindir = @hylafaxbindir@ hylafaxspooldir = @hylafaxspooldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign CLEANFILES = *~ comperr MAINTAINERCLEANFILES = Makefile.in INCLUDES = -I.. -I$(srcdir)/.. -I$(srcdir)/../standard \ -I$(srcdir)/../capi -I$(srcdir)/../convert \ -I$(srcdir)/../linuxdep LDADD = ../capi/libcapi.a ../convert/libconvert.a ../linuxdep/liblinuxdep.a \ ../standard/libstandard.a noinst_HEADERS = faxrecv.h recvdev.h recvmain.h c2faxrecv_SOURCES = faxrecv.cpp recvdev.cpp recvmain.cpp all: all-am .SUFFIXES: .SUFFIXES: .cpp .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/faxrecv/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/faxrecv/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done c2faxrecv$(EXEEXT): $(c2faxrecv_OBJECTS) $(c2faxrecv_DEPENDENCIES) @rm -f c2faxrecv$(EXEEXT) $(CXXLINK) $(c2faxrecv_LDFLAGS) $(c2faxrecv_OBJECTS) $(c2faxrecv_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/faxrecv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvdev.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvmain.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool ctags distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: capi4hylafax-svn/src/faxrecv/faxrecv.h0000644000175000017500000000545410470310075017650 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _FAXRECV_H_ #define _FAXRECV_H_ #include "Channel.h" #include "BasicFax.h" #include "recvdev.h" #include "sff2huf.h" #include "huf2ftif.h" #include "defaults.h" #include /*===========================================================================*\ \*===========================================================================*/ class CFaxReceive : public CTransferChannel, public CBasicFaxConversion, public CPointerListElement { public: CFaxReceive (CFaxReceiveDevice *FaxRecvDevice, FaxFormatType faxtype); virtual ~CFaxReceive (void); tBool StartReceive (void); void StopReceive (void); private: // virtual functions from CTransferChannel void ListenError (tUInt Controller, c_info Info); void IncomingCall (c_cipvalue CIPValue, CConstString *pOppositeNumber, CConstString *pMyCalledNumber); void DoConnecting (void); void ConnectProceeding (CConstString *ConnectedNumber); void IsConnected (cp_ncpi_all *pNCPI); void PutDataComplete (void *hDataID, c_info Info); void GetData (tUByte *Data, tUShort DataLength, tUShort DataHandle); void DisconnectInquiry (c_info ReasonB3, cp_ncpi_all *pNCPI); void IsDisconnected (c_info Reason); void IsReseted (void); // virtual functions from CBasicFaxConversion void PageEndReached (tBool IsLastPage); void WriteLog (tSInt priority, char *text, ...); tUInt GetRecvFileMode (void); CDynamicString *GetSpoolDir (void); // internal functions struct NameList { NameList *next; tUChar string[1]; }; tBool NotifyFIFO (char Type); tBool GetJobFile (void); CFaxReceiveDevice *FaxDevice; CDynamicString ONumber; CDynamicString MyNumber; tUInt jobNr; tUInt quitRecv; FILE *hJobFile; }; /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/faxrecv/recvdev.h0000644000175000017500000000523010470310075017640 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _RECVDEV_H_ #define _RECVDEV_H_ #include "PtrList.h" #include "recvmain.h" #include "MSNList.h" #include "defaults.h" /*===========================================================================*\ \*===========================================================================*/ class CFaxReceiveDevice : public CPointerListElement { public: CFaxReceiveDevice (CFaxReceiveMain *MainFaxClass, FaxFormatType faxtype); virtual ~CFaxReceiveDevice (void); void Config (CConfigParserSection *section); tBool StartReceive (void); void StopReceive (void); // function called from CFaxReceive void ReceiveStoped (void); // all about FIFO tBool RecreateFIFO (void); tSInt GetFIFOHandle (void); void FIFOchanged (void); tBool NotifyFIFO (tBool Receive, char Type, char *Data); tBool NotifyFIFO (char Type); // write functions void WriteLog (tSInt priority, char *text, ...); void vWriteLog (tSInt priority, char *text, va_list args); void WriteStatus (char *text); CDynamicString DeviceName; CFaxReceiveMain *MainClass; CDynamicString FaxNumber; tUInt RecvFileMode; private: CPointerList FaxThreads; CCntrlMSNList CIPMSNList; FaxFormatType format; tUInt CountThreads; tSInt hFIFOfile; FILE *hStatusFile; tBool Starting; }; /*===========================================================================*\ inline CFaxReciveDevice functions \*===========================================================================*/ inline tSInt CFaxReceiveDevice::GetFIFOHandle (void) { return hFIFOfile; } /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/faxrecv/recvmain.cpp0000644000175000017500000005352310470310075020351 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #include #include #include #include #include #include #include #include #include #include #include #include #include "recvdev.h" #include "FilePars.h" #include "ConfAssi.h" #include "PrctlDmp.h" #include "DbgFile.h" #include "osImport.h" /*===========================================================================*\ \*===========================================================================*/ static CFaxReceiveMain *g_CFaxRecvMain = 0; static void sighandler_term (int signum) { dhead ("sighandler_term", DCON_CFaxReceiveMain); dassert (g_CFaxRecvMain != 0); if (g_CFaxRecvMain) { g_CFaxRecvMain->StopReceive(); } signal (signum, sighandler_term); } /*===========================================================================*\ \*===========================================================================*/ CFaxReceiveMain::CFaxReceiveMain (void) : format (FaxFormat_Hylafax), LogFileName (DEFAULT_C4H_LOGFILENAME), LogLevel (0), hLogFile (0), enableEcho (vFalse), configName (0) { dhead ("CFaxReceiveMain-Constructor", DCON_CFaxReceiveMain); SpoolDir.Set (DEFAULT_SPOOL_DIRECTORY); } /*===========================================================================*\ \*===========================================================================*/ CFaxReceiveMain::~CFaxReceiveMain (void) { dhead ("CFaxReceiveMain-Destructor", DCON_CFaxReceiveMain); if (hLogFile > 0) { fclose (hLogFile); hLogFile = 0; } } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceiveMain::WriteLog (tSInt priority, char *text, ...) { dhead ("CFaxReceiveMain::WriteLog", DCON_CFaxReceiveMain); va_list params; va_start (params, text); vWriteLog (priority, text, params); va_end (params); } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceiveMain::vWriteLog (tSInt priority, char *text, va_list params) { dhead ("CFaxReceiveMain::vWriteLog", DCON_CFaxReceiveMain); char *statusText = 0; char timebuf[MAX_STRING_SIZE]; va_list lparams; timeval tv; gettimeofday (&tv, 0); strftime (timebuf, MAX_STRING_SIZE, "%h %d %T", localtime((time_t*) &tv.tv_sec)); sprintf (timebuf + strlen(timebuf), ".%02lu: [%5d]: ", tv.tv_usec / 10000, getpid()); if (enableEcho) { va_copy(lparams, params); vprintf (text, lparams); va_end(lparams); } // the logging is filtered depending on the trace level and the log priority // info, warning and error loggings get a prefix to inform aboout the kind of the information switch (priority) { default: if (LogLevel < LOG_TRACE_ALL) { return; } break; case LOG_INFO: case LOG_NOTICE: if (LogLevel < LOG_TRACE_INFOS) { return; } statusText = "INFO: "; break; case LOG_WARNING: if (LogLevel < LOG_TRACE_WARNINGS) { return; } statusText = "WARNING: "; break; case LOG_ERR: if (LogLevel < LOG_TRACE_ERRORS) { return; } statusText = "ERROR: "; break; } if (hLogFile) { fprintf (hLogFile, timebuf); fprintf (hLogFile, "%s - ", RecvProgName.GetPointer()); if (statusText) { fprintf (hLogFile, statusText); } va_copy(lparams, params); vfprintf (hLogFile, text, lparams); va_end(lparams); fflush (hLogFile); } // errors should be added to the syslog, too if (priority == LOG_ERR) { char errortext[MAX_STRING_SIZE]; vsnprintf (errortext, MAX_STRING_SIZE, text, params); openlog (DEFAULT_RECVPROG_NAME, LOG_PERROR, 0); syslog (priority, errortext); closelog(); } } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceiveMain::GenerateHylafaxConfigFile (CDynamicString *pName, CDynamicString *pFaxNumber, CDynamicString *pIdentifier) { dhead ("CFaxReceiveMain::GenerateHylafaxConfigFile", DCON_CFaxReceiveMain); dassert (pName != 0); dassert (pName->IsEmpty() == vFalse); CDynamicString LinkName; LinkName.Print ("%S/" HYLAFAX_CONFIG_PREFIX "%S", &SpoolDir, pName); if (LinkName.ErrorDetected()) { return; } // check for symlink struct stat filestat; if (lstat ((char *)LinkName.GetPointer(), &filestat) == 0) { if (S_ISLNK (filestat.st_mode)) { // delete symlink if (unlink ((char *)LinkName.GetPointer()) != 0) { dwarning (0); WriteLog (LOG_ERR, "Can't delete symbolic link \"%s\" to regenerate it as regular file!", LinkName.GetPointer()); return; } } else { if (!S_ISREG (filestat.st_mode)) { dwarning (0); WriteLog (LOG_ERR, "Config file \"%s\" is not a regular file! Please change it or delete the file!", LinkName.GetPointer()); } return; } } if (access ((char *)LinkName.GetPointer(), F_OK) != 0) { //symlink ((char *)configName, (char *)LinkName.GetPointer()); FILE *conffile = fopen ((char *)LinkName.GetPointer(), "w"); if (conffile) { fprintf (conffile, "HylafaxDeviceName: %s\nFAXNumber: %s\n" "LocalIdentifier: \"%s\"\n", pName->GetPointer(), pFaxNumber->GetPointer(), pIdentifier->GetPointer()); fclose (conffile); return; } } WriteLog (LOG_ERR, "Can't create special HylaFAX config file \"%s\"! " "Probably a missing directory or user rights?\n", LinkName.GetPointer()); } /*===========================================================================*\ \*===========================================================================*/ tBool CFaxReceiveMain::Config (char *CommandLineSpoolDir) { dhead ("CFaxReceiveMain::Config", DCON_CFaxReceiveMain); dassert (configName != 0); CConfigFileParser FileParser; printf ("The config file is %s.\n", configName); switch (FileParser.ParseFile (configName)) { case iErr_File_OpenFailed: printf ("Can't open config file \"%s\". Use default values.\n", configName); break; case i_Okay: break; case iErr_OutOfMemory: dassert (0); printf ("Running out of memory during reading of config file!\n"); return vFalse; default: dassert (0); printf ("Can't read config file \"%s\"!\n", configName); return vFalse; } CConfigParserSection *mainSect = FileParser.GetMainSection(); if (!mainSect) { printf ("No information found in the config file.\n"); CFaxReceiveDevice *pNewDevice = new CFaxReceiveDevice (this, format); if (!pNewDevice) { printf ("Running out of Memory!\n"); return vFalse; } AddLast (pNewDevice); } tUInt tmpLogLevel = 0; ConfigAssignment_Item Assignments[] = { { "SpoolDir", ConfigAssignment_String, &SpoolDir }, { "FaxRcvdCmd", ConfigAssignment_String, &FaxRcvdCmd }, { "FaxReceiveUser", ConfigAssignment_String, &FaxUser }, { "FaxReceiveGroup", ConfigAssignment_String, &FaxGroup }, { "LogFile", ConfigAssignment_String, &LogFileName }, { "LogFileMode", ConfigAssignment_UInt, &LogFileMode }, { "LogTraceLevel", ConfigAssignment_UInt, &tmpLogLevel }, { 0, ConfigAssignment_UInt, 0 } }; ConfigValuesAssignment (&mainSect->ValueList, &Assignments[0]); if (CommandLineSpoolDir) { SpoolDir.Set (CommandLineSpoolDir); } if (tmpLogLevel > LogLevel) { LogLevel = tmpLogLevel; } if ((LogFileName.IsEmpty() == vFalse) && (LogLevel != 0)) { hLogFile = fopen ((char *)LogFileName.GetPointer(), "a"); if (hLogFile) { fchmod (fileno(hLogFile), LogFileMode); } } WriteLog (LOG_INFO, "\nC4H-Version " VERSION #ifdef C_PLATFORM_64 " (64Bit).\n\n"); #else " (32Bit).\n\n"); #endif WriteLog (LOG_INFO, "The SpoolDirectory is %s.\n", SpoolDir.GetPointer()); umask (0); setupPermissions(); InitPrctlDumpable(); for (CConfigParserSection *laufSec = (CConfigParserSection *)mainSect->SectionList.GetFirst(); laufSec; laufSec = (CConfigParserSection *)laufSec->GetNext()) { CFaxReceiveDevice *pNewDevice = new CFaxReceiveDevice (this, format); if (!pNewDevice) { printf ("Running out of Memory!\n"); return vFalse; } pNewDevice->Config (laufSec); // if DeviceName still exist delete the new one CFaxReceiveDevice *oldOnes = (CFaxReceiveDevice *)GetFirst(); while (oldOnes) { if (strcmp ((char *)oldOnes->DeviceName.GetPointer(), (char *)pNewDevice->DeviceName.GetPointer()) == 0) { delete pNewDevice; pNewDevice = 0; break; } oldOnes = (CFaxReceiveDevice *)oldOnes->GetNext(); } if (pNewDevice) { AddLast (pNewDevice); } } return vTrue; } /*===========================================================================*\ \*===========================================================================*/ tBool CFaxReceiveMain::StartReceive (void) { dhead ("CFaxReceiveMain::StartReceive", DCON_CFaxReceiveMain); if (SpoolDir.IsEmpty() == vTrue) { dassert (0); WriteLog (LOG_ERR, "An empty Spool Directory was specified but is not allowed!"); return vFalse; } if (chdir ((char *)SpoolDir.GetPointer()) == -1) { dassert (0); WriteLog (LOG_ERR, "Can't change to Spool Directory \"%s\"! " "The directory is missing or inaccessible.\n", SpoolDir.GetPointer()); return vFalse; } char *ModeText = "Hylafax"; switch (format) { case FaxFormat_TIFF: ModeText = "TIFF"; break; case FaxFormat_G3: ModeText = "G3"; break; case FaxFormat_SFF: ModeText = "SFF"; break; default: // nothing to do break; } CFaxReceiveDevice *pCurDev = (CFaxReceiveDevice *)GetFirst(); while (pCurDev != 0) { CFaxReceiveDevice *ptmpDev = pCurDev; pCurDev = (CFaxReceiveDevice *)pCurDev->GetNext(); if (ptmpDev->StartReceive() == vFalse) { delete ptmpDev; } } if (IsEmpty() == vFalse) { WriteLog (LOG_INFO, "\nStarted in %s mode and waiting on incoming calls.\n", ModeText); return vTrue; } WriteLog (LOG_INFO, "\nNo device is waiting for faxes so the program can terminate now.\n"); return vFalse; } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceiveMain::StopReceive (void) { dhead ("CFaxReceiveMain::StopReceive", DCON_CFaxReceiveMain); CFaxReceiveDevice *lauf = (CFaxReceiveDevice *)GetFirst(); while (lauf != 0) { CFaxReceiveDevice *accessDev = lauf; lauf = (CFaxReceiveDevice *)lauf->GetNext(); accessDev->StopReceive(); } } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceiveMain::WaitOnFIFOs (void) { dhead ("CFaxReceiveMain::WaitOnFIFO", DCON_CFaxReceiveMain); tSInt hF; tSInt hFmax; fd_set readfds; fd_set exceptfds; struct timeval twait; CFaxReceiveDevice *lauf; while (IsEmpty() == vFalse) { for (lauf = (CFaxReceiveDevice *)GetFirst(); (lauf != 0); lauf = (CFaxReceiveDevice *)lauf->GetNext()) { lauf->RecreateFIFO(); } do { hFmax = 0; FD_ZERO (&readfds); FD_ZERO (&exceptfds); for (lauf = (CFaxReceiveDevice *)GetFirst(); (lauf != 0); lauf = (CFaxReceiveDevice *)lauf->GetNext()) { hF = lauf->GetFIFOHandle(); dprint ("hF=%x ", hF); if (hF >= 0) { FD_SET (hF, &readfds); FD_SET (hF, &exceptfds); if (hF > hFmax) { hFmax = hF; } } } twait.tv_sec = WAIT_TIME_IN_SEC; twait.tv_usec = 0; dprint ("hFmax=%x ", hFmax); if (select (hFmax + 1, &readfds, 0, &exceptfds, &twait) == -1) { //dprintErr ("select returns an Error=%s(%x) ", strerror (errno), errno); sleep (30); continue; //break; } dprint ("select\n"); lauf = (CFaxReceiveDevice *)GetFirst(); while (lauf != 0) { hF = lauf->GetFIFOHandle(); dwarning (hF >= 0); if ((hF >= 0) && (FD_ISSET (hF, &readfds))) { CFaxReceiveDevice *accessDev = lauf; lauf = (CFaxReceiveDevice *)lauf->GetNext(); accessDev->FIFOchanged(); } else { lauf = (CFaxReceiveDevice *)lauf->GetNext(); } } } while (IsEmpty() == vFalse); } } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceiveMain::setupPermissions (void) { dhead ("CFaxReceiveMain::setupPermissions", DCON_CFaxReceiveMain); if (FaxUser.IsEmpty() || (strcasecmp ((char *)FaxUser.GetPointer(), "root") == 0)) { // nothing to do! return; } dassert (FaxUser.GetPointer() != 0); if (getuid() != 0) { WriteLog (LOG_ERR, "The fax server must be started with real uid root.\n"); return; } uid_t euid = geteuid(); passwd *pwd = getpwnam ((char *)FaxUser.GetPointer()); if (!pwd) { WriteLog (LOG_ERR, "No fax user %s defined on your system!\n", FaxUser.GetPointer()); } else { tUInt errflags = 0; if (!FaxGroup.IsEmpty()) { group *grp = getgrnam ((char *)FaxGroup.GetPointer()); if (!grp) { errflags |= 0x1; WriteLog (LOG_ERR, "No fax group %s defined on your system!\n", FaxGroup.GetPointer()); } else { pwd->pw_gid = grp->gr_gid; } endgrent(); } else { errflags |= 0x1; } if (euid == 0) { if (initgroups (pwd->pw_name, pwd->pw_gid) < 0) { WriteLog (LOG_ERR, "Can not setup permissions (supplementary group list)\n"); } if (setegid (pwd->pw_gid) < 0) { errflags |= 0x1; WriteLog (LOG_ERR, "Can not setup permissions (gid)\n"); } if (seteuid (pwd->pw_uid) < 0) { errflags |= 0x2; WriteLog (LOG_ERR, "Can not setup permissions (uid)\n"); } } else { uid_t faxuid = pwd->pw_uid; uid_t faxgid = pwd->pw_gid; setpwent(); pwd = getpwuid(euid); if (!pwd) { errflags |= 0x3; WriteLog (LOG_ERR, "Can not figure out the identity of uid %u\n", euid); } if (pwd->pw_uid != faxuid) { errflags |= 0x2; WriteLog (LOG_ERR, "Configuration error: The uid couldn't changed to fax user %s.\n", FaxUser.GetPointer()); } if (setegid (faxgid) < 0) { errflags |= 0x1; WriteLog (LOG_ERR, "Can not setup permissions (gid)\n"); } } switch (errflags) { case 0: WriteLog (LOG_INFO, "Changed to effective user \"%s\" and group \"%s\" succesfully.\n", FaxUser.GetPointer(), FaxGroup.GetPointer()); break; case 1: WriteLog (LOG_INFO, "Changed to effective user \"%s\" succesfully.\n", FaxUser.GetPointer()); break; case 2: WriteLog (LOG_INFO, "Changed to effective group \"%s\" succesfully.\n", FaxGroup.GetPointer()); break; default: break; } } endpwent(); } /*===========================================================================*\ \*===========================================================================*/ void CFaxReceiveMain::usage (void) { printf ("usage: %s [-f format] [-q dir] [-C cfile] [-v] [-V] [dev]\n", RecvProgName.GetPointer()); printf ("\t-f Specify the output format. Allowed types are:\n"); printf ("\t HYLAFAX (default), TIFF, SFF.\n"); printf ("\t-q Directory where received faxes are to be stored.\n"); printf ("\t Default: %s\n", DEFAULT_SPOOL_DIRECTORY); printf ("\t-C Name and path of the config file\n"); printf ("\t-L Activate Logging (Filename have to be specified in the config file).\n"); printf ("\t-v Start in verbose mode\n"); printf ("\t-V Show version information\n"); printf ("\tdev: Virtual device name only needed for Hylafax.\n"); printf ("\t Default: %s\n", DEFAULT_DEVICE_NAME); } /*===========================================================================*\ \*===========================================================================*/ tSInt CFaxReceiveMain::main (tSInt argc, char **argv) { dhead ("CFaxReceive::main", DCON_CFaxReceiveMain); char *deviceName = DEFAULT_DEVICE_NAME; char *cl_spooldir = 0; int ch; // get program name char *name = strrchr (argv[0], '/'); if (!name) { name = argv[0]; } else { name++; } if (RecvProgName.Set (name) == vFalse) { printf ("\nError: Memory full!\n"); return 1; } // handle command line parameters while ((ch = getopt (argc, argv, "Hh?VvLDpq:C:f:")) != -1) { switch (ch) { default: usage(); return 1; case 'V': printf ("c2faxrecv Version: %s (c) AVM GmbH\n", VERSION); return 1; case 'D': case 'p': break; case 'v': enableEcho = vTrue; break; case 'L': LogLevel = LOG_TRACE_ALL; break; case 'q': if (optarg && *optarg) { cl_spooldir = optarg; } break; case 'C': if (optarg && *optarg) { configName = (tUChar *)optarg; } break; case 'f': if (!optarg || !*optarg) { break; } if (strcasecmp (optarg, FORMAT_STRING_HYLAFAX) == 0) { format = FaxFormat_Hylafax; } else if (strcasecmp (optarg, FORMAT_STRING_SFF) == 0) { format = FaxFormat_SFF; } else if (strcasecmp (optarg, FORMAT_STRING_TIFF) == 0) { format = FaxFormat_TIFF; } else if (strcasecmp (optarg, FORMAT_STRING_G3) == 0) { format = FaxFormat_G3; } else { printf ("Wrong format param %s!\n\n", optarg); usage(); return 1; } break; } } dprint ("%x,%x-", optind, argc); if (optind < argc) { deviceName = strrchr (argv[optind], '/'); if (deviceName) { deviceName++; } else { deviceName = argv[optind]; } } if (!configName) { configName = (tChar *)DEFAULT_CONFIG_FILE; } if (Config (cl_spooldir) == vFalse) { return 1; } if (StartReceive() == vFalse) { return 2; } g_CFaxRecvMain = this; signal (SIGRTMIN, SIG_IGN); signal (SIGINT, sighandler_term); signal (SIGTERM, sighandler_term); if (format == FaxFormat_Hylafax) { WaitOnFIFOs(); } else { while (IsEmpty() == vFalse) { sleep (10); } } return 0; } /*===========================================================================*\ \*===========================================================================*/ int main (int argc, char **argv) { DebugFileOpen(); CFaxReceiveMain recvmain; int fret = recvmain.main (argc, argv); DebugFileClose(); return fret; } /*===========================================================================*\ \*===========================================================================*/ capi4hylafax-svn/src/faxrecv/Makefile.am0000644000175000017500000000123710470310075020070 0ustar mastermaster## Process this file with automake to produce Makefile.in AUTOMAKE_OPTIONS = foreign CLEANFILES = *~ comperr MAINTAINERCLEANFILES = Makefile.in INCLUDES = -I.. -I$(srcdir)/.. -I$(srcdir)/../standard \ -I$(srcdir)/../capi -I$(srcdir)/../convert \ -I$(srcdir)/../linuxdep LDADD = ../capi/libcapi.a ../convert/libconvert.a ../linuxdep/liblinuxdep.a \ ../standard/libstandard.a noinst_HEADERS = faxrecv.h recvdev.h recvmain.h bin_PROGRAMS = c2faxrecv c2faxrecv_SOURCES = faxrecv.cpp recvdev.cpp recvmain.cpp capi4hylafax-svn/src/faxrecv/recvmain.h0000644000175000017500000000437010470310075020012 0ustar mastermaster/*---------------------------------------------------------------------------*\ Copyright (C) 2000 AVM GmbH. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT ANY LIABILITY FOR ANY DAMAGES arising out of or in connection with the use or performance of this software. See the GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _RECVMAIN_H_ #define _RECVMAIN_H_ #include "PtrList.h" #include "FilePars.h" #include "PathName.h" #include "defaults.h" #include /*===========================================================================*\ \*===========================================================================*/ class CFaxReceiveMain : public CPointerList { public: CFaxReceiveMain (void); ~CFaxReceiveMain (void); void WriteLog (tSInt priority, char *text, ...); void vWriteLog (tSInt priority, char *text, va_list params); void GenerateHylafaxConfigFile (CDynamicString *pName, CDynamicString *pFaxNumber, CDynamicString *pIdentifier); tBool Config (char *CommandLineSpoolDir); tBool StartReceive (void); void StopReceive (void); tSInt main (tSInt argc, char **argv); void setupPermissions (void); void usage (void); CDynamicString FaxRcvdCmd; CPathName SpoolDir; tUInt LogFileMode; private: void WaitOnFIFOs (void); FaxFormatType format; CDynamicString RecvProgName; CDynamicString FaxUser; CDynamicString FaxGroup; CDynamicString LogFileName; tUInt LogLevel; FILE *hLogFile; tBool enableEcho; tUChar *configName; }; /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/Makefile.in0000644000175000017500000003425310470310075016447 0ustar mastermaster# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/defaults.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = defaults.h SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) INSTALL = @INSTALL@ ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ hylafaxbindir = @hylafaxbindir@ hylafaxspooldir = @hylafaxspooldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ program_transform_name = @program_transform_name@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AUTOMAKE_OPTIONS = foreign CLEANFILES = *~ comperr MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = scripts/[a-z]* SUBDIRS = standard capi convert linuxdep faxrecv faxsend all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh defaults.h: $(top_builddir)/config.status $(srcdir)/defaults.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(mkdir_p) $(distdir)/scripts @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ clean clean-generic clean-libtool clean-recursive ctags \ ctags-recursive distclean distclean-generic distclean-libtool \ distclean-recursive distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ mostlyclean mostlyclean-generic mostlyclean-libtool \ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: capi4hylafax-svn/src/defaults.h.in0000644000175000017500000000643010470310075016763 0ustar mastermaster/*---------------------------------------------------------------------------*\ * Copyright (C) 2000 AVM GmbH. All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY, without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, and WITHOUT * ANY LIABILITY FOR ANY DAMAGES arising out of or in connection * with the use or performance of this software. See the * GNU General Public License for further details. \*---------------------------------------------------------------------------*/ #ifndef _DEFAULTS_H_ #define _DEFAULTS_H_ /*===========================================================================*\ \*===========================================================================*/ #define WRITE_FIFO_FILE "FIFO" #define READ_FIFO_PREFIX "FIFO." #define HYLAFAX_CONFIG_PREFIX "etc/config." #define HYLAFAX_RECV_DIR "recvq/" #define HYLAFAX_POLL_DIR "pollq/" #define HYLAFAX_LOG_DIR "log/" #define HYLAFAX_STATUS_DIR "status/" #define HYLAFAX_RECV_CMD "bin/faxrcvd" #define HYLAFAX_POLL_CMD "bin/pollrcvd" #define HYLAFAX_SEQF_FILE "seqf" #define HYLAFAX_XFERLOG "etc/xferfaxlog" #define DEFAULT_FAX_USER "uucp" #define DEFAULT_DEVICE_NAME "faxCAPI" #define DEFAULT_SPOOL_DIRECTORY "@hylafaxspooldir@" #define DEFAULT_CONFIG_FILE "/etc/config.faxCAPI" #define DEFAULT_FILE_MODE 0600 #define DEFAULT_RECVPROG_NAME "CapiFaxRecv" #define DEFAULT_SENDPROG_NAME "CapiFaxSend" #define DEFAULT_C4H_LOGFILENAME "/tmp/capifax.log" #define FILE_EXTENSION_TIFF ".tif" #define FILE_EXTENSION_SFF ".sff" #define FILE_EXTENSION_G3 ".g3" #define NAME_OF_SOFTWARE "AVM CAPI 2.0 Fax Receiver, v.00.01.00" #define NAME_OF_MODEL DEFAULT_RECVPROG_NAME #define MAX_STRING_SIZE 400 #define MAX_TRY_COUNT 1000 #define MAX_SEQ_NUMBER 9999999 #define WAIT_TIME_IN_SEC 30 /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ enum FaxFormatType { FaxFormat_Hylafax, FaxFormat_TIFF, FaxFormat_G3, FaxFormat_SFF }; #define FORMAT_STRING_HYLAFAX "HYLAFAX" #define FORMAT_STRING_SFF "SFF" #define FORMAT_STRING_TIFF "TIFF" #define FORMAT_STRING_G3 "G3" /*---------------------------------------------------------------------------*\ \*---------------------------------------------------------------------------*/ #define LOG_TRACE_NONE 0 #define LOG_TRACE_ERRORS 1 #define LOG_TRACE_WARNINGS 2 #define LOG_TRACE_INFOS 3 #define LOG_TRACE_ALL 4 /*===========================================================================*\ \*===========================================================================*/ #endif capi4hylafax-svn/src/Makefile.am0000644000175000017500000000040510470310075016426 0ustar mastermaster## Process this file with automake to produce Makefile.in AUTOMAKE_OPTIONS = foreign CLEANFILES = *~ comperr MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = scripts/[a-z]* SUBDIRS = standard capi convert linuxdep faxrecv faxsend